Skip to content

Commit 687da4d

Browse files
author
Sjogren
committed
Merge remote-tracking branch 'origin/master' into feature/martin_docs1
2 parents 30d4db5 + 39c2f4d commit 687da4d

11 files changed

Lines changed: 180 additions & 6 deletions

File tree

Docker/Dockerfile-ORE-Dependencies

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,23 @@ RUN apt-get update \
2323
swig \
2424
lld \
2525
python3-dev \
26+
python3-pip \
27+
python3-venv \
28+
curl \
2629
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
2730
&& apt-get clean \
2831
&& rm -rf /var/lib/apt/lists/* \
2932
&& mv /usr/bin/ld /usr/bin/ld.backup \
30-
&& ln -s /usr/bin/lld /usr/bin/ld
33+
&& ln -s /usr/bin/lld /usr/bin/ld
34+
35+
RUN \
36+
curl -sSL https://get.docker.com -o install-docker.sh && \
37+
sh install-docker.sh --version 28
38+
39+
RUN python3 -m venv /venv
40+
ENV PATH="/venv/bin:$PATH"
41+
42+
RUN \
43+
pip3 install cibuildwheel==3.2.1 && \
44+
rm -rf ~/.cache/pip
45+

Docker/Dockerfile-Wheels-Boost

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
ARG WHEEL_IMG
3+
FROM ${WHEEL_IMG}
4+
5+
RUN \
6+
curl -O -L https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.gz && \
7+
tar xfz boost_1_83_0.tar.gz && \
8+
cd boost_1_83_0 && \
9+
./bootstrap.sh --with-libraries=date_time,filesystem,iostreams,log,regex,serialization,system,thread,timer && \
10+
./b2 install
11+

Docker/Dockerfile-Wheels-CIBW

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
FROM ${DOCKER_REPO}ore-build-dependencies:${ORE_BUILD_VERSION}
3+
4+
ARG WHEEL_ARCH
5+
ARG WHEEL_IMAGE
6+
7+
ENV PATH="/venv/bin:$PATH"
8+
9+
ENV CIBW_BUILD="cp310-manylinux_${WHEEL_ARCH} cp312-manylinux_${WHEEL_ARCH}"
10+
ENV CIBW_MANYLINUX_X86_64_IMAGE=${WHEEL_IMAGE}
11+
ENV CIBW_MANYLINUX_AARCH64_IMAGE=${WHEEL_IMAGE}
12+
ENV CIBW_BEFORE_BUILD="chmod +x ORE-SWIG/Wheels-gitlab/before_all_linux.sh && ORE-SWIG/Wheels-gitlab/before_all_linux.sh"
13+
14+
WORKDIR /builds/qs/oreplus/ore
15+
RUN cibuildwheel --output-dir wheelhouse ORE-SWIG
16+
17+
COPY wheelhouse /wheelhouse
18+

Docker/Dockerfile-Wheels-ORE

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
ARG WHEEL_IMG
3+
FROM ${WHEEL_IMG}
4+
5+
ARG CMAKE_BUILD_TYPE=Release
6+
ARG NUM_CORES=16
7+
8+
COPY CMakeLists.txt /ore/CMakeLists.txt
9+
COPY QuantLib /ore/QuantLib
10+
COPY QuantExt /ore/QuantExt
11+
COPY OREData /ore/OREData
12+
COPY OREAnalytics /ore/OREAnalytics
13+
COPY ThirdPartyLibs /ore/ThirdPartyLibs
14+
COPY cmake /ore/cmake
15+
16+
RUN \
17+
dnf -y install clang && \
18+
dnf -y install ccache && \
19+
dnf -y install ninja-build
20+
21+
ENV PATH="/usr/lib/ccache:$PATH"
22+
ENV CCACHE_DIR="/ccache"
23+
ENV CCACHE_MAXSIZE="10G"
24+
25+
WORKDIR /ore
26+
RUN \
27+
mkdir build && \
28+
cd build && \
29+
cmake .. -GNinja -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_FLAGS="-D BOOST_ENABLE_ASSERT_HANDLER $([ "$(uname -m)" = "x86_64" ] && echo "-mavx2")" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_TEST_SUITE=OFF -DQL_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DQL_ENABLE_SESSIONS=ON -DORE_BUILD_APP=OFF -DORE_BUILD_DOC=OFF -DORE_BUILD_EXAMPLES=OFF -DORE_BUILD_SWIG=OFF -DORE_BUILD_TESTS=OFF -DORE_ENABLE_OPENCL=OFF -DORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DORE_PYTHON_INTEGRATION=OFF
30+
31+
WORKDIR /ore/build
32+
RUN --mount=type=cache,target=/ccache/ ccache -z && \
33+
cmake --build . -- -j ${NUM_CORES} install && \
34+
ccache -s
35+

Docs/UserGuide/allowablevalues.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ \subsection{Allowable Values}
258258
\emph{Actual/365 (No Leap), Act/365 (NL), NL/365, Actual/365 (JGB)} & Actual 365 Fixed (No Leap Year)\\ \hline
259259
\emph{Act/365 (Canadian Bond)} & Actual 365 Fixed (Canadian Bond)\\ \hline
260260
\emph{T360, 30/360, ACT/nACT, 30/360 US, 30/360 (US), 30U/360, 30US/360} & Thirty 360 (US) \\ \hline
261+
\emph{30/360 NASD} & Thirty 360 (NASD) \\ \hline
261262
\emph{30/360 (Bond Basis)} & Thirty 360 (Bond Basis) \\ \hline
262263
\emph{30E/360 (Eurobond Basis), 30E/360, 30/360 AIBD (Euro), 30E/360.ICMA, 30E/360 ICMA} & Thirty 360 (European) \\ \hline
263264
\emph{30E/360E, 30E/360 ISDA, 30E/360.ISDA, 30/360 German, 30/360 (German)} & Thirty 360 (German) \\ \hline
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
pip3 install docker setuptools
4+
cd ORE-SWIG
5+
cp Wheels-gitlab/oreanalytics-config .
6+
chmod +x oreanalytics-config
7+
python3 setup.py wrap
8+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/sh
2+
3+
# The dockerfile Dockerfile-Wheels-CIBW launches cibuildwheel like so:
4+
# WORKDIR /builds/qs/oreplus/ore
5+
# cibuildwheel --output-dir wheelhouse ORE-SWIG
6+
# This tells cibuildwheel to start in directory "ore" and run in directory "ORE-SWIG".
7+
# Then cibuildwheel runs docker, and copies its current directory ("ore")
8+
# into the container, into directory "/project":
9+
ORE="/project"
10+
11+
# On your system, the boost_thread lib may have a nonstandard name, e.g. boost_thread-mt.
12+
# If that is the case then set the BOOST_THREAD variable before calling this script, e.g:
13+
# export BOOST_THREAD=boost_thread-mt
14+
BOOST_THREAD="${BOOST_THREAD:=boost_thread}"
15+
16+
usage="\
17+
Usage: oreanalytics-config [--libs] [--cflags]"
18+
19+
if test $# -eq 0; then
20+
echo "${usage}" 1>&2
21+
exit 1
22+
fi
23+
24+
while test $# -gt 0; do
25+
case "$1" in
26+
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
27+
*) optarg= ;;
28+
esac
29+
30+
case $1 in
31+
--cflags)
32+
#echo -I${ORE}/build/QuantLib -I${ORE}/OREAnalytics -I${ORE}/OREData -I${ORE}/QuantExt -I${ORE}/QuantLib -I${BOOST_INC} -std=c++1z -DNDEBUG -Wno-free-nonheap-object -Wno-maybe-uninitialized -Wno-misleading-indentation
33+
# We must not specify any include directories, because we have already installed boost and ORE to system directories:
34+
echo -w
35+
;;
36+
--libs)
37+
#echo -L${ORE}/build/OREAnalytics/orea -lOREAnalytics -L${ORE}/build/OREData/ored -lOREData -L${ORE}/build/QuantExt/qle -lQuantExt -L${ORE}/build/QuantLib/ql -lQuantLib -L${BOOST_LIB} -l${BOOST_THREAD} -lboost_system -lboost_serialization -lboost_date_time -lboost_regex -lboost_filesystem -std=c++1z
38+
# We must not specify any library directories, because we have already installed boost and ORE to system directories:
39+
echo -lOREAnalytics -lOREData -lQuantExt -lQuantLib -l${BOOST_THREAD} -lboost_system -lboost_serialization -lboost_date_time -lboost_regex -lboost_filesystem
40+
;;
41+
*)
42+
echo "${usage}" 1>&2
43+
exit 1
44+
;;
45+
esac
46+
shift
47+
done
48+

OREAnalytics/orea/app/oreapp.cpp

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,11 +1307,48 @@ void OREAppInputParameters::loadParameters() {
13071307
if (tmp != "")
13081308
setMcVarSeed(parseInteger(tmp));
13091309

1310+
tmp = params_->get("parametricVar", "mporDays", false);
1311+
if (tmp != "")
1312+
setMporDays(static_cast<Size>(parseInteger(tmp)));
1313+
1314+
tmp = params_->get("parametricVar", "mporCalendar", false);
1315+
if (tmp != "")
1316+
setMporCalendar(tmp);
1317+
1318+
tmp = params_->get("parametricVar", "mporOverlappingPeriods", false);
1319+
if (tmp != "")
1320+
setMporOverlappingPeriods(parseBool(tmp));
1321+
13101322
tmp = params_->get("parametricVar", "covarianceInputFile", false);
1311-
QL_REQUIRE(tmp != "", "covarianceInputFile not provided");
1312-
std::string covFile = (inputPath_ / tmp).generic_string();
1313-
LOG("Load Covariance Data from file " << covFile);
1314-
setCovarianceDataFromFile(covFile);
1323+
if (tmp != ""){
1324+
std::string covFile = (inputPath_ / tmp).generic_string();
1325+
LOG("Load Covariance Data from file " << covFile);
1326+
setCovarianceDataFromFile(covFile);
1327+
}
1328+
1329+
tmp = params_->get("parametricVar", "historicalPeriod", false);
1330+
if (tmp != "")
1331+
setBenchmarkVarPeriod(tmp);
1332+
1333+
tmp = params_->get("parametricVar", "sensitivityConfigFile", false);
1334+
if (tmp != "") {
1335+
string file = (inputPath_ / tmp).generic_string();
1336+
LOG("Load sensitivity scenario data from file" << file);
1337+
setSensiScenarioDataFromFile(file);
1338+
}
1339+
1340+
tmp = params_->get("parametricVar", "simulationConfigFile", false);
1341+
if (tmp != "") {
1342+
string file = (inputPath_ / tmp).generic_string();
1343+
LOG("Loading sensitivity scenario sim market parameters from file" << file);
1344+
setSensiSimMarketParamsFromFile(file);
1345+
}
1346+
1347+
tmp = params_->get("parametricVar", "scenarioFile", false);
1348+
if (tmp != "") {
1349+
std::string scenarioFile = (inputPath_ / tmp).generic_string();
1350+
setScenarioReader(scenarioFile);
1351+
}
13151352

13161353
tmp = params_->get("parametricVar", "sensitivityInputFile", false);
13171354
QL_REQUIRE(tmp != "", "sensitivityInputFile not provided");

OREData/ored/portfolio/builders/fxforward.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class FxForwardEngineBuilder : public FxForwardEngineBuilderBase {
6363
protected:
6464
QuantLib::ext::shared_ptr<PricingEngine> engineImpl(const Currency& forCcy, const Currency& domCcy,
6565
const std::string& discountCurve) override {
66-
std::cout << "getting curve '" << discountCurve << "'" << std::endl;
6766
string pair = forCcy.code() + domCcy.code();
6867
return QuantLib::ext::make_shared<QuantExt::DiscountingFxForwardEngine>(
6968
domCcy, market_->discountCurve(domCcy.code(), configuration(MarketContext::pricing)), forCcy,

OREData/ored/utilities/parsers.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ DayCounter parseDayCounter(const string& s) {
235235
{"30/360", Thirty360(Thirty360::USA)},
236236
{"30/360 US", Thirty360(Thirty360::USA)},
237237
{"30/360 (US)", Thirty360(Thirty360::USA)},
238+
{"30/360 NASD", Thirty360(Thirty360::NASD)},
238239
{"30U/360", Thirty360(Thirty360::USA)},
239240
{"30US/360", Thirty360(Thirty360::USA)},
240241
{"30/360 (Bond Basis)", Thirty360(Thirty360::BondBasis)},

0 commit comments

Comments
 (0)