add --search-path-cpp-headers configuration option to control how EasyBuild sets paths to headers at build time#4645
Conversation
… cpp-headers-search-path
…endency_cpp_headers method
…ependency_liker_paths and Toolchain._add_dependency_cpp_headers methods
|
What about
|
|
@Flamefire that's out of scope of this PR. This handles all supported options by CPP, which does not apply to Fortran. For Fortran we first need to check what is supported by the different Fortran preprocessors (gfortran for GNU and FPP for Intel) and probably it will need a different option in EB. |
|
Actually, after checking the docs, it turns out that the Fortran compilers in both GNU and Intel do support the same environment variables defined by CPP. So this PR already applies to Fortran as well:
|
|
Ok, I see. Only potential issue I see is that setting Also: How are existing entries handled? I.e. if Edit: That was supposed to be a reply to #4645 (comment) ;-) |
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Flamefire
left a comment
There was a problem hiding this comment.
Still some refinements of the new functions which I think are required to avoid subtile issues.
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
…ser behaviour to extend
Flamefire
left a comment
There was a problem hiding this comment.
Looks good to me. One (very) minor suggestion where I'm not sure. See the comment.
--search-path-cpp-headers configuration option to control how EasyBuild sets paths to headers at build time
Micket
left a comment
There was a problem hiding this comment.
Looks like @Flamefire is happy with it. I tested a couple of builds and it seems fine.
Partial fix for #3331
EasyBuild (at build time) currently handles paths to headers of dependencies provided by EB through
CPPFLAGS. The result is that the compilation command gets additional options of the form-I/path/to/includeexplicitly pointing the compiler to places with extra headers.The GCC prepocessor also supports the following environment variables that define the search paths for headers, which have lower precedence than
-Icommand line options:(see https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html#Environment-Variables-1)
This PR adds a new build option and toolchain option called
cpp-headers-search-pathto control how EasyBuild will handle paths to headers at build time:CPPFLAGSand injecting-I/path/to/includeto compilation commandCPATHenvironment variableC_INCLUDE_PATH,CPLUS_INCLUDE_PATH,OBJC_INCLUDE_PATHindependentlyNotes:
Toolchain._add_dependency_cpp_headers()method (@migueldiascosta can you please check that this works on your side?)LDFLAGSandCPPFLAGSwith newToolchainmethods in ACML toolchain