pax_global_header 0000666 0000000 0000000 00000000064 15170240131 0014504 g ustar 00root root 0000000 0000000 52 comment=34e9247f3b6008725517cd5359d9fbe64e52aa21
QuantLib-SWIG-1.42.1/ 0000775 0000000 0000000 00000000000 15170240131 0014057 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/.ci/ 0000775 0000000 0000000 00000000000 15170240131 0014530 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/.ci/Build.props 0000664 0000000 0000000 00000001005 15170240131 0016650 0 ustar 00root root 0000000 0000000
C:\local\boost;%(AdditionalIncludeDirectories)
/bigobj %(AdditionalOptions)
QuantLib-SWIG-1.42.1/.ci/Directory.Build.props 0000664 0000000 0000000 00000000255 15170240131 0020621 0 ustar 00root root 0000000 0000000
true
QuantLib-SWIG-1.42.1/.ci/csharp.build 0000775 0000000 0000000 00000000164 15170240131 0017035 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure CC=clang CXX=clang++ CXXFLAGS='-O2'
make -C CSharp SWIGFLAGS='-Werror'
QuantLib-SWIG-1.42.1/.ci/csharp.check 0000775 0000000 0000000 00000000051 15170240131 0017006 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C CSharp check
QuantLib-SWIG-1.42.1/.ci/csharp.install 0000775 0000000 0000000 00000000023 15170240131 0017376 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.42.1/.ci/java-new.build 0000775 0000000 0000000 00000000510 15170240131 0017260 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure --disable-java-finalizer --enable-java-autocloseable \
--with-jdk-include=/usr/lib/jvm/default-java/include \
--with-jdk-system-include=/usr/lib/jvm/default-java/include/linux \
CC=clang CXX=clang++ CXXFLAGS='-O2'
make -C Java SWIGFLAGS='-Werror'
QuantLib-SWIG-1.42.1/.ci/java-new.check 0000775 0000000 0000000 00000000047 15170240131 0017243 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C Java check
QuantLib-SWIG-1.42.1/.ci/java-new.install 0000775 0000000 0000000 00000000023 15170240131 0017626 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.42.1/.ci/java-old.build 0000775 0000000 0000000 00000000405 15170240131 0017250 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure --with-jdk-include=/usr/lib/jvm/default-java/include \
--with-jdk-system-include=/usr/lib/jvm/default-java/include/linux \
CC=clang CXX=clang++ CXXFLAGS='-O2'
make -C Java SWIGFLAGS='-Werror'
QuantLib-SWIG-1.42.1/.ci/java-old.check 0000775 0000000 0000000 00000000047 15170240131 0017230 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C Java check
QuantLib-SWIG-1.42.1/.ci/java-old.install 0000775 0000000 0000000 00000000023 15170240131 0017613 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.42.1/.ci/nupkg/ 0000775 0000000 0000000 00000000000 15170240131 0015654 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/.ci/nupkg/Example.csproj 0000664 0000000 0000000 00000000726 15170240131 0020476 0 ustar 00root root 0000000 0000000
net6.0;net7.0;net8.0;net9.0;net10.0
false
Exe
../../nupkg;https://api.nuget.org/v3/index.json
QuantLib-SWIG-1.42.1/.ci/nupkg/QuantLib.csproj 0000664 0000000 0000000 00000002657 15170240131 0020627 0 ustar 00root root 0000000 0000000
netstandard2.0;net6.0;net7.0;net8.0;net9.0;net10.0
QuantLib: the free/open-source library for quantitative finance
README.md
LICENSE.txt
https://www.quantlib.org
The QuantLib contributors
See license file
runtimes/win-x64/native
runtimes/osx-arm64/native
runtimes/osx-x64/native
runtimes/linux-x64/native
QuantLib-SWIG-1.42.1/.ci/nupkg/README.md 0000664 0000000 0000000 00000001776 15170240131 0017146 0 ustar 00root root 0000000 0000000 # QuantLib: the free/open-source library for quantitative finance
The QuantLib project () is aimed at providing a comprehensive software framework for quantitative finance. QuantLib is a free/open-source library for modeling, trading, and risk management in real-life.
QuantLib is Non-Copylefted Free Software and OSI Certified Open Source Software.
## Note on multi-threading
The underlying C++ library is not thread-safe. However, it provides some configuration options that make it possible to use these wrappers from C# using some limited multi-threading. In particular:
- the globals in the library are per-thread; most notably, the evaluation date and the stored index fixings;
- there is code in place to prevent the garbage collector to interfere with notifications inside the library.
Any more complex attempt at multi-threading will probably fail. We suggest to avoid sharing objects and state across threads; each thread should have its set of objects, evaluation date etc.
QuantLib-SWIG-1.42.1/.ci/nupkg/userconfig.hpp 0000664 0000000 0000000 00000013154 15170240131 0020535 0 ustar 00root root 0000000 0000000 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2004, 2011 Ferdinando Ametrano
Copyright (C) 2004, 2005 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
. The license is also available online at
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef quantlib_config_hpp
#define quantlib_config_hpp
/***************************************************************
User configuration section:
modify the following definitions to suit your preferences.
Do not modify this file if you are using a Linux/Unix system:
it will not be read by the compiler. The definitions below
will be provided by running ./configure instead.
****************************************************************/
/* If defined, function information is added to the error messages
thrown by the library.
*/
#ifndef QL_ERROR_FUNCTIONS
//# define QL_ERROR_FUNCTIONS
#endif
/* If defined, file and line information is added to the error
messages thrown by the library.
*/
#ifndef QL_ERROR_LINES
//# define QL_ERROR_LINES
#endif
/* If defined, tracing messages might be emitted by the library
depending on run-time settings. Enabling this option can degrade
performance.
*/
#ifndef QL_ENABLE_TRACING
//# define QL_ENABLE_TRACING
#endif
/* If defined, extra run-time checks are added to a few
functions. This can prevent their inlining and degrade
performance.
*/
#ifndef QL_EXTRA_SAFETY_CHECKS
//# define QL_EXTRA_SAFETY_CHECKS
#endif
/* If defined, indexed coupons (see the documentation) are used in
floating legs. If undefined, par coupons are used.
*/
#ifndef QL_USE_INDEXED_COUPON
//# define QL_USE_INDEXED_COUPON
#endif
/* If defined, singletons will return different instances for
different threads; in particular, this means that the evaluation
date, the stored index fixings and any other settings will be
per-thread.
*/
#ifndef QL_ENABLE_SESSIONS
# define QL_ENABLE_SESSIONS
#endif
/* If defined, a thread-safe (but less performant) version of the
observer pattern is used. You should define it if you want to use
QuantLib via the SWIG layer within the JVM or .NET ecosystem or
any other environment with an async garbage collector.
*/
#ifndef QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
# define QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
#endif
/* If defined, date objects willsupport an intraday datetime
resolution down to microseconds. Strictly monotone daycounters
(`Actual360`, `Actual365Fixed` and `ActualActual`) will take the
additional information into account and allow for accurate intraday
pricing. If undefined, the smallest resolution of date objects is
a single day. Intraday datetime resolution is experimental.
*/
#ifndef QL_HIGH_RESOLUTION_DATE
//# define QL_HIGH_RESOLUTION_DATE
#endif
/* If defined, lazy objects will raise an exception when they detect a
notification cycle which would result in an infinite recursion
loop. If undefined, they will break the recursion without throwing.
Enabling this option is recommended but might cause existing code
to throw.
*/
#ifndef QL_THROW_IN_CYCLES
//# define QL_THROW_IN_CYCLES
#endif
/* If defined, lazy objects will forward the first notification
received, and discard the others until recalculated; the rationale
is that observers were already notified, and don't need further
notifications until they recalculate, at which point this object
would be recalculated too. After recalculation, this object would
again forward the first notification received. Although not always
correct, this behavior is a lot faster and thus is the current
default.
*/
#ifndef QL_FASTER_LAZY_OBJECTS
# define QL_FASTER_LAZY_OBJECTS
#endif
/* If defined, `std::any` and related classes and functions will be
used instead of `boost::any`. If undefined, the Boost facilities
will be used.
*/
#ifndef QL_USE_STD_ANY
# define QL_USE_STD_ANY
#endif
/* If defined, `std::optional` and related classes and functions will
be used instead of `boost::optional`. If undefined, the Boost
facilities will be used.
*/
#ifndef QL_USE_STD_OPTIONAL
# define QL_USE_STD_OPTIONAL
#endif
/* If defined, `std::shared_ptr` and related classes and functions
will used instead of `boost::shared_ptr`. If undefined, the Boost
facilities will be used. Note that `std::shared_ptr` does not check
access and can cause segmentation faults.
*/
#ifndef QL_USE_STD_SHARED_PTR
//# define QL_USE_STD_SHARED_PTR
#endif
/* If defined, `Null` will be implemented as a template function.
This allows the code to work with user-defined `Real` types but was
reported to cause internal compiler errors with Visual C++ 2022 in
some cases. If undefined, `Null` will be implemented as a class
template, as in previous releases.
*/
#ifndef QL_NULL_AS_FUNCTIONS
//# define QL_NULL_AS_FUNCTIONS
#endif
/* If defined, a parallel unit test runner will be used to execute the
C++ test suite. This will reduce the runtime on multi core CPUs.
*/
#ifndef QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
//# define QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
#endif
#endif
QuantLib-SWIG-1.42.1/.ci/python.build 0000775 0000000 0000000 00000000302 15170240131 0017070 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
python3 -m venv .venv
. .venv/bin/activate
pip install setuptools build tox
./autogen.sh
./configure CC=clang CXX=clang++ CXXFLAGS='-O1'
make -C Python SWIGFLAGS='-Werror'
QuantLib-SWIG-1.42.1/.ci/python.check 0000775 0000000 0000000 00000000220 15170240131 0017045 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
. .venv/bin/activate
make -C Python check
for i in Python/examples/*.py
do
echo "$i"
python "$i" || break -1
done
QuantLib-SWIG-1.42.1/.ci/python.install 0000775 0000000 0000000 00000000304 15170240131 0017441 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
. .venv/bin/activate
pip install Python/dist/*.whl
grep -v QuantLib binder/requirements.txt > Python/examples/requirements.txt
pip install -r Python/examples/requirements.txt
QuantLib-SWIG-1.42.1/.ci/r.build 0000775 0000000 0000000 00000000255 15170240131 0016017 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
mkdir -p ~/.R
echo 'CC=clang' > ~/.R/Makevars
echo 'CXX=clang++' >> ~/.R/Makevars
./autogen.sh
./configure CXXFLAGS='-O0'
make -C R SWIGFLAGS='-Werror'
QuantLib-SWIG-1.42.1/.ci/r.check 0000775 0000000 0000000 00000000203 15170240131 0015766 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
echo Execute Scripts in demo folder
for fn in ./R/demo/*.R
do
echo $fn
Rscript "$fn" || break -1
done
QuantLib-SWIG-1.42.1/.ci/r.install 0000775 0000000 0000000 00000000066 15170240131 0016366 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
R CMD INSTALL ./R.Rcheck/QuantLib
QuantLib-SWIG-1.42.1/.ci/scala.build 0000775 0000000 0000000 00000000342 15170240131 0016636 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure --with-jdk-include=/usr/lib/jvm/default-java/include \
--with-jdk-system-include=/usr/lib/jvm/default-java/include/linux CXXFLAGS='-O2'
make -C Java SWIGFLAGS='-Werror'
QuantLib-SWIG-1.42.1/.ci/scala.check 0000775 0000000 0000000 00000000050 15170240131 0016610 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C Scala check
QuantLib-SWIG-1.42.1/.ci/scala.install 0000775 0000000 0000000 00000000023 15170240131 0017201 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.42.1/.ci/wheels/ 0000775 0000000 0000000 00000000000 15170240131 0016017 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/.ci/wheels/before_all_linux.sh 0000775 0000000 0000000 00000000551 15170240131 0021670 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
# Setup Boost
curl -O -L https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.gz
tar xfz boost_*.tar.gz
cd boost_*/
mv boost /usr/local/include/
cd ..
# Build QuantLib
cd QuantLib-1.*/
./configure --disable-static --disable-test-suite --enable-skip-examples --enable-unity-build CXXFLAGS="${CXXQLFLAGS}"
make -j 4 install
cd ..
QuantLib-SWIG-1.42.1/.ci/wheels/before_all_linux_nogil.sh 0000775 0000000 0000000 00000000617 15170240131 0023063 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
# Setup Boost
curl -O -L https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.gz
tar xfz boost_*.tar.gz
cd boost_*/
mv boost /usr/local/include/
cd ..
# Build QuantLib
cd QuantLib-1.*/
./configure --disable-static --enable-thread-safe-observer-pattern --disable-test-suite --enable-skip-examples --enable-unity-build CXXFLAGS="${CXXQLFLAGS}"
make -j 4 install
cd ..
QuantLib-SWIG-1.42.1/.ci/wheels/userconfig_nogil.hpp 0000664 0000000 0000000 00000013156 15170240131 0022072 0 ustar 00root root 0000000 0000000 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2004, 2011 Ferdinando Ametrano
Copyright (C) 2004, 2005 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
. The license is also available online at
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
#ifndef quantlib_config_hpp
#define quantlib_config_hpp
/***************************************************************
User configuration section:
modify the following definitions to suit your preferences.
Do not modify this file if you are using a Linux/Unix system:
it will not be read by the compiler. The definitions below
will be provided by running ./configure instead.
****************************************************************/
/* If defined, function information is added to the error messages
thrown by the library.
*/
#ifndef QL_ERROR_FUNCTIONS
//# define QL_ERROR_FUNCTIONS
#endif
/* If defined, file and line information is added to the error
messages thrown by the library.
*/
#ifndef QL_ERROR_LINES
//# define QL_ERROR_LINES
#endif
/* If defined, tracing messages might be emitted by the library
depending on run-time settings. Enabling this option can degrade
performance.
*/
#ifndef QL_ENABLE_TRACING
//# define QL_ENABLE_TRACING
#endif
/* If defined, extra run-time checks are added to a few
functions. This can prevent their inlining and degrade
performance.
*/
#ifndef QL_EXTRA_SAFETY_CHECKS
//# define QL_EXTRA_SAFETY_CHECKS
#endif
/* If defined, indexed coupons (see the documentation) are used in
floating legs. If undefined, par coupons are used.
*/
#ifndef QL_USE_INDEXED_COUPON
//# define QL_USE_INDEXED_COUPON
#endif
/* If defined, singletons will return different instances for
different threads; in particular, this means that the evaluation
date, the stored index fixings and any other settings will be
per-thread.
*/
#ifndef QL_ENABLE_SESSIONS
//# define QL_ENABLE_SESSIONS
#endif
/* If defined, a thread-safe (but less performant) version of the
observer pattern is used. You should define it if you want to use
QuantLib via the SWIG layer within the JVM or .NET ecosystem or
any other environment with an async garbage collector.
*/
#ifndef QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
# define QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
#endif
/* If defined, date objects willsupport an intraday datetime
resolution down to microseconds. Strictly monotone daycounters
(`Actual360`, `Actual365Fixed` and `ActualActual`) will take the
additional information into account and allow for accurate intraday
pricing. If undefined, the smallest resolution of date objects is
a single day. Intraday datetime resolution is experimental.
*/
#ifndef QL_HIGH_RESOLUTION_DATE
//# define QL_HIGH_RESOLUTION_DATE
#endif
/* If defined, lazy objects will raise an exception when they detect a
notification cycle which would result in an infinite recursion
loop. If undefined, they will break the recursion without throwing.
Enabling this option is recommended but might cause existing code
to throw.
*/
#ifndef QL_THROW_IN_CYCLES
//# define QL_THROW_IN_CYCLES
#endif
/* If defined, lazy objects will forward the first notification
received, and discard the others until recalculated; the rationale
is that observers were already notified, and don't need further
notifications until they recalculate, at which point this object
would be recalculated too. After recalculation, this object would
again forward the first notification received. Although not always
correct, this behavior is a lot faster and thus is the current
default.
*/
#ifndef QL_FASTER_LAZY_OBJECTS
# define QL_FASTER_LAZY_OBJECTS
#endif
/* If defined, `std::any` and related classes and functions will be
used instead of `boost::any`. If undefined, the Boost facilities
will be used.
*/
#ifndef QL_USE_STD_ANY
# define QL_USE_STD_ANY
#endif
/* If defined, `std::optional` and related classes and functions will
be used instead of `boost::optional`. If undefined, the Boost
facilities will be used.
*/
#ifndef QL_USE_STD_OPTIONAL
# define QL_USE_STD_OPTIONAL
#endif
/* If defined, `std::shared_ptr` and related classes and functions
will used instead of `boost::shared_ptr`. If undefined, the Boost
facilities will be used. Note that `std::shared_ptr` does not check
access and can cause segmentation faults.
*/
#ifndef QL_USE_STD_SHARED_PTR
//# define QL_USE_STD_SHARED_PTR
#endif
/* If defined, `Null` will be implemented as a template function.
This allows the code to work with user-defined `Real` types but was
reported to cause internal compiler errors with Visual C++ 2022 in
some cases. If undefined, `Null` will be implemented as a class
template, as in previous releases.
*/
#ifndef QL_NULL_AS_FUNCTIONS
//# define QL_NULL_AS_FUNCTIONS
#endif
/* If defined, a parallel unit test runner will be used to execute the
C++ test suite. This will reduce the runtime on multi core CPUs.
*/
#ifndef QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
//# define QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
#endif
#endif
QuantLib-SWIG-1.42.1/.github/ 0000775 0000000 0000000 00000000000 15170240131 0015417 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/.github/boring-cyborg.yml 0000664 0000000 0000000 00000001145 15170240131 0020706 0 ustar 00root root 0000000 0000000
# Comment to be posted to welcome users when they open their first PR
firstPRWelcomeComment: >
Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.
# Comment to be posted to congratulate user on their first merged PR
firstPRMergeComment: >
Congratulations on your first merged pull request!
# Comment to be posted to on first time issues
firstIssueWelcomeComment: >
Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.
QuantLib-SWIG-1.42.1/.github/dependabot.yml 0000664 0000000 0000000 00000000261 15170240131 0020246 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"
QuantLib-SWIG-1.42.1/.github/workflows/ 0000775 0000000 0000000 00000000000 15170240131 0017454 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/.github/workflows/copyrights.yml 0000664 0000000 0000000 00000001267 15170240131 0022400 0 ustar 00root root 0000000 0000000 name: Update copyright list
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
copyrights:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check
run: |
./tools/check_copyrights.sh
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-copyright-list-${{ github.ref_name }}
delete-branch: true
commit-message: 'Update copyright list in license'
title: 'Update copyright list in license'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/devenv-images.yml 0000664 0000000 0000000 00000005776 15170240131 0022750 0 ustar 00root root 0000000 0000000 name: Build quantlib-swig-devenv Docker images
on:
schedule:
- cron: '0 0 * * 6'
workflow_dispatch:
jobs:
docker-images-base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Checkout latest QuantLib master
uses: actions/checkout@v6
with:
repository: lballabio/QuantLib
path: dockerfiles/QuantLib
- name: Build Docker images
working-directory: dockerfiles
run: |
rm -rf QuantLib/.git
docker build -f ci.base.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:base .
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:base
docker-images-ql:
runs-on: ubuntu-latest
needs: docker-images-base
strategy:
matrix:
tag: [default, threadsafe]
steps:
- uses: actions/checkout@v6
- name: Build Docker images
working-directory: dockerfiles
run: |
docker build -f ci.${{ matrix.tag }}.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.tag }} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.tag }}
docker-images-base-languages:
runs-on: ubuntu-latest
needs: docker-images-ql
strategy:
matrix:
lang: [python, csharp, java, r]
steps:
- uses: actions/checkout@v6
- name: Build Docker images
working-directory: dockerfiles
run: |
docker build -f ci.${{ matrix.lang }}.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }}
docker-images-dependent-languages:
runs-on: ubuntu-latest
needs: docker-images-base-languages
strategy:
matrix:
lang: [scala]
steps:
- uses: actions/checkout@v6
- name: Build Docker images
working-directory: dockerfiles
run: |
docker build -f ci.${{ matrix.lang }}.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }}
QuantLib-SWIG-1.42.1/.github/workflows/increase-version-number.yml 0000664 0000000 0000000 00000003023 15170240131 0024737 0 ustar 00root root 0000000 0000000 name: Increase version number
on:
workflow_dispatch:
jobs:
increase-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo ${LATEST_RELEASE} | awk -F '.' '{ print "LATEST_MINOR=" $2 }' | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_MINOR=" $2 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${NEXT_MINOR}-dev],/g" configure.ac
sed -i -e "s/^ version=.*$/ version=\"1.${NEXT_MINOR}-dev\",/g" Python/setup.py
sed -i -e "s/^Version: .*$/Version: 1.${NEXT_MINOR}/g" R/DESCRIPTION
git commit -a -m "Set version to 1.${NEXT_MINOR}-dev"
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: set-to-rc-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.NEXT_MINOR }}-dev'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/license-url.yml 0000664 0000000 0000000 00000001500 15170240131 0022415 0 ustar 00root root 0000000 0000000 name: Update old license links
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
license-urls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check
run: |
shopt -s globstar
sed -i -e 's|http://quantlib\.org/license\.shtml|https://www.quantlib.org/license.shtml|g' **/*.i **/*.ac **/*.cs **/*.java **/*.py **/*.scala **/*.in
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-license-links-${{ github.ref_name }}
delete-branch: true
commit-message: 'Update old license links'
title: 'Update old license links'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/linux.yml 0000664 0000000 0000000 00000001534 15170240131 0021341 0 ustar 00root root 0000000 0000000 name: Linux build
on:
push:
branches:
- '**'
pull_request:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: python
- language: java
config: -old
- language: java
config: -new
- language: csharp
- language: r
- language: scala
container: ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.language }}
steps:
- uses: actions/checkout@v6
- name: Build
run: |
./.ci/${{ matrix.language }}${{ matrix.config }}.build
- name: Install
run: |
./.ci/${{ matrix.language }}${{ matrix.config }}.install
- name: Check
run: |
./.ci/${{ matrix.language }}${{ matrix.config }}.check
QuantLib-SWIG-1.42.1/.github/workflows/misspell.yml 0000664 0000000 0000000 00000001207 15170240131 0022027 0 ustar 00root root 0000000 0000000 name: Misspell fixer
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: sobolevn/misspell-fixer-action@master
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: misspell-fixes-${{ github.ref_name }}
delete-branch: true
commit-message: 'Fixes by misspell-fixer'
title: 'Typos fixed by misspell-fixer'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/namespaces.yml 0000664 0000000 0000000 00000003003 15170240131 0022312 0 ustar 00root root 0000000 0000000 name: Fix uses of boost and/or ext namespace
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
namespaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check
run: |
sed -i -e 's/boost::shared_ptr\b/ext::shared_ptr/g' SWIG/*
sed -i -e 's/boost::make_shared\b/ext::make_shared/g' SWIG/*
sed -i -e 's/boost::dynamic_pointer_cast\b/ext::dynamic_pointer_cast/g' SWIG/*
sed -i -e 's/ext::tuple\b/std::tuple/g' SWIG/*
sed -i -e 's/ext::make_tuple\b/std::make_tuple/g' SWIG/*
sed -i -e 's/ext::get\b/std::get/g' SWIG/*
sed -i -e 's/ext::tie\b/std::tie/g' SWIG/*
sed -i -e 's/ext::function\b/std::function/g' SWIG/*
sed -i -e 's/ext::bind\b/std::bind/g' SWIG/*
sed -i -e 's/ext::ref\b/std::ref/g' SWIG/*
sed -i -e 's/ext::cref\b/std::cref/g' SWIG/*
sed -i -e 's/ext::placeholders\b/std::placeholders/g' SWIG/*
sed -i -e 's/boost::optional\b/ext::optional/g' SWIG/*
sed -i -e 's/boost::none\b/ext::nullopt/g' SWIG/*
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: fix-boost-namespace-${{ github.ref_name }}
delete-branch: true
commit-message: 'Fix uses of boost and/or ext namespace'
title: 'Fix uses of boost and/or ext namespace'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/nupkg.yml 0000664 0000000 0000000 00000040031 15170240131 0021321 0 ustar 00root root 0000000 0000000 name: Build C# nupkg
on:
push:
# build wheels for releases and prereleases
# this workflow assumes that the same branch already exists in the QuantLib repo
tags:
- 'v1.[0-9]+'
- 'v1.[0-9]+.[0-9]+'
- 'v1.[0-9]+-rc'
- 'v1.[0-9]+.[0-9]+-rc'
workflow_dispatch:
# manual runs to try out changes in the workflow
inputs:
ref:
description: 'Tag or branch to use'
required: true
jobs:
# making tarballs sidesteps the problem of installing the desired SWIG version on all systems
make-tarballs:
runs-on: ubuntu-latest
steps:
- name: Determine tag or branch to build
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "REF=${{ github.event.inputs.ref }}" | tee -a $GITHUB_ENV
else
echo "REF=${{ github.ref_name }}" | tee -a $GITHUB_ENV
fi
- name: Setup
env:
SWIG_VERSION: 4.4.1
run: |
sudo apt update
sudo apt install -y libpcre2-dev libboost-dev tofrodos
wget http://downloads.sourceforge.net/project/swig/swig/swig-${SWIG_VERSION}/swig-${SWIG_VERSION}.tar.gz \
&& tar xfz swig-${SWIG_VERSION}.tar.gz \
&& rm swig-${SWIG_VERSION}.tar.gz \
&& cd swig-${SWIG_VERSION} \
&& ./configure --prefix=/usr CXXFLAGS=-O3 \
&& make -j 4 && sudo make install \
&& cd .. && rm -rf swig-${SWIG_VERSION}
- uses: actions/checkout@v6
with:
repository: lballabio/QuantLib
ref: ${{ env.REF }}
path: quantlib
fetch-depth: 0
fetch-tags: true
- name: Make tarballs for QuantLib
run: |
cd quantlib
./autogen.sh
./configure
make dist
mkdir ../tarballs
mv QuantLib-*.tar.gz ../tarballs
cd ../tarballs && ../quantlib/tools/tgz2zip QuantLib-*.tar.gz && ls -lh
- uses: actions/checkout@v6
with:
repository: lballabio/QuantLib-SWIG
ref: ${{ env.REF }}
path: quantlib-swig
fetch-depth: 0
fetch-tags: true
- name: Make tarballs for QuantLib-SWIG
run: |
cd quantlib-swig
./autogen.sh
./configure
make dist
mv QuantLib-SWIG-*.tar.gz ../tarballs
cd ../tarballs && ../quantlib-swig/tools/tgz2zip QuantLib-SWIG-*.tar.gz && ls -lh
- uses: actions/upload-artifact@v7
with:
name: tarballs
path: ./tarballs/*
detect-version:
runs-on: ubuntu-latest
needs: make-tarballs
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- id: version
run: |
echo "version=`ls QuantLib-1*.tar.gz | sed 's/QuantLib-//' | sed 's/\.tar\.gz//'`" | tee -a "$GITHUB_OUTPUT"
dotnet-win-wrap:
runs-on: windows-2022
needs: detect-version
steps:
- uses: actions/checkout@v6
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v3
- name: Setup Boost
run: |
$Url = "https://archives.boost.io/release/1.90.0/source/boost_1_90_0.zip"
(New-Object System.Net.WebClient).DownloadFile($Url, "$RUNNER_TEMP\boost.zip")
Expand-Archive -Path "$RUNNER_TEMP\boost.zip" -DestinationPath C:\local
Rename-Item -Path "C:\local\boost_1_90_0" -NewName "boost"
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
Expand-Archive -Path QuantLib-${{ needs.detect-version.outputs.version }}.zip -DestinationPath C:\local
Copy-Item .ci\Build.props C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
Copy-Item .ci\Directory.Build.props C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
Copy-Item .ci\nupkg\userconfig.hpp C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\ql\userconfig.hpp
cd C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
msbuild QuantLib.vcxproj -p:Configuration="Release" -p:Platform=x64 -p:PlatformToolset=v142
dir lib
- name: Build QuantLib wrappers
env:
QL_DIR: C:\local\QuantLib-${{ needs.detect-version.outputs.version }}
run: |
Expand-Archive -Path QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.zip -DestinationPath C:\local
Copy-Item .ci\Build.props C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp\
cd C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp
msbuild QuantLibWrapper.vcxproj -p:Configuration="Release" -p:Platform=x64 -p:PlatformToolset=v142
- name: Save DLL as artifact
uses: actions/upload-artifact@v7
with:
name: dll-win-x64
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp\NQuantLibc.dll
dotnet-osx-wrap:
runs-on: macos-14
needs: detect-version
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v6
- name: Setup Boost
run: |
brew install boost
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
tar xfz QuantLib-${{ needs.detect-version.outputs.version }}.tar.gz
cd QuantLib-${{ needs.detect-version.outputs.version }}/
./configure --disable-shared --with-boost-include=`brew --prefix`/include --enable-thread-safe-observer-pattern --enable-sessions --enable-unity-build --disable-test-suite --enable-skip-examples
make -j3 CXXFLAGS="-std=c++17 -g0 -O3 -arch ${{ matrix.arch }}" LDFLAGS="-arch ${{ matrix.arch }}"
sudo make install
- name: Build QuantLib wrappers
run: |
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
cd QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp
clang++ -c -fpic -std=c++17 -g0 -O3 -arch ${{ matrix.arch }} cpp/quantlib_wrap.cpp -o cpp/quantlib_wrap.o `quantlib-config --cflags`
clang++ -shared -arch ${{ matrix.arch }} cpp/quantlib_wrap.o -o cpp/libNQuantLibc.dylib `quantlib-config --libs`
- name: Save DLL as artifact
uses: actions/upload-artifact@v7
with:
name: dll-osx-${{ matrix.arch }}
path: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/cpp/libNQuantLibc.dylib
dotnet-linux-wrap:
runs-on: ubuntu-22.04
needs: detect-version
steps:
- uses: actions/checkout@v6
- name: Setup Boost
run: |
curl -O -L https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.gz
tar xfz boost_*.tar.gz
cd boost_*/
sudo mv boost /usr/local/include/
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
tar xfz QuantLib-${{ needs.detect-version.outputs.version }}.tar.gz
cd QuantLib-${{ needs.detect-version.outputs.version }}/
./configure --disable-shared --enable-thread-safe-observer-pattern --enable-sessions --enable-unity-build --disable-test-suite --enable-skip-examples
make -j4 CXXFLAGS="-g0 -O3 -std=c++17 -fPIC"
sudo make install
- name: Build QuantLib wrappers
run: |
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
cd QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp
g++ -c -g0 -O3 -fPIC cpp/quantlib_wrap.cpp -o cpp/quantlib_wrap.o `quantlib-config --cflags`
g++ -shared cpp/quantlib_wrap.o -o cpp/libNQuantLibc.so `quantlib-config --libs`
- name: Save DLL as artifact
uses: actions/upload-artifact@v7
with:
name: dll-linux-x64
path: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/cpp/libNQuantLibc.so
dotnet-nupkg:
runs-on: windows-2022
needs: [dotnet-win-wrap, dotnet-osx-wrap, dotnet-linux-wrap, detect-version]
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Extract QuantLib-SWIG
run: |
Expand-Archive -Path QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.zip -DestinationPath C:\local
- uses: actions/download-artifact@v8
with:
name: dll-win-x64
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp\win-x64
- uses: actions/download-artifact@v8
with:
name: dll-osx-x86_64
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp\osx-x64
- uses: actions/download-artifact@v8
with:
name: dll-osx-arm64
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp\osx-arm64
- uses: actions/download-artifact@v8
with:
name: dll-linux-x64
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\cpp\linux-x64
- name: Build nupkg
run: |
Remove-Item C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\csharp\NQuantLib.csproj
Copy-Item .ci\nupkg\QuantLib.csproj C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\csharp\
Copy-Item .ci\nupkg\README.md C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\csharp\
Copy-Item LICENSE.txt C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\csharp\
cd C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\csharp
dotnet build -c Release
dotnet pack --no-build -c Release -p:PackageVersion=${{ needs.detect-version.outputs.version }} -o ..\nupkg
- name: Save nupkg as artifact
uses: actions/upload-artifact@v7
with:
name: nupkg-all
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\nupkg\*.nupkg
dotnet-win-check:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net8.0', 'net9.0', 'net10.0']
needs: [dotnet-nupkg, detect-version]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Setup examples
run: |
Expand-Archive -Path QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.zip -DestinationPath C:\local
Copy-Item .ci\nupkg\Example.csproj C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\BermudanSwaption\BermudanSwaption.csproj
Copy-Item .ci\nupkg\Example.csproj C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\EquityOption\EquityOption.csproj
Copy-Item .ci\nupkg\Example.csproj C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\FiniteDifferenceMethods\FiniteDifferenceMethods.csproj
Copy-Item .ci\nupkg\Example.csproj C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\Times\Times.csproj
- uses: actions/download-artifact@v8
with:
name: nupkg-all
path: C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\nupkg
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Run C# examples
env:
QL_VERSION: ${{ needs.detect-version.outputs.version }}
run: |
cd C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\BermudanSwaption
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
cd C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\EquityOption
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
cd C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\FiniteDifferenceMethods
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
cd C:\local\QuantLib-SWIG-${{ needs.detect-version.outputs.version }}\CSharp\examples\Times
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
dotnet-other-check:
strategy:
fail-fast: false
matrix:
os: ['macos-15-intel', 'macos-15', 'ubuntu-22.04']
dotnet: ['net8.0', 'net9.0', 'net10.0']
runs-on: ${{ matrix.os }}
needs: [dotnet-nupkg, detect-version]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Setup examples
run: |
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
cp .ci/nupkg/Example.csproj QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/examples/BermudanSwaption/BermudanSwaption.csproj
cp .ci/nupkg/Example.csproj QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/examples/EquityOption/EquityOption.csproj
cp .ci/nupkg/Example.csproj QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/examples/FiniteDifferenceMethods/FiniteDifferenceMethods.csproj
cp .ci/nupkg/Example.csproj QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/examples/Times/Times.csproj
- uses: actions/download-artifact@v8
with:
name: nupkg-all
path: QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/nupkg
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Run C# examples
env:
QL_VERSION: ${{ needs.detect-version.outputs.version }}
run: |
cd QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/CSharp/examples/BermudanSwaption
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
cd ../EquityOption
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
cd ../FiniteDifferenceMethods
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
cd ../Times
dotnet build -c Release --framework ${{ matrix.dotnet }}
dotnet run -c Release --framework ${{ matrix.dotnet }}
dotnet-test-publish:
runs-on: windows-2022
needs: [dotnet-win-check, dotnet-other-check]
environment: testnuget
permissions:
id-token: write
steps:
- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: lballabio
token-service-url: https://int.nugettest.org/api/v2/token
audience: https://int.nugettest.org
- uses: actions/download-artifact@v8
with:
name: nupkg-all
path: C:\local\nupkg
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Publish the package to nugettest.org
run: |
dotnet nuget push C:\local\nupkg\*.nupkg --source https://int.nugettest.org/api/v2/package --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --skip-duplicate
dotnet-publish:
runs-on: windows-2022
needs: [dotnet-test-publish]
environment: nuget
permissions:
id-token: write
steps:
- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: lballabio
- uses: actions/download-artifact@v8
with:
name: nupkg-all
path: C:\local\nupkg
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Publish the package to nuget.org
run: |
dotnet nuget push C:\local\nupkg\*.nupkg --source https://www.nuget.org/api/v2/package --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --skip-duplicate
QuantLib-SWIG-1.42.1/.github/workflows/prepare-patch-release.yml 0000664 0000000 0000000 00000003477 15170240131 0024363 0 ustar 00root root 0000000 0000000 name: Prepare patch release
on:
workflow_dispatch:
jobs:
update-for-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo LATEST_TAG=v${LATEST_RELEASE} | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "LAST_MINOR=" $2 }' | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_PATCH=" $3 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${LAST_MINOR}.${NEXT_PATCH}],/g" configure.ac
sed -i -e "s/^ version=.*$/ version=\"1.${LAST_MINOR}.${NEXT_PATCH}\",/g" Python/setup.py
git commit -a -m "Set version to 1.${LAST_MINOR}.${NEXT_PATCH}"
- name: Update ChangeLog
run: |
git log --pretty=medium --date=rfc --stat --grep='Merge [^p]' --grep='[Mm]erged' --grep='[Pp]ull from' --invert-grep ${LATEST_TAG}... > ChangeLog.txt
git commit -a -m "Update changelog"
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-version-for-release-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.LAST_MINOR }}.${{ env.NEXT_PATCH }} final'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/prepare-release-candidate.yml 0000664 0000000 0000000 00000003603 15170240131 0025167 0 ustar 00root root 0000000 0000000 name: Prepare release candidate
on:
workflow_dispatch:
jobs:
update-for-rc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo LATEST_TAG=v${LATEST_RELEASE} | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_MINOR=" $2 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${NEXT_MINOR}-rc],/g" configure.ac
sed -i -e "s/^ version=.*$/ version=\"1.${NEXT_MINOR}-rc\",/g" Python/setup.py
sed -i -e "s/^#if QL_HEX_VERSION < .*$/#if QL_HEX_VERSION < 0x01${NEXT_MINOR}0000/g" SWIG/ql.i
sed -i -e "s/^ #error at least QuantLib.*$/ #error at least QuantLib 1.${NEXT_MINOR} required, please update/g" SWIG/ql.i
git commit -a -m "Set version to 1.${NEXT_MINOR}-rc"
- name: Update ChangeLog
run: |
git log --pretty=medium --date=rfc --stat --grep='Merge [^p]' --grep='[Mm]erged' --grep='[Pp]ull from' --invert-grep ${LATEST_TAG}.. > ChangeLog.txt
git commit -a -m "Update changelog"
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: set-to-rc-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.NEXT_MINOR }}-rc'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/prepare-release.yml 0000664 0000000 0000000 00000003232 15170240131 0023253 0 ustar 00root root 0000000 0000000 name: Prepare release
on:
workflow_dispatch:
jobs:
update-for-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo LATEST_TAG=v${LATEST_RELEASE} | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_MINOR=" $2 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${NEXT_MINOR}],/g" configure.ac
sed -i -e "s/^ version=.*$/ version=\"1.${NEXT_MINOR}\",/g" Python/setup.py
git commit -a -m "Set version to 1.${NEXT_MINOR}"
- name: Update ChangeLog
run: |
git log --pretty=medium --date=rfc --stat --grep='Merge [^p]' --grep='[Mm]erged' --grep='[Pp]ull from' --invert-grep ${LATEST_TAG}.. > ChangeLog.txt
git commit -a -m "Update changelog"
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-version-for-release-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.NEXT_MINOR }} final'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.42.1/.github/workflows/publish-release.yml 0000664 0000000 0000000 00000004377 15170240131 0023276 0 ustar 00root root 0000000 0000000 name: Draft new release
on:
push:
tags:
- 'v1.[0-9]+'
- 'v1.[0-9]+.[0-9]+'
permissions:
contents: write
packages: write
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup
env:
SWIG_VERSION: 4.4.1
run: |
sudo apt update
sudo apt install -y libpcre2-dev libboost-dev tofrodos
wget http://downloads.sourceforge.net/project/swig/swig/swig-${SWIG_VERSION}/swig-${SWIG_VERSION}.tar.gz \
&& tar xfz swig-${SWIG_VERSION}.tar.gz \
&& rm swig-${SWIG_VERSION}.tar.gz \
&& cd swig-${SWIG_VERSION} \
&& ./configure --prefix=/usr CXXFLAGS=-O3 \
&& make -j 4 && sudo make install \
&& cd .. && rm -rf swig-${SWIG_VERSION}
- name: Configure
run: |
./autogen.sh
./configure
- name: Make tarballs
run: |
mkdir tarballs
make dist
mv QuantLib-*.tar.gz tarballs
cd tarballs && ../tools/tgz2zip *.tar.gz && ls -lh
- name: Extract version
run: |
echo ${{ github.ref_name }} | awk -F '[v-]' '{ print "VERSION_NUMBER=" $2 }' | tee -a $GITHUB_ENV
- name: Prepare release notes
run: |
echo "Downloads:" >> tarballs/notes.txt
echo "==========" >> tarballs/notes.txt
echo "" >> tarballs/notes.txt
echo "- [QuantLib-SWIG-${VERSION_NUMBER}.tar.gz](https://github.com/lballabio/QuantLib-SWIG/releases/download/v${VERSION_NUMBER}/QuantLib-SWIG-${VERSION_NUMBER}.tar.gz)" >> tarballs/notes.txt
echo "- [QuantLib-SWIG-${VERSION_NUMBER}.zip](https://github.com/lballabio/QuantLib-SWIG/releases/download/v${VERSION_NUMBER}/QuantLib-SWIG-${VERSION_NUMBER}.zip)" >> tarballs/notes.txt
echo "" >> tarballs/notes.txt
awk '/Full list of pull requests/{ exit } { print }' News.md >> tarballs/notes.txt
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} \
--title "${VERSION_NUMBER}" \
--draft \
--notes-file tarballs/notes.txt \
--generate-notes \
tarballs/*.tar.gz tarballs/*.zip
QuantLib-SWIG-1.42.1/.github/workflows/stale.yml 0000664 0000000 0000000 00000002224 15170240131 0021307 0 ustar 00root root 0000000 0000000 name: Close stale issues and PR
on:
schedule:
- cron: '30 1 * * *'
jobs:
staleness-check:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.'
close-issue-message: 'This issue was automatically closed because it has been stalled for two weeks with no further activity.'
stale-pr-message: 'This PR was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.'
close-pr-message: 'This PR was automatically closed because it has been stalled for two weeks with no further activity.'
days-before-stale: 60
days-before-close: 14
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-issue-labels: 'help wanted,in progress'
exempt-pr-labels: 'help wanted,in progress'
exempt-all-milestones: true
QuantLib-SWIG-1.42.1/.github/workflows/sync-org-repo.yml 0000664 0000000 0000000 00000001463 15170240131 0022707 0 ustar 00root root 0000000 0000000 name: Sync quantlib organization repository
on:
release:
types: [published]
permissions:
contents: write
jobs:
sync-org-repo:
runs-on: ubuntu-latest
if: ${{ github.event.release.prerelease == false }}
steps:
- uses: actions/checkout@v6
with:
repository: quantlib/QuantLib-SWIG
token: ${{ secrets.ORG_PUSH_PAT }}
ref: master
path: quantlib
- name: Setup second remote
run: |
cd quantlib
git remote add src https://github.com/lballabio/QuantLib-SWIG.git
git fetch src
- name: Push new commits
env:
GITHUB_TOKEN: ${{ secrets.ORG_PUSH_PAT }}
run: |
cd quantlib
git push origin ${{ github.ref_name }}
git merge --ff-only ${{ github.ref_name }}
git push origin master
QuantLib-SWIG-1.42.1/.github/workflows/update-binder-branch.yml 0000664 0000000 0000000 00000000732 15170240131 0024157 0 ustar 00root root 0000000 0000000 name: Update the branch published on mybinder.org
on:
release:
types: [published]
permissions:
contents: write
jobs:
update-binder-branch:
runs-on: ubuntu-latest
if: ${{ github.event.release.prerelease == false }}
steps:
- uses: actions/checkout@v6
with:
ref: binder
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update branch
run: |
git merge --ff-only ${{ github.ref_name }}
git push origin binder
QuantLib-SWIG-1.42.1/.github/workflows/wheels.yml 0000664 0000000 0000000 00000036056 15170240131 0021500 0 ustar 00root root 0000000 0000000 name: Build Python wheels
on:
push:
# build wheels for releases and prereleases
# this workflow assumes that the same branch already exists in the QuantLib repo
tags:
- 'v1.[0-9]+'
- 'v1.[0-9]+.[0-9]+'
- 'v1.[0-9]+-rc'
- 'v1.[0-9]+.[0-9]+-rc'
workflow_dispatch:
# manual runs to try out changes in the workflow
inputs:
ref:
description: 'Tag or branch to use'
required: true
jobs:
# making tarballs sidesteps the problem of installing the desired SWIG version on all systems
make-tarballs:
runs-on: ubuntu-latest
steps:
- name: Determine tag or branch to build
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "REF=${{ github.event.inputs.ref }}" | tee -a $GITHUB_ENV
else
echo "REF=${{ github.ref_name }}" | tee -a $GITHUB_ENV
fi
- name: Setup
env:
SWIG_VERSION: 4.4.1
run: |
sudo apt update
sudo apt install -y libpcre2-dev libboost-dev tofrodos
wget http://downloads.sourceforge.net/project/swig/swig/swig-${SWIG_VERSION}/swig-${SWIG_VERSION}.tar.gz \
&& tar xfz swig-${SWIG_VERSION}.tar.gz \
&& rm swig-${SWIG_VERSION}.tar.gz \
&& cd swig-${SWIG_VERSION} \
&& ./configure --prefix=/usr CXXFLAGS=-O3 \
&& make -j 4 && sudo make install \
&& cd .. && rm -rf swig-${SWIG_VERSION}
- uses: actions/checkout@v6
with:
repository: lballabio/QuantLib
ref: ${{ env.REF }}
path: quantlib
fetch-depth: 0
fetch-tags: true
- name: Make tarballs for QuantLib
run: |
cd quantlib
./autogen.sh
./configure
make dist
mkdir ../tarballs
mv QuantLib-*.tar.gz ../tarballs
cd ../tarballs && ../quantlib/tools/tgz2zip QuantLib-*.tar.gz && ls -lh
- uses: actions/checkout@v6
with:
repository: lballabio/QuantLib-SWIG
ref: ${{ env.REF }}
path: quantlib-swig
fetch-depth: 0
fetch-tags: true
- name: Make tarballs for QuantLib-SWIG
run: |
cd quantlib-swig
./autogen.sh
./configure
make dist
mv QuantLib-SWIG-*.tar.gz ../tarballs
cd ../tarballs && ../quantlib-swig/tools/tgz2zip QuantLib-SWIG-*.tar.gz && ls -lh
- uses: actions/upload-artifact@v7
with:
name: tarballs
path: ./tarballs/*
detect-version:
runs-on: ubuntu-latest
needs: make-tarballs
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- id: version
run: |
echo "version=`ls QuantLib-1*.tar.gz | sed 's/QuantLib-//' | sed 's/\.tar\.gz//'`" | tee -a "$GITHUB_OUTPUT"
wheels-macos:
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-14]
runs-on: ${{ matrix.os }}
needs: detect-version
steps:
- uses: actions/checkout@v6
- name: Setup
run: |
brew install boost
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
tar xfz QuantLib-${{ needs.detect-version.outputs.version }}.tar.gz
cd QuantLib-${{ needs.detect-version.outputs.version }}/
./configure --disable-shared --with-boost-include=`brew --prefix`/include --enable-unity-build --disable-test-suite --enable-skip-examples
make -j3 CXXFLAGS="-std=c++17 -g0 -O3 -fno-common -dynamic -DNDEBUG -fwrapv" LDFLAGS="-fno-common -dynamic -DNDEBUG -fwrapv"
sudo make install
- name: Unpack QuantLib-SWIG
run: |
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
- name: Build QuantLib wheels
uses: pypa/cibuildwheel@v3.4
env:
CIBW_SKIP: cp3??t-*
CIBW_ENABLE: pypy
CXXFLAGS: -std=c++17 -g0 -O3
MACOSX_DEPLOYMENT_TARGET: 10.13
CIBW_BUILD_VERBOSITY: 2
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/test
with:
package-dir: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/Python
- name: Save wheels as artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
wheels-macos-nogil:
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-14]
runs-on: ${{ matrix.os }}
needs: detect-version
steps:
- uses: actions/checkout@v6
- name: Setup
run: |
brew install boost
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
tar xfz QuantLib-${{ needs.detect-version.outputs.version }}.tar.gz
cd QuantLib-${{ needs.detect-version.outputs.version }}/
./configure --disable-shared --with-boost-include=`brew --prefix`/include --enable-unity-build --enable-thread-safe-observer-pattern --disable-test-suite --enable-skip-examples
make -j3 CXXFLAGS="-std=c++17 -g0 -O3 -fno-common -dynamic -DNDEBUG -fwrapv" LDFLAGS="-fno-common -dynamic -DNDEBUG -fwrapv"
sudo make install
- name: Unpack QuantLib-SWIG
run: |
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
- name: Build QuantLib wheels
uses: pypa/cibuildwheel@v3.4
env:
CIBW_BUILD: cp3??t-*
CXXFLAGS: -std=c++17 -g0 -O3
MACOSX_DEPLOYMENT_TARGET: 10.13
CIBW_BUILD_VERBOSITY: 2
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/test
with:
package-dir: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/Python
- name: Save wheels as artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-nogil-${{ matrix.os }}
path: ./wheelhouse/*.whl
wheels-windows:
runs-on: windows-2022
needs: detect-version
strategy:
fail-fast: false
matrix:
include:
- arch: AMD64
platform: x64
- arch: x86
platform: Win32
steps:
- uses: actions/checkout@v6
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v3
- name: Setup Boost
run: |
$Url = "https://archives.boost.io/release/1.90.0/source/boost_1_90_0.zip"
(New-Object System.Net.WebClient).DownloadFile($Url, "$RUNNER_TEMP\boost.zip")
Expand-Archive -Path "$RUNNER_TEMP\boost.zip" -DestinationPath C:\local
Rename-Item -Path "C:\local\boost_1_90_0" -NewName "boost"
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
Expand-Archive -Path QuantLib-${{ needs.detect-version.outputs.version }}.zip -DestinationPath C:\local
Copy-Item .ci\Build.props C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
Copy-Item .ci\Directory.Build.props C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
cd C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
msbuild QuantLib.vcxproj -p:Configuration="Release (static runtime)" -p:Platform=${{ matrix.platform }}
dir lib
- name: Unpack QuantLib-SWIG
run: |
Expand-Archive -Path QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.zip -DestinationPath .
- name: Build QuantLib wheels
uses: pypa/cibuildwheel@v3.4
env:
QL_DIR: C:\local\QuantLib-${{ needs.detect-version.outputs.version }}
INCLUDE: C:\local\boost
QL_STATIC_RUNTIME: 1
CIBW_SKIP: cp3??t-*
CIBW_ENABLE: pypy
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/test
with:
package-dir: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/Python
- name: Save wheels as artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-windows-${{ matrix.arch }}
path: ./wheelhouse/*.whl
wheels-windows-nogil:
runs-on: windows-2022
needs: detect-version
strategy:
fail-fast: false
matrix:
include:
- arch: AMD64
platform: x64
- arch: x86
platform: Win32
steps:
- uses: actions/checkout@v6
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v3
- name: Setup Boost
run: |
$Url = "https://archives.boost.io/release/1.90.0/source/boost_1_90_0.zip"
(New-Object System.Net.WebClient).DownloadFile($Url, "$RUNNER_TEMP\boost.zip")
Expand-Archive -Path "$RUNNER_TEMP\boost.zip" -DestinationPath C:\local
Rename-Item -Path "C:\local\boost_1_90_0" -NewName "boost"
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Build QuantLib
run: |
Expand-Archive -Path QuantLib-${{ needs.detect-version.outputs.version }}.zip -DestinationPath C:\local
Copy-Item .ci\Build.props C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
Copy-Item .ci\Directory.Build.props C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
Copy-Item .ci\wheels\userconfig_nogil.hpp C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\ql\userconfig.hpp
cd C:\local\QuantLib-${{ needs.detect-version.outputs.version }}\
msbuild QuantLib.vcxproj -p:Configuration="Release (static runtime)" -p:Platform=${{ matrix.platform }}
dir lib
- name: Unpack QuantLib-SWIG
run: |
Expand-Archive -Path QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.zip -DestinationPath .
- name: Build QuantLib wheels
uses: pypa/cibuildwheel@v3.4
env:
QL_DIR: C:\local\QuantLib-${{ needs.detect-version.outputs.version }}
INCLUDE: C:\local\boost
QL_STATIC_RUNTIME: 1
CIBW_BUILD: cp3??t-*
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/test
with:
package-dir: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/Python
- name: Save wheels as artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-nogil-windows-${{ matrix.arch }}
path: ./wheelhouse/*.whl
wheels-linux:
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
image: manylinux
os: ubuntu-24.04
- arch: x86_64
image: musllinux
os: ubuntu-24.04
- arch: i686
image: manylinux
os: ubuntu-24.04
- arch: i686
image: musllinux
os: ubuntu-24.04
- arch: aarch64
image: manylinux
os: ubuntu-24.04-arm
- arch: aarch64
image: musllinux
os: ubuntu-24.04-arm
runs-on: ${{ matrix.os }}
needs: detect-version
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Unpack QuantLib and QuantLib-SWIG
run: |
tar xfz QuantLib-${{ needs.detect-version.outputs.version }}.tar.gz
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
- name: Build QuantLib wheels
uses: pypa/cibuildwheel@v3.4
env:
CIBW_BUILD: "*-${{ matrix.image }}*"
CIBW_SKIP: cp3??t-*
CIBW_ENABLE: pypy
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_BEFORE_ALL_LINUX: .ci/wheels/before_all_linux.sh
CIBW_ENVIRONMENT_LINUX: CXXFLAGS=${{ matrix.arch == 'i686' && '"-O0 -g0"' || '"-O3 -g0"' }} CXXQLFLAGS="-O3 -g0"
CIBW_ENVIRONMENT_PASS_LINUX: CXXFLAGS CXXQLFLAGS
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/test
with:
package-dir: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/Python
- name: Save wheels as artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-linux-${{ matrix.image }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
wheels-linux-nogil:
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
image: manylinux
os: ubuntu-24.04
- arch: x86_64
image: musllinux
os: ubuntu-24.04
- arch: i686
image: manylinux
os: ubuntu-24.04
- arch: i686
image: musllinux
os: ubuntu-24.04
- arch: aarch64
image: manylinux
os: ubuntu-24.04-arm
- arch: aarch64
image: musllinux
os: ubuntu-24.04-arm
runs-on: ${{ matrix.os }}
needs: detect-version
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tarballs
path: .
- name: Unpack QuantLib and QuantLib-SWIG
run: |
tar xfz QuantLib-${{ needs.detect-version.outputs.version }}.tar.gz
tar xfz QuantLib-SWIG-${{ needs.detect-version.outputs.version }}.tar.gz
- name: Build QuantLib wheels
uses: pypa/cibuildwheel@v3.4
env:
CIBW_BUILD: "cp3??t-${{ matrix.image }}*"
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_BEFORE_ALL_LINUX: .ci/wheels/before_all_linux_nogil.sh
CIBW_ENVIRONMENT_LINUX: CXXFLAGS=${{ matrix.arch == 'i686' && '"-O0 -g0"' || '"-O3 -g0"' }} CXXQLFLAGS="-O3 -g0"
CIBW_ENVIRONMENT_PASS_LINUX: CXXFLAGS CXXQLFLAGS
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/test
with:
package-dir: ./QuantLib-SWIG-${{ needs.detect-version.outputs.version }}/Python
- name: Save wheels as artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-nogil-linux-${{ matrix.image }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
test-publish:
runs-on: ubuntu-latest
needs: [ wheels-macos, wheels-macos-nogil, wheels-windows, wheels-windows-nogil, wheels-linux, wheels-linux-nogil ]
environment: testpypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
- name: Collect wheels
run: |
mkdir ./wheelhouse
cp ./wheels-*/*.whl ./wheelhouse
ls -l ./wheelhouse
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: ./wheelhouse
skip-existing: true
publish:
runs-on: ubuntu-latest
needs: test-publish
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
- name: Collect wheels
run: |
mkdir ./wheelhouse
cp ./wheels-*/*.whl ./wheelhouse
ls -l ./wheelhouse
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./wheelhouse
skip-existing: true
QuantLib-SWIG-1.42.1/.gitignore 0000664 0000000 0000000 00000001011 15170240131 0016040 0 ustar 00root root 0000000 0000000 # Compilation artifacts
configure
aclocal.m4
autom4te.cache
config.log
config.status
config/
# Build outputs
**/x64/Debug
**/x64/Release
**/Debug
**/Release
**/bin/*.xml
**/bin/*.manifest
# IDEs
.idea
.vscode
cmake-build-debug
# Artifacts created in multiple directories
Makefile
Makefile.in
.build-stamp
testCaseCollection.xml
.deps
.libs
*.la
*.lo
*.o
*.so
*.dylib
*.exe
*.dll
*.exp
*.lib
*.pdb
*.ilk
*.class
*~
*.ncb
*.suo
*.vcproj.*.user
*.vcxproj.user
*.VC.db
*.VC.opendb
*.log
*.sdf
*.opensdf
*.pch
*.idb
*.ipch
QuantLib-SWIG-1.42.1/.misspell-fixer.ignore 0000664 0000000 0000000 00000000022 15170240131 0020277 0 ustar 00root root 0000000 0000000 ^./ChangeLog.txt
QuantLib-SWIG-1.42.1/CSharp/ 0000775 0000000 0000000 00000000000 15170240131 0015237 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/CSharp/.gitignore 0000664 0000000 0000000 00000000174 15170240131 0017231 0 ustar 00root root 0000000 0000000 cpp/quantlib_wrap.cpp
cpp/quantlib_wrap.h
csharp/*.cs
NQuantLib.dll
cpp/build
csharp/obj
examples/*/bin
examples/*/obj
.vs/
QuantLib-SWIG-1.42.1/CSharp/Makefile.am 0000664 0000000 0000000 00000006201 15170240131 0017272 0 ustar 00root root 0000000 0000000
CLEANFILES = cpp/quantlib_wrap.* cpp/*.so cpp/*.dylib csharp/*.cs *.dll
BUILT_SOURCES = cpp/quantlib_wrap.cpp cpp/quantlib_wrap.h
if HAVE_DOTNET
if BUILD_DOTNET
all-local: cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ csharp/bin/Release/net9.0/NQuantLib.dll
cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@: cpp/quantlib_wrap.o
$(CXX) -shared cpp/quantlib_wrap.o -o cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ `quantlib-config --libs`
cpp/quantlib_wrap.o: $(BUILT_SOURCES)
$(CXX) -c -fpic $(CXXFLAGS) cpp/quantlib_wrap.cpp -o cpp/quantlib_wrap.o `quantlib-config --cflags`
csharp/bin/Release/net9.0/NQuantLib.dll: $(BUILT_SOURCES)
$(DOTNET) build --nologo -c Release --framework net9.0 -p:Version=$(PACKAGE_VERSION) csharp/NQuantLib.csproj
nupkg: cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ csharp/bin/Release/net9.0/NQuantLib.dll
$(DOTNET) pack --no-build -c Release --framework net9.0 -p:PackageVersion=$(PACKAGE_VERSION) --include-symbols --include-source csharp/NQuantLib.csproj
check-local: cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ csharp/bin/Release/net9.0/NQuantLib.dll
ln -f cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ examples/
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --framework net9.0 --project BermudanSwaption/BermudanSwaption.csproj
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --framework net9.0 --project EquityOption/EquityOption.csproj
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --framework net9.0 --project FiniteDifferenceMethods/FiniteDifferenceMethods.csproj
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --framework net9.0 --project Times/Times.csproj
rm -f examples/libNQuantLibc.@SHARED_LIB_EXTENSION@
clean-local:
rm -rf csharp/bin csharp/obj examples/*/bin examples/*/obj
endif
endif
$(BUILT_SOURCES): ../SWIG/*.i
rm -f csharp/*.cs
$(SWIG) $(SWIGFLAGS) -csharp -c++ -outdir csharp \
-namespace QuantLib -o cpp/quantlib_wrap.cpp ../SWIG/quantlib.i
dist-hook: $(BUILT_SOURCES)
mkdir -p $(distdir)/cpp
cp ./cpp/*.vcxproj $(distdir)/cpp
cp ./cpp/quantlib_wrap.cpp $(distdir)/cpp
cp ./cpp/quantlib_wrap.h $(distdir)/cpp
mkdir -p $(distdir)/csharp
cp ./csharp/*.csproj $(distdir)/csharp
cp ./csharp/*.cs $(distdir)/csharp
mkdir -p $(distdir)/examples
mkdir -p $(distdir)/examples/BermudanSwaption
cp ./examples/BermudanSwaption/BermudanSwaption.csproj $(distdir)/examples/BermudanSwaption
cp ./examples/BermudanSwaption/BermudanSwaption.cs $(distdir)/examples/BermudanSwaption
mkdir -p $(distdir)/examples/EquityOption
cp ./examples/EquityOption/EquityOption.csproj $(distdir)/examples/EquityOption
cp ./examples/EquityOption/EquityOption.cs $(distdir)/examples/EquityOption
mkdir -p $(distdir)/examples/FiniteDifferenceMethods
cp ./examples/FiniteDifferenceMethods/FiniteDifferenceMethods.csproj $(distdir)/examples/FiniteDifferenceMethods
cp ./examples/FiniteDifferenceMethods/FiniteDifferenceMethods.cs $(distdir)/examples/FiniteDifferenceMethods
mkdir -p $(distdir)/examples/Times
cp ./examples/Times/Times.csproj $(distdir)/examples/Times
cp ./examples/Times/Times.cs $(distdir)/examples/Times
EXTRA_DIST = \
QuantLib.sln \
QuantLib.props \
swig.cmd \
README.txt
QuantLib-SWIG-1.42.1/CSharp/QuantLib.props 0000664 0000000 0000000 00000001653 15170240131 0020050 0 ustar 00root root 0000000 0000000
v100
v110
v120
v130
v140
v141
v142
v143
QuantLib-SWIG-1.42.1/CSharp/QuantLib.sln 0000664 0000000 0000000 00000013746 15170240131 0017507 0 ustar 00root root 0000000 0000000 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BermudanSwaption", "examples\BermudanSwaption\BermudanSwaption.csproj", "{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EquityOption", "examples\EquityOption\EquityOption.csproj", "{1FD947F1-D99E-46FB-8890-04E11E8340C2}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FiniteDifferenceMethods", "examples\FiniteDifferenceMethods\FiniteDifferenceMethods.csproj", "{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NQuantLib", "csharp\NQuantLib.csproj", "{928F98EE-7D50-457F-9304-A6818DCF1079}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NQuantLibc", "cpp\QuantLibWrapper.vcxproj", "{21183104-9963-4D4F-B7E8-C8A6169FD053}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Times", "examples\Times\Times.csproj", "{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|Win32.Build.0 = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|x64.ActiveCfg = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|x64.Build.0 = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|Win32.ActiveCfg = Release|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|Win32.Build.0 = Release|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|x64.ActiveCfg = Release|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|x64.Build.0 = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|Win32.Build.0 = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|x64.ActiveCfg = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|x64.Build.0 = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|Win32.ActiveCfg = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|Win32.Build.0 = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|x64.ActiveCfg = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|x64.Build.0 = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|Win32.Build.0 = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|x64.Build.0 = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|Win32.ActiveCfg = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|Win32.Build.0 = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|x64.ActiveCfg = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|x64.Build.0 = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|Win32.ActiveCfg = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|Win32.Build.0 = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|x64.ActiveCfg = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|x64.Build.0 = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|Win32.ActiveCfg = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|Win32.Build.0 = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|x64.ActiveCfg = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|x64.Build.0 = Release|Any CPU
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|Win32.ActiveCfg = Debug|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|Win32.Build.0 = Debug|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|x64.ActiveCfg = Debug|x64
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|x64.Build.0 = Debug|x64
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|Win32.ActiveCfg = Release|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|Win32.Build.0 = Release|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|x64.ActiveCfg = Release|x64
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|x64.Build.0 = Release|x64
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|Win32.Build.0 = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|x64.ActiveCfg = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|x64.Build.0 = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|Win32.ActiveCfg = Release|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|Win32.Build.0 = Release|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|x64.ActiveCfg = Release|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D5A8DD18-AC31-4E40-A70A-11339ED8FAE8}
EndGlobalSection
EndGlobal
QuantLib-SWIG-1.42.1/CSharp/README.txt 0000664 0000000 0000000 00000000606 15170240131 0016737 0 ustar 00root root 0000000 0000000
Visual Studio .NET projects are provided; note that before launching
the IDE, you'll have to define an environment variable QL_DIR whose
value must equal the path to your QuantLib installation, e.g.,
"C:\Lib\QuantLib".
The interfaces also work with .Net on Linux and macOS; run 'make' in
this directory after running './autogen.sh' and './configure' in the
main QuantLib-SWIG directory.
QuantLib-SWIG-1.42.1/CSharp/cpp/ 0000775 0000000 0000000 00000000000 15170240131 0016021 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/CSharp/cpp/QuantLibWrapper.vcxproj 0000664 0000000 0000000 00000026604 15170240131 0022526 0 ustar 00root root 0000000 0000000
Debug
Win32
Debug
x64
Release
Win32
Release
x64
NQuantLibc
{21183104-9963-4D4F-B7E8-C8A6169FD053}
NQuantLibc
Win32Proj
DynamicLibrary
MultiByte
DynamicLibrary
MultiByte
DynamicLibrary
MultiByte
DynamicLibrary
MultiByte
<_ProjectFileVersion>10.0.30319.1
bin\$(Platform)\Debug\
build\$(Platform)\Debug\
true
bin\$(Platform)\Release\
build\$(Platform)\Release\
false
AllRules.ruleset
AllRules.ruleset
Disabled
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;_cplusplus;NOMINMAX;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebugDLL
true
Level3
EditAndContinue
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
$(OutDir)QuantlibWrapper.pdb
Windows
false
$(OutDir)NQuantLibc.lib
MachineX86
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
Disabled
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;_cplusplus;NOMINMAX;%(PreprocessorDefinitions)
EnableFastChecks
MultiThreadedDebugDLL
true
Level3
ProgramDatabase
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
$(OutDir)QuantlibWrapper.pdb
Windows
false
$(OutDir)NQuantLibc.lib
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;%(PreprocessorDefinitions)
MultiThreadedDLL
true
true
Level3
ProgramDatabase
4244;%(DisableSpecificWarnings)
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
Windows
true
true
false
$(OutDir)NQuantLibc.lib
MachineX86
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;%(PreprocessorDefinitions)
MultiThreadedDLL
true
true
Level3
ProgramDatabase
4244;%(DisableSpecificWarnings)
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
Windows
true
true
false
$(OutDir)NQuantLibc.lib
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
QuantLib-SWIG-1.42.1/CSharp/cpp/QuantLibWrapper.vcxproj.filters 0000664 0000000 0000000 00000002041 15170240131 0024162 0 ustar 00root root 0000000 0000000
{4FC737F1-C7A5-4376-A066-2A32D752A2FF}
cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
{93995380-89BD-4b04-88EB-625FBE52EBFB}
h;hpp;hxx;hm;inl;inc;xsd
{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
Source Files
Header Files
QuantLib-SWIG-1.42.1/CSharp/csharp/ 0000775 0000000 0000000 00000000000 15170240131 0016517 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/CSharp/csharp/NQuantLib.csproj 0000664 0000000 0000000 00000002121 15170240131 0021572 0 ustar 00root root 0000000 0000000
net8.0;net9.0
QuantLib
runtimes/win-x64/native
runtimes/linux-x64/native
runtimes/osx-x64/native
QuantLib-SWIG-1.42.1/CSharp/examples/ 0000775 0000000 0000000 00000000000 15170240131 0017055 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/CSharp/examples/BermudanSwaption/ 0000775 0000000 0000000 00000000000 15170240131 0022337 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.42.1/CSharp/examples/BermudanSwaption/BermudanSwaption.cs 0000664 0000000 0000000 00000027525 15170240131 0026163 0 ustar 00root root 0000000 0000000 /*
Copyright (C) 2005 Dominic Thuillier
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
. The license is also available online at
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
using System;
using QuantLib;
namespace BermudanSwaption
{
class Run
{
private const int numRows = 5;
private const int numCols = 5;
private static int[] swapLengths = { 1, 2, 3, 4, 5 };
private static double[] swaptionVols = {
0.1490, 0.1340, 0.1228, 0.1189, 0.1148,
0.1290, 0.1201, 0.1146, 0.1108, 0.1040,
0.1149, 0.1112, 0.1070, 0.1010, 0.0957,
0.1047, 0.1021, 0.0980, 0.0951, 0.1270,
0.1000, 0.0950, 0.0900, 0.1230, 0.1160 };
private static void calibrateModel(
ShortRateModel model,
CalibrationHelperVector helpers,
double lambda )
{
Simplex om = new Simplex( lambda );
model.calibrate(helpers, om,
new EndCriteria(1000, 250, 1e-7, 1e-7, 1e-7));
// Output the implied Black volatilities
for (int i=0; i
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
DateTime startTime = DateTime.Now;
Date todaysDate = new Date(15, Month.February, 2002);
Calendar calendar = new TARGET();
Date settlementDate = new Date(19, Month.February, 2002);
Settings.instance().setEvaluationDate( todaysDate );
// flat yield term structure impling 1x5 swap at 5%
Quote flatRate = new SimpleQuote(0.04875825);
FlatForward myTermStructure = new FlatForward(
settlementDate,
new QuoteHandle( flatRate ),
new Actual365Fixed() );
RelinkableYieldTermStructureHandle rhTermStructure =
new RelinkableYieldTermStructureHandle();
rhTermStructure.linkTo( myTermStructure );
// Define the ATM/OTM/ITM swaps
Period fixedLegTenor = new Period(1,TimeUnit.Years);
BusinessDayConvention fixedLegConvention =
BusinessDayConvention.Unadjusted;
BusinessDayConvention floatingLegConvention =
BusinessDayConvention.ModifiedFollowing;
DayCounter fixedLegDayCounter =
new Thirty360( Thirty360.Convention.European );
Period floatingLegTenor = new Period(6,TimeUnit.Months);
double dummyFixedRate = 0.03;
IborIndex indexSixMonths = new Euribor6M( rhTermStructure );
Date startDate = calendar.advance(settlementDate,1,TimeUnit.Years,
floatingLegConvention);
Date maturity = calendar.advance(startDate,5,TimeUnit.Years,
floatingLegConvention);
Schedule fixedSchedule = new Schedule(startDate,maturity,
fixedLegTenor,calendar,fixedLegConvention,fixedLegConvention,
DateGeneration.Rule.Forward,false);
Schedule floatSchedule = new Schedule(startDate,maturity,
floatingLegTenor,calendar,floatingLegConvention,
floatingLegConvention,DateGeneration.Rule.Forward,false);
VanillaSwap swap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, dummyFixedRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter());
DiscountingSwapEngine swapEngine =
new DiscountingSwapEngine(rhTermStructure);
swap.setPricingEngine(swapEngine);
double fixedATMRate = swap.fairRate();
double fixedOTMRate = fixedATMRate * 1.2;
double fixedITMRate = fixedATMRate * 0.8;
VanillaSwap atmSwap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, fixedATMRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter() );
VanillaSwap otmSwap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, fixedOTMRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter());
VanillaSwap itmSwap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, fixedITMRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter());
atmSwap.setPricingEngine(swapEngine);
otmSwap.setPricingEngine(swapEngine);
itmSwap.setPricingEngine(swapEngine);
// defining the swaptions to be used in model calibration
PeriodVector swaptionMaturities = new PeriodVector();
swaptionMaturities.Add( new Period(1, TimeUnit.Years) );
swaptionMaturities.Add( new Period(2, TimeUnit.Years) );
swaptionMaturities.Add( new Period(3, TimeUnit.Years) );
swaptionMaturities.Add( new Period(4, TimeUnit.Years) );
swaptionMaturities.Add( new Period(5, TimeUnit.Years) );
CalibrationHelperVector swaptions = new CalibrationHelperVector();
// List of times that have to be included in the timegrid
DoubleVector times = new DoubleVector();
for ( int i=0; iparams()[0] << ", "
// << "sigma = " << modelHW2->params()[1]
// << std::endl << std::endl;
Console.WriteLine( "Black-Karasinski (numerical) calibration" );
for (int i=0; iparams()[0] << ", "
// << "sigma = " << modelBK->params()[1]
// << std::endl << std::endl;
// ATM Bermudan swaption pricing
Console.WriteLine( "Payer bermudan swaption struck at {0} (ATM)",
fixedATMRate );
DateVector bermudanDates = new DateVector();
Schedule schedule = new Schedule(startDate,maturity,
new Period(3,TimeUnit.Months),calendar,
BusinessDayConvention.Following,
BusinessDayConvention.Following,
DateGeneration.Rule.Forward,false);
for (uint i=0; i