Skip to content

Commit f40b4e5

Browse files
Merge branch 'QPR-12115' into 'master'
Resolve QPR-12115 Closes QPR-12115 See merge request qs/oreswig!45
2 parents 0f50b25 + e32bad9 commit f40b4e5

12 files changed

Lines changed: 62 additions & 199 deletions

File tree

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_1/Untitled.ipynb

Lines changed: 0 additions & 6 deletions
This file was deleted.

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_1/ore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'''
1515

1616
import sys, time
17-
from OREAnalytics import *
17+
from ORE import *
1818

1919
print ("Loading parameters...")
2020
params = Parameters()

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_1/ore2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'''
1515

1616
import sys, time, math
17-
from OREAnalytics import *
17+
from ORE import *
1818

1919
#############################################
2020
# Read inputs from files and kick off ORE run

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_2/Untitled.ipynb

Lines changed: 0 additions & 71 deletions
This file was deleted.

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_2/ore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'''
1515

1616
import sys, time
17-
from OREAnalytics import *
17+
from ORE import *
1818

1919
xml = "Input/ore.xml"
2020
params = Parameters()

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_3/ore_amc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'''
1515

1616
import sys, time
17-
from OREAnalytics import *
17+
from ORE import *
1818

1919
print ("Loading parameters...")
2020
params = Parameters()

