Skip to content

Commit

Permalink
PERF: more optimization at compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpa committed Sep 4, 2024
1 parent 8911caa commit 550400a
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 550400a

Please sign in to comment.