Skip to content

Commit

Permalink
Merge pull request #705 from ANTsX/build_optimization
Browse files Browse the repository at this point in the history
PERF: more optimization at compile time
  • Loading branch information
cookpa committed Sep 4, 2024
2 parents 8911caa + 550400a commit 504a43a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ nanobind_add_module(
src/antscore/ThresholdImage.cxx
src/antscore/TileImages.cxx
)
target_compile_options(lib PRIVATE -O3)
target_link_libraries(lib PRIVATE ${ITK_LIBRARIES} antsUtilities registrationUtilities imageMathUtilities)

# Install directive for scikit-build-core
Expand Down
15 changes: 4 additions & 11 deletions scripts/build_itk.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
#!/bin/bash
CXX_STD=CXX11
JTHREADS=2
if [[ `uname` -eq Darwin ]] ; then
CMAKE_BUILD_TYPE=Release
fi
if [[ $TRAVIS -eq true ]] ; then
CMAKE_BUILD_TYPE=Release
JTHREADS=2
fi
CMAKE_BUILD_TYPE=Release

echo "Dependency;GitTag" > ./data/softwareVersions.csv
echo "ITK;${itktag}" >> ./data/softwareVersions.csv

mkdir -p itkbuild
cd itkbuild
compflags=" -fPIC -O2 "
cmake \
-DCMAKE_BUILD_TYPE:STRING="${CMAKE_BUILD_TYPE}" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -Wno-c++11-long-long -fPIC -O2 -DNDEBUG "\
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -Wno-c++11-long-long -fPIC -O2 -DNDEBUG "\
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -Wno-c++11-long-long -fPIC -O3 -DNDEBUG "\
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -Wno-c++11-long-long -fPIC -O3 -DNDEBUG "\
-DITK_USE_GIT_PROTOCOL:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
Expand Down Expand Up @@ -46,4 +39,4 @@ cmake \

make -j 3

cd ../
cd ../

0 comments on commit 504a43a

Please sign in to comment.