New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No /usr/include on macOS Mojave #4681
Comments
@Slicer/slicer-developer does anyone have an idea how best to fix this? To me this seems like something to fix at the CMake level, but I guess we could just set the environment variable as part of our build. |
Update this to use/require |
Since:
Could you test the following patch: diff --git a/CMake/ExternalProjectForNonCMakeProject.cmake b/CMake/ExternalProjectForNonCMakeProject.cmake
index efafbdfa75..a316cb30bd 100644
--- a/CMake/ExternalProjectForNonCMakeProject.cmake
+++ b/CMake/ExternalProjectForNonCMakeProject.cmake
@@ -215,6 +215,10 @@ if(APPLE)
endif()
set(CMAKE_OSX_FLAGS \"\${osx_arch_flags} \${osx_version_flag} \${osx_sysroot}\")
+ if(NOT DEFINED ENV{SDKROOT})
+ set(ENV{SDKROOT} \"\${CMAKE_OSX_SYSROOT}\")
+ endif()
+
_ep_var_append(_ep_CFLAGS \"\${CMAKE_OSX_FLAGS}\")
_ep_var_append(_ep_CXXFLAGS \"\${CMAKE_OSX_FLAGS}\")
_ep_var_append(_ep_LDFLAGS \"\${CMAKE_OSX_FLAGS}\")
@pieper Based on your feedback, I will then submit a PR. |
@jcfr Just tried applying that patch but it didn't solve the problem. Probably it sets the environment of the wrong process. It seems like we need to add the variable in OpenSSL_Env.cmake. Is that generated in our SuperBuild or somewhere in CMake? |
CMake computes the value of the -isysroot flag for cmake builds. OpenSSL does not have a mechanism for setting this directly, so using an environmental variable allows the compiler to pick up the correct SDKROOT path. Allow the SDKROOT to be found on mac when building OpenSSL. This is needed to find standard header files and avoid errors like ``` ./cryptlib.h:62:11: fatal error: 'stdlib.h' file not found # include <stdlib.h> ``` Related to Slicer#4681
@pieper Thanks for testing @hjmjohnson Thanks for working on a patch (for reference #4857)
Yes, and the proposed patch was intended to have the value set in that script. The problem was that the build command is not using a CMake wrapper script (and not including |
CMake computes the value of the -isysroot flag for cmake builds. OpenSSL does not have a mechanism for setting this directly, so using an environmental variable allows the compiler to pick up the correct SDKROOT path. Allow the SDKROOT to be found on mac when building OpenSSL. This is needed to find standard header files and avoid errors like ``` ./cryptlib.h:62:11: fatal error: 'stdlib.h' file not found # include <stdlib.h> ``` Related to Slicer#4681
CMake computes the value of the -isysroot flag for cmake builds. OpenSSL does not have a mechanism for setting this directly, so using an environmental variable allows the compiler to pick up the correct SDKROOT path. Allow the SDKROOT to be found on mac when building OpenSSL. This is needed to find standard header files and avoid errors like ``` ./cryptlib.h:62:11: fatal error: 'stdlib.h' file not found # include <stdlib.h> ``` Related to #4681
This commit fixes a regression introduced in ddeb0a3 (COMP: Fix OpenSSL build on Mac 10.15 XCode 11.4.1 (Slicer#4857)) originally intended to fix issue Slicer#4681 Setting the SDKROOT environment variable worked as expected on a regular developer build but failed on a dashboard build where the invocation of "make" is wrapped using a "launcher" [1] This commit addresses the issue by writing a CMake script that will set the environment and then invoke make. Last, since file descriptors expect by the make jobserver are not kept open by the CMake process, the build script explicitly unset MAKEFLAGS to avoid "warning: -jN forced in submake: disabling jobserver mode." For more details, see [2] [1] https://cmake.org/cmake/help/latest/manual/ctest.1.html#ctest-build-step [2] https://stackoverflow.com/questions/29910944/is-it-possible-to-pass-through-gnu-make-jobserver-environment-to-a-submake-ser
This commit fixes a regression introduced in ddeb0a3 (COMP: Fix OpenSSL build on Mac 10.15 XCode 11.4.1 (#4857)) originally intended to fix issue #4681 Setting the SDKROOT environment variable worked as expected on a regular developer build but failed on a dashboard build where the invocation of "make" is wrapped using a "launcher" [1] This commit addresses the issue by writing a CMake script that will set the environment and then invoke make. Last, since file descriptors expect by the make jobserver are not kept open by the CMake process, the build script explicitly unset MAKEFLAGS to avoid "warning: -jN forced in submake: disabling jobserver mode." For more details, see [2] [1] https://cmake.org/cmake/help/latest/manual/ctest.1.html#ctest-build-step [2] https://stackoverflow.com/questions/29910944/is-it-possible-to-pass-through-gnu-make-jobserver-environment-to-a-submake-ser
Can this issue be closed? Is there any work that still needs to be done following all the referenced commits and PRs? |
Yes, it seems to be working now. I no longer need to specify the path on the command line. On mac I currently configure with the script below.
|
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The text was updated successfully, but these errors were encountered: