MacOS GitHub Actions, Azure Pipelines: itkeigen/Eigen/Core: fatal error: ‘omp.h’ file not found

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.

GitHub Actions log: https://my.cdash.org/build/2165559 and https://my.cdash.org/viewBuildError.php?buildid=2165559

Azure Pipelines: https://dev.azure.com/kaspermarstal/Elastix/_build/results?buildId=3173&view=logs&j=d9d370b1-18a3-5231-ee95-54c0a379145c

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

Any suggestion?

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?

1 Like

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… :cry:

Yeah, as expected, it’s not ITK or Eigen related.

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.

1 Like