OREAnalytics-SWIG/Python/Examples/Notebooks/Example_3/ore_classic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'''
1515

1616
import sys, time
17-
from OREAnalyticsPython import *
17+
from ORE import *
1818

1919
print ("Loading parameters...")
2020
params = Parameters()

README

Lines changed: 0 additions & 75 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ To build on Windows using CMake and an existing Visual Studio installation you c
5656
this from the top-level oreswig directory
5757

5858
mkdir builddir
59-
cmake -G "Visual Studio 15 2017" \
59+
cmake -G "Visual Studio 17 2022" \
6060
-A x64 \
6161
-D SWIG_DIR=C:\dev\swigwin\Lib \
6262
-D SWIG_EXECUTABLE=C:\dev\swigwin\swig.exe \
63-
-D ORE:PATHNAME=C:\dev\ORE\master \
64-
-D BOOST_ROOT=C:\dev\boost \
63+
-D ORE=<ORE Root Directory> \
64+
-D BOOST_INCLUDEDIR=<Top level boost include directory> \
65+
-D BOOST_LIBRARYDIR=<Location of the compiled boost libraries>\
66+
-D ORE_USE_ZLIB=[ON/OFF] (depending on your ORE build)
67+
-D MSVC_LINK_DYNAMIC_RUNTIME=[ON/OFF] (depending on your ORE build)
68+
-D Boost_NO_SYSTEM_PATHS=ON
6569
-S OREAnalytics-SWIG/Python \
6670
-B builddir
6771
cmake --build builddir -v

runCmakeVS.cmd

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
set VSVersion="Visual Studio 16 2019"
2-
rem build with VS 2017
3-
rem set VSVersion="Visual Studio 15 2017"
1+
REM This scripts build ORE and ORE_SWIG
2+
REM Adjust paths
3+
SET GENERATOR="Visual Studio 17 2022"
4+
SET DEMO_BOOST_ROOT=C:\local\boost_1_72_0
5+
SET DEMO_BOOST_LIB=C:\local\boost_1_72_0\lib64-msvc-14.2
6+
SET DEMO_SWIG_DIR=C:\dev\swigwin-4.1.1
7+
SET DEMO_ORE_DIR=C:\dev\ore
8+
SET DEMO_ORE_SWIG_DIR=C:\dev\oreswig
9+
REM the next path is optional, but if not set, one need to set -DORE_USE_ZLIB=OFF
10+
SET DEMO_ZLIB_ROOT=C:\dev\vcpkg\packages\zlib_x64-windows
11+
REM SET VCPKG_ROOT=C:\dev\vcpkg
12+
REM If you use VCPKG for zlib and eigen, add -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake to the cmake command
13+
14+
15+
REM building ORE, one can skip this part, make sure to delete the build dir in the ORE_DIR if there is any
16+
REM it is recommended to install the eigen and zlib library on the system before building ORE
17+
ECHO BUILD ORE
18+
cd %DEMO_ORE_DIR%
19+
mkdir build
20+
cd %DEMO_ORE_DIR%\build
21+
SET BOOST_INCLUDEDIR=%DEMO_BOOST_ROOT%
22+
SET BOOST_LIBRARYDIR=%DEMO_BOOST_LIB%
23+
SET ZLIB_ROOT=%DEMO_ZLIB_ROOT%
24+
cmake -G %GENERATOR% -A x64 .. -DMSVC_LINK_DYNAMIC_RUNTIME=OFF -DORE_BUILD_DOC=OFF -DORE_BUILD_EXAMPLES=OFF -DORE_BUILD_TESTS=OFF -DORE_BUILD_APP=OFF -DQL_BUILD_BENCHMARK=OFF -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_TEST_SUITE=OFF -DCMAKE_BUILD_TYPE=Release -DORE_USE_ZLIB=ON -DQL_ENABLE_SESSIONS=ON -DBoost_NO_SYSTEM_PATHS=ON
25+
26+
cd %DEMO_ORE_DIR%\build
27+
cmake --build . --config Release
28+
29+
ECHO BUILD ORESWIG
30+
cd %DEMO_ORE_SWIG_DIR%\OREAnalytics-SWIG\Python
431
mkdir build
5-
mkdir install
6-
cmake -G %VSVersion% -A x64 -DSWIG_DIR=C:\dev\swigwin\Lib -DSWIG_EXECUTABLE=C:\dev\swigwin\swig.exe -DORE:PATHNAME=C:\dev\ORE\master -DBOOST_ROOT=C:\dev\boost -S . -B build
7-
cmake --build build -v --config Release
32+
cd build
33+
SET BOOST_INCLUDEDIR=%DEMO_BOOST_ROOT%
34+
SET BOOST_LIBRARYDIR=%DEMO_BOOST_LIB%
35+
SET SWIG_ROOT=%DEMO_SWIG_DIR%
36+
SET ZLIB_ROOT=%DEMO_ZLIB_ROOT%
37+
cmake -Wno-dev -G %GENERATOR% -A x64 .. -DORE=%DEMO_ORE_DIR% -DMSVC_LINK_DYNAMIC_RUNTIME=OFF -DORE_USE_ZLIB=ON -DBoost_NO_SYSTEM_PATHS=ON
38+
cmake --build . --config Release
839

9-
rem copy all relevant python files to install
10-
copy build\OREAnalytics-SWIG\Python\OREAnalytics.py install
11-
copy build\OREData-SWIG\Python\OREData.py install
12-
copy build\QuantExt-SWIG\Python\QuantExt.py install
13-
copy build\QuantLib-SWIG\Python\QuantLib.py install
14-
copy build\OREAnalytics-SWIG\Python\Release\*.* install
15-
copy build\OREData-SWIG\Python\Release\*.* install
16-
copy build\QuantExt-SWIG\Python\Release\*.* install
17-
copy build\QuantLib-SWIG\Python\Release\*.* install
40+
REM now set your python path to build dir
41+
SET PYTHONPATH=%DEMO_ORE_SWIG_DIR%\OREAnalytics-SWIG\Python\build;%DEMO_ORE_SWIG_DIR%\OREAnalytics-SWIG\Python\build\Release
1842

19-
rem copy all relevant java files to install
20-
copy build\OREAnalytics-SWIG\Java\OREAnalyticsJava.jar install
21-
copy build\OREData-SWIG\Java\OREDataJava.jar install
22-
copy build\QuantExt-SWIG\Java\QuantExtJava.jar install
23-
copy build\QuantLib-SWIG\Java\QuantLibJava.jar install
24-
copy build\OREAnalytics-SWIG\Java\Release\*.* install
25-
copy build\OREData-SWIG\Java\Release\*.* install
26-
copy build\QuantExt-SWIG\Java\Release\*.* install
27-
copy build\QuantLib-SWIG\Java\Release\*.* install
28-
pause

0 commit comments

Comments
 (0)