Skip to content

Commit

Permalink
PERF: Remove OpenMP specific CMake code
Browse files Browse the repository at this point in the history
- Following pull request SuperElastix/elastix#1188
"Remove OpenMP based code, ELASTIX_USE_OPENMP option and OpenMP compiler flags"
  • Loading branch information
N-Dekker committed Aug 26, 2024
1 parent 2c84bd8 commit 6f7fcaa
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ if(NOT DEFINED USE_KNNGraphAlphaMutualInformationMetric)
set(USE_KNNGraphAlphaMutualInformationMetric OFF CACHE BOOL "Use KNN metric. Requires ANN library.")
endif()

if(CMAKE_COMPILER_IS_GNUCXX AND
("${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "4.8") OR
("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.8" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "5.0") )
set(ELASTIX_USE_OPENMP OFF CACHE BOOL "Use OpenMP in elastix")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-aggressive-loop-optimizations")
endif()
Expand Down Expand Up @@ -61,7 +56,6 @@ if(SKBUILD)
endif()

if(WASI OR EMSCRIPTEN)
option(ELASTIX_USE_OPENMP "OpenMP not supported on WASI or Emscripten" OFF)
option(ELASTIX_NO_INSTALL_EXECUTABLES "Do not install executables" ON)
endif()

Expand Down Expand Up @@ -91,17 +85,6 @@ find_package(Elastix REQUIRED)
include_directories( ${ELASTIX_INCLUDE_DIRS} )
link_directories( ${ELASTIX_LIBRARY_DIRS} )
#include(${ELASTIX_USE_FILE})
if(ELASTIX_USE_OPENMP)
find_package(OpenMP QUIET)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${OpenMP_STATIC_LINKER_FLAGS}")
add_definitions(-DELASTIX_USE_OPENMP)
endif()
endif()
if(ELASTIX_USE_OPENCL)
add_definitions(-DELASTIX_USE_OPENCL)
endif()
Expand Down

0 comments on commit 6f7fcaa

Please sign in to comment.