You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\subsection{How to build ORE Python Wheels on Windows}
922
+
923
+
This section is a stand-alone HOWTO for building ore and oreswig, including Python wrappers and wheels, at the DOS command line using cmake and VS 2022.
924
+
925
+
\subsubsection*{Prerequisites}
926
+
927
+
\begin{itemize}
928
+
\item python: The following tools need to be up to date: \\
929
+
{\tt python -m ensurepip } \\
930
+
{\tt pip install build }
931
+
\item boost: Download the binaries from the link below. This release was tested against boost version 1.72. It is important to download these precompiled binaries (rather than compiling yourself from source code) because the binaries include ZLIB support which this build requires. \\
This will create \%DEMO\_ORE\_DIR\%{\bs}build{\bs}OREAnalytics{\bs}orea{\bs}Release{\bs}OREAnalytics-x64-mt.lib
977
+
978
+
\subsubsection*{Build ORE-SWIG Wrapper and Wheel}
979
+
980
+
In contrast to the generic cmake-based SWIG build in section \ref{sec:oreswig}, we are now resorting to python's setup.py.
981
+
982
+
\medskip
983
+
{\tt cd \%DEMO\_ORE\_SWIG\_DIR\%{\bs}OREAnalytics-SWIG{\bs}Python} \\
984
+
{\tt set BOOST\_ROOT=\%DEMO\_BOOST\_ROOT\%} \\
985
+
{\tt set BOOST\_LIB=\%DEMO\_BOOST\_LIB\%} \\
986
+
{\tt set ORE\_DIR=\%DEMO\_ORE\_DIR\%} \\
987
+
{\tt set PATH=\%PATH\%;\%DEMO\_SWIG\_DIR\%} \\
988
+
{\tt set ORE\_STATIC\_RUNTIME=1} \\
989
+
{\tt python setup.py wrap} \\
990
+
{\tt python setup.py build} \\
991
+
{\tt python setup.py test} \\
992
+
{\tt python -m build -{}-wheel}
993
+
994
+
\medskip
995
+
This will create
996
+
\begin{itemize}
997
+
\item the Python module and static library in folder {\tt <PATH>{\bs}build{\bs}lib.win-amd64-cpython-310} (the directory name depends on the machine and python version)
998
+
\item the wheel file (filename.whl) in folder {\tt <PATH>{\bs}dist}
999
+
\end{itemize}
1000
+
where {\tt <PATH>} stands for {\tt \%DEMO\_ORE\_SWIG\_DIR\%{\bs}OREAnalytics-SWIG{\bs}Python}.
1001
+
1002
+
\medskip
1003
+
To use the wrapper directly: \\
1004
+
\medskip
1005
+
{\tt cd <PATH>{\bs}Examples} \\
1006
+
{\tt set PYTHONPATH=<PATH>{\bs}build{\bs}lib.win-amd64-cpython-310} \\
0 commit comments