Skip to content

Commit

Permalink
COMP: Fix MacOS CI errors, "‘omp.h’ file not found", "Undefined symbols"
Browse files Browse the repository at this point in the history
Addresses issue #650 "MacOS GitHub Actions, Azure Pipelines fatal error: ‘omp.h’ file not found"

Also fixed MacOS/OpenMP linker errors, saying:

> Undefined symbols for architecture x86_64:
> "___kmpc_for_static_fini", referenced from:
>     _.omp_outlined. in itkAdvanceOneStepParallellizationTest.cxx.o
>  "___kmpc_for_static_init_4", referenced from:
>     _.omp_outlined. in itkAdvanceOneStepParallellizationTest.cxx.o
>  "___kmpc_fork_call", referenced from:
>      OptimizerTEMP::AdvanceOneStep() in itkAdvanceOneStepParallellizationTest.cxx.o
>  "_omp_set_num_threads", referenced from:
>      OptimizerTEMP::AdvanceOneStep() in itkAdvanceOneStepParallellizationTest.cxx.o

Inspired by pull request openMVG/openMVG#2038 "builds on Mac OS 12 AppleClang + OpenMP"
  • Loading branch information
N-Dekker committed Sep 9, 2022
1 parent 912db87 commit 9cdca6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ if(ELASTIX_USE_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
# ${OpenMP_EXE_LINKER_FLAGS}")
include_directories(${OpenMP_CXX_INCLUDE_DIRS})
link_libraries(${OpenMP_CXX_LIBRARIES})
add_definitions(-DELASTIX_USE_OPENMP)
endif()
endif()
Expand Down

0 comments on commit 9cdca6d

Please sign in to comment.