Skip to content

Commit

Permalink
Disable unneeded build options
Browse files Browse the repository at this point in the history
* Disable build of libraries
* AVX code path off by default
* Do not static link against boost
  • Loading branch information
tpeulen committed Nov 14, 2024
1 parent f479045 commit 8c12459
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
5 changes: 4 additions & 1 deletion conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ cmake .. -G "NMake Makefiles" ^
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="%SP_DIR%" ^
-DCMAKE_SWIG_OUTDIR="%SP_DIR%" ^
-DPYTHON_VERSION="%PYTHON_VERSION_NUMERIC%" ^
-DBUILD_LIBRARY=ON
-DBUILD_LIBRARY=OFF ^
-DWITH_AVX=OFF ^
-DBoost_USE_STATIC_LIBS=OFF

nmake install

:: Add wrappers to path for each Python command line tool
Expand Down
32 changes: 16 additions & 16 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ mkdir b2 && cd b2
if [[ "${target_platform}" == osx-* ]]; then
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
else
export CONFIG_ARGS=""
fi

cmake \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DBUILD_PYTHON_INTERFACE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="$SP_DIR" \
-DCMAKE_SWIG_OUTDIR="$SP_DIR" \
-DBUILD_LIBRARY=ON \
-DPYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())')\
-G Ninja ..
cmake -S .. -B . \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DBUILD_PYTHON_INTERFACE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_LIBRARY=OFF \
-DWITH_AVX=OFF \
-Boost_USE_STATIC_LIBS=OFF \
-DPYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())')\
-G Ninja \
"${CONFIG_ARGS}"

# On some platforms (notably aarch64 with Drone) builds can fail due to
# running out of memory. If this happens, try the build again; if it
# still fails, restrict to one core.
ninja install -k 0 || ninja install -k 0 || ninja install -j 1
ninja install -j ${CPU_COUNT}

# Copy programs to bin
cd $PREFIX/bin
cp $SRC_DIR/bin/* .
chmod 0755 $SRC_DIR/bin/*
cp -f $SRC_DIR/bin/* $PREFIX/bin

0 comments on commit 8c12459

Please sign in to comment.