From this week it appears that new commits to elastix (using ITK and OpenMP), fail to compile on MacOS, both on GitHub Actions and Azure Pipelines, saying:
Modules/ThirdParty/Eigen3/src/itkeigen/…/itkeigen/Eigen/Core:70:10: fatal error: ‘omp.h’ file not found
The header file “itkeigen/Eigen/Core” is included indirectly, via ITK.
Did anyone else encounter this error recently? It might be introduced by an adjustment in the Microsoft-hosted virtual environments, but I’m basically clueless.
I did try brew install libomp, but then it just said:
Warning: libomp 14.0.0 is already installed and up-to-date
I don’t think it’s Eigen related (header only library). But to be sure, could you pass -DEIGEN_DONT_PARALLELIZE to see if #include <omp.h> also fails from the elastix headers?
Google shows a bit of hits on not finding omp.h in MacOS. Not sure what changed…
Long shot, but maybe you have to change the CMAKE_OSX_DEPLOYMENT_TARGET to match the new(?) one in Azure?
Thanks for the suggestions, @phcerdan I just tried your first suggestion:
if (APPLE)
# Work around MacOS CI errors saying:
# Modules/ThirdParty/Eigen3/src/itkeigen/…/itkeigen/Eigen/Core:70:10: fatal error: ‘omp.h’ file not found
add_compile_definitions( EIGEN_DONT_PARALLELIZE )
endif()
Unfortunately, the MacOS compile errors are still there…
Maybe try the second option of tweaking the OSX_DEPLOYMENT path, openmp is weird, because it’s a compiler flag (-fopenmp), but also a external library.