Skip to content

Commit

Permalink
Try Boost_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
vespakoen committed Dec 10, 2024
1 parent 77d17fe commit 1ec6d2f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,25 +286,25 @@ jobs:
CIBW_BUILD_VERBOSITY: "1"
CIBW_ARCHS_WINDOWS: "${{ matrix.cibuildwheel_architecture }}"
CIBW_ENVIRONMENT_WINDOWS: >
BOOST_ROOT="$(cygpath -w $(pwd))"
Boost_DIR="$(cygpath -w $(pwd))"
OCL_BOOST_ADDRESS_MODEL="${{ matrix.boost_address_model }}"
OCL_BOOST_ARCHITECTURE="${{ matrix.boost_architecture }}"
CMAKE_GENERATOR="Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}"
CIBW_ENVIRONMENT_PASS_WINDOWS: "BOOST_ROOT OCL_BOOST_ADDRESS_MODEL OCL_BOOST_ARCHITECTURE CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM"
CIBW_ENVIRONMENT_PASS_WINDOWS: "Boost_DIR OCL_BOOST_ADDRESS_MODEL OCL_BOOST_ARCHITECTURE CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM"
CIBW_ARCHS_MACOS: "${{ matrix.architecture }}"
CIBW_ENVIRONMENT_MACOS: >
BOOST_ROOT="$(pwd)"
Boost_DIR="$(pwd)"
OCL_MACOS_ARCHITECTURE="${{ matrix.architecture }}"
OCL_BOOST_ARCHITECTURE="${{ matrix.boost_architecture }}"
OPENMP_PREFIX_MACOS="/tmp/libomp/libomp/fixed"
CIBW_ENVIRONMENT_PASS_MACOS: "BOOST_ROOT OCL_BOOST_ARCHITECTURE OPENMP_PREFIX_MACOS"
CIBW_ENVIRONMENT_PASS_MACOS: "Boost_DIR OCL_BOOST_ARCHITECTURE OPENMP_PREFIX_MACOS"
CIBW_ARCHS_LINUX: "${{ matrix.architecture }}"
CIBW_ENVIRONMENT_LINUX: >
BOOST_ROOT="$(pwd)"
Boost_DIR="$(pwd)"
OCL_BOOST_ARCHITECTURE="${{ matrix.boost_architecture }}"
CMAKE_GENERATOR="Unix Makefiles"
CIBW_ENVIRONMENT_PASS_LINUX: "BOOST_ROOT OCL_BOOST_ARCHITECTURE CMAKE_GENERATOR"
CIBW_ENVIRONMENT_PASS_LINUX: "Boost_DIR OCL_BOOST_ARCHITECTURE CMAKE_GENERATOR"
# - name: Compress Boost.Python
# shell: bash
# run: |
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Make sure you have a compiler, git, cmake and Boost installed (or simply downloa
make . # try make -j4 for a faster build if you have a multi-core machine
make install .
When boost is not in a standard location, you can add the ``-D BOOST_ROOT=/path/to/boost`` option to the cmake command.
When boost is not in a standard location, you can add the ``-D Boost_DIR=/path/to/boost`` option to the cmake command.

=======================
Building for Emscripten
Expand Down Expand Up @@ -233,7 +233,7 @@ Now you can compile OpenCAMLib like this (make sure to replace the ``path/to/``
-D BUILD_EMSCRIPTEN_LIB="ON" \
-D USE_OPENMP="OFF" \
-D CMAKE_INSTALL_PREFIX="/path/to/opencamlib/src/npmpackage/build" \
-D BOOST_ROOT="/path/to/boost" \
-D Boost_DIR="/path/to/boost" \
..
emmake make # try emmake make -j4 for a faster build if you have a multi-core machine
Expand Down Expand Up @@ -266,7 +266,7 @@ Next, use cmake-js to compile the library:
--CDBUILD_NODEJS_LIB="ON" \
--CDUSE_OPENMP="ON" \
--CDCMAKE_INSTALL_PREFIX="/path/to/opencamlib/build/Release/$(node --print 'process.platform')-nodejs-$(node --print 'process.arch')" \
--CDBOOST_ROOT="/path/to/boost" \
--CDBoost_DIR="/path/to/boost" \
--config "Release"
===================
Expand Down Expand Up @@ -337,7 +337,7 @@ This happens a lot, here are some of the reasons why this happens:
If you forgot to install boost, go ahead and download Boost from from their website: https://www.boost.org/users/download/ and extract it somewhere.
Now, when compiling the C++ or node.js module, add the

``-D BOOST_ROOT=/path/to/extracted/boost`` flag to the ``cmake ..`` command, or the.
``-D Boost_DIR=/path/to/extracted/boost`` flag to the ``cmake ..`` command, or the.

``--boost-prefix /path/to/extracted/boost`` flag to the ``./install.sh`` command

Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ get_cmake_args() {
-D VERSION_STRING="2023.09.6"
${OCL_DISABLE_OPENMP:+"-D USE_OPENMP=OFF"} \
${OCL_INSTALL_PREFIX:+"-D CMAKE_INSTALL_PREFIX=${OCL_INSTALL_PREFIX}"} \
${OCL_BOOST_PREFIX:+"-D BOOST_ROOT=${OCL_BOOST_PREFIX}"}"
${OCL_BOOST_PREFIX:+"-D Boost_DIR=${OCL_BOOST_PREFIX}"}"
}

get_cmakejs_args() {
Expand All @@ -427,7 +427,7 @@ test_cxxlib() {
${OCL_GENERATOR:+"-G ${OCL_GENERATOR}"} \
${OCL_GENERATOR_PLATFORM:+"-A ${OCL_GENERATOR_PLATFORM}"} \
-D Boost_ADDITIONAL_VERSIONS="${boost_additional_versions}" \
${OCL_BOOST_PREFIX:+"-DBOOST_ROOT=${OCL_BOOST_PREFIX}"}
${OCL_BOOST_PREFIX:+"-DBoost_DIR=${OCL_BOOST_PREFIX}"}
set +x
cd build
cmake_build
Expand Down Expand Up @@ -480,7 +480,7 @@ build_pythonlib() {
export CMAKE_ARGS="${OCL_GENERATOR:+"-G ${OCL_GENERATOR} "}\
${OCL_GENERATOR_PLATFORM:+"-A ${OCL_GENERATOR_PLATFORM} "}\
-D CMAKE_BUILD_TYPE=${build_type} \
${OCL_BOOST_PREFIX:+"-D BOOST_ROOT=${OCL_BOOST_PREFIX} "}"
${OCL_BOOST_PREFIX:+"-D Boost_DIR=${OCL_BOOST_PREFIX} "}"
cd "${project_dir}"
${python_executable} -m pip install --verbose .
}
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ set(Boost_DEBUG ON CACHE BOOL "boost-debug")
if(USE_STATIC_BOOST)
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "boost-use-static-libs")
endif()
if(DEFINED ENV{BOOST_ROOT} OR DEFINED BOOST_ROOT)
if(DEFINED ENV{Boost_DIR} OR DEFINED Boost_DIR)
set(Boost_NO_SYSTEM_PATHS ON)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down

0 comments on commit 1ec6d2f

Please sign in to comment.