Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion language-extensions/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ B. Installing needed packages from respective sources.

1. Install the package numpy into your python. This is needed to build boost_numpy in the next step.

1. Download and build [Boost Python](https://www.boost.org/doc/libs/1_87_0/libs/python/doc/html/building/no_install_quickstart.html) with your version of Python. Make sure to build the static libraries.
1. Download and build [Boost Python](https://www.boost.org/doc/libs/1_90_0/libs/python/doc/html/building/no_install_quickstart.html) with your version of Python. Make sure to build the static libraries.

1. Set PYTHONHOME and BOOST_ROOT to point to your python installation and boost build folder respectively.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ PYTHONEXTENSION_WORKING_DIR=${ENL_ROOT}/build-output/pythonextension/linux
INCLUDE_ROOT=/usr/local/include

DEFAULT_PYTHONHOME=/usr/local
DEFAULT_BOOST_ROOT=/usr/local/lib/boost_1_87_0
DEFAULT_BOOST_ROOT=/usr/local/lib/boost_1_90_0

# Find PYTHONHOME from user, or set to default for tests.
# Error code 1 is generic bash error.
Expand Down
4 changes: 2 additions & 2 deletions language-extensions/python/build/linux/restore-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ add-apt-repository -y ppa:deadsnakes/ppa
apt-get update

DEFAULT_PYTHONHOME=/usr
BOOST_VERSION=1.87.0
BOOST_VERSION_IN_UNDERSCORE=1_87_0
BOOST_VERSION=1.90.0
BOOST_VERSION_IN_UNDERSCORE=1_90_0
PYTHON_VERSION=3.12
NUMPY_VERSION=2.3.0
PANDAS_VERSION=2.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SET PYTHONEXTENSION_WORKING_DIR=%ENL_ROOT%\build-output\pythonextension\windows
IF EXIST %PYTHONEXTENSION_WORKING_DIR% (RMDIR /s /q %PYTHONEXTENSION_WORKING_DIR%)
MKDIR %PYTHONEXTENSION_WORKING_DIR%

SET BOOST_VERSION=1.79.0
SET BOOST_VERSION_IN_UNDERSCORE=1_79_0
SET BOOST_VERSION=1.90.0
SET BOOST_VERSION_IN_UNDERSCORE=1_90_0
SET DEFAULT_BOOST_ROOT=%PACKAGES_ROOT%\boost_%BOOST_VERSION_IN_UNDERSCORE%
SET DEFAULT_BOOST_PYTHON_ROOT=%DEFAULT_BOOST_ROOT%\stage\lib
SET DEFAULT_PYTHONHOME=C:\Python310
Expand Down
27 changes: 17 additions & 10 deletions language-extensions/python/build/windows/restore-packages.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ SET PYTHON_VERSION_NO_DOT=310

REM Specify the Boost version to be downloaded and installed
REM
SET BOOST_VERSION=1.79.0
SET BOOST_VERSION_IN_UNDERSCORE=1_79_0
SET BOOST_VERSION=1.90.0
SET BOOST_VERSION_IN_UNDERSCORE=1_90_0

REM Download and install Python from the official Python website
REM
Expand Down Expand Up @@ -87,19 +87,26 @@ echo %PACKAGES_ROOT%
pushd %PACKAGES_ROOT%\boost_%BOOST_VERSION_IN_UNDERSCORE%
echo %cd%
dir
echo create user config jam
REM Create a Boost user-config.jam configuration file for building Boost.Python
REM
echo using python : %PYTHON_VERSION_MAJOR_MINOR% : "%PYTHON_INSTALLATION_PATH_DOUBLE_SLASH%\\python" : "%PYTHON_INSTALLATION_PATH_DOUBLE_SLASH%\\include" : "%PYTHON_INSTALLATION_PATH_DOUBLE_SLASH%\\libs" ; > user-config.jam

REM Run Boost's bootstrap script and build Boost.Python with the created configuration
REM Run Boost's bootstrap script to build the b2 build engine
REM Explicitly set VS2019 Compiler tooling
REM bootstrap - "vc142"
REM b2.exe "toolset=msvc-14.2"
echo -- Beginning Boost b2.exe build -- Time: %time% --
CALL bootstrap.bat vc142
echo -- Beginning Boost build using compiled b2.exe-- Time: %time% --
b2.exe -j12 --prefix=%PACKAGES_ROOT%\output --with-python --user-config="%PACKAGES_ROOT%\boost_%BOOST_VERSION_IN_UNDERSCORE%\user-config.jam" --debug-configuration -dp0 toolset=msvc-14.2

REM bootstrap.bat may change the working directory (e.g. into tools\build\src\engine).
REM Restore it to the Boost root so b2.exe can find Jamroot and build correctly.
REM
cd /d %PACKAGES_ROOT%\boost_%BOOST_VERSION_IN_UNDERSCORE%

REM Append Python configuration to project-config.jam (generated by bootstrap.bat above).
REM This must be done AFTER bootstrap since bootstrap creates/overwrites project-config.jam.
REM This approach matches the Linux build and ensures b2 auto-loads the Python config.
REM
echo using python : %PYTHON_VERSION_MAJOR_MINOR% : "%PYTHON_INSTALLATION_PATH_DOUBLE_SLASH%\\python" : "%PYTHON_INSTALLATION_PATH_DOUBLE_SLASH%\\include" : "%PYTHON_INSTALLATION_PATH_DOUBLE_SLASH%\\libs" ; >> project-config.jam

echo -- Beginning Boost build using compiled b2.exe -- Time: %time% --
b2.exe -j12 --with-python toolset=msvc-14.2 address-model=64 link=static,shared threading=multi
echo -- Finished Boost build -- Time: %time% --

REM If building in pipeline, set the PYTHONHOME here to overwrite the existing PYTHONHOME
Expand Down
8 changes: 4 additions & 4 deletions language-extensions/python/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ elseif(${PLATFORM} STREQUAL windows)
set(COMPILE_OPTIONS ${COMPILE_OPTIONS} /MDd)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG:FULL /OPT:REF /OPT:ICF")
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_90 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_90 ${BOOST_PYTHON_ROOT})
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /OPT:REF /OPT:ICF")
set(COMPILE_OPTIONS ${COMPILE_OPTIONS} /MD)
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_90 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_90 ${BOOST_PYTHON_ROOT})
endif()

target_compile_options(PythonExtension PRIVATE ${COMPILE_OPTIONS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ PYTHONEXTENSIONTEST_WORKING_DIR=${ENL_ROOT}/build-output/pythonextension-test/li
INCLUDE_ROOT=/usr/local/include

DEFAULT_PYTHONHOME=/usr/local
DEFAULT_BOOST_ROOT=/usr/local/lib/boost_1_87_0
DEFAULT_BOOST_ROOT=/usr/local/lib/boost_1_90_0

# Find PYTHONHOME from user, or set to default for tests.
# Error code 1 is generic bash error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ SET PYTHONEXTENSION_TEST_WORKING_DIR=%ENL_ROOT%\build-output\pythonextension-tes
RMDIR /s /q %PYTHONEXTENSION_TEST_WORKING_DIR%
MKDIR %PYTHONEXTENSION_TEST_WORKING_DIR%

SET BOOST_VERSION=1.79.0
SET BOOST_VERSION_IN_UNDERSCORE=1_79_0
SET BOOST_VERSION=1.90.0
SET BOOST_VERSION_IN_UNDERSCORE=1_90_0
SET DEFAULT_BOOST_ROOT=%PACKAGES_ROOT%\boost_%BOOST_VERSION_IN_UNDERSCORE%
SET DEFAULT_BOOST_PYTHON_ROOT=%DEFAULT_BOOST_ROOT%\stage\lib
SET DEFAULT_PYTHONHOME=C:\Python310
Expand Down
8 changes: 4 additions & 4 deletions language-extensions/python/test/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ elseif(${PLATFORM} STREQUAL windows)
#
if (${CMAKE_BUILD_TYPE} STREQUAL debug)
set(COMPILE_OPTIONS ${COMPILE_OPTIONS} /MDd)
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_90 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-gd-x64-1_90 ${BOOST_PYTHON_ROOT})
find_library(GTEST_LIB gtestd ${GTEST_LIB_PATH})
else()
set(COMPILE_OPTIONS ${COMPILE_OPTIONS} /MD)
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_79 ${BOOST_PYTHON_ROOT})
find_library(BOOST_PYTHON_LIB libboost_python${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_90 ${BOOST_PYTHON_ROOT})
find_library(BOOST_NUMPY_LIB libboost_numpy${PYTHON_VERSION_NO_DOT}-vc142-mt-x64-1_90 ${BOOST_PYTHON_ROOT})
find_library(GTEST_LIB gtest ${GTEST_LIB_PATH})
endif()

Expand Down