-
Notifications
You must be signed in to change notification settings - Fork 203
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
Problem using CPATH in modulefiles overwriting system paths #3331
Comments
@Flamefire Do you think there's a scenario where no longer setting I'm a bit reluctant to make a change like this in EasyBuild 4.x, it feels like giving up some control (having Maybe problems that pop up because of this should be dealt with on a per case basis, like we did for ROOT? @bsteinb Any input on this (since you referenced this issue after hitting a problem at JSC related to this)? |
Incorrect things are what we have to deal with anyway. If some software explicitly passes something to the compiler this should win. Us "injecting" unexpected stuff is what I would consider incorrect (which is the reason for this issue anyway)
I'd say this will be hard. Because most often it will "just work". I.e. the application requests some other path (e.g. a local directory) but the system/EB path is taken instead and it happens to work because the API is "compatible enough". But at ABI level it might break in silent ways. So we'll only notice problem when it breaks loudly at build time. IMO we have some kind of assurance that this change works well: Because Spack already uses it. |
To maintain backwards compatibility we can just introduce an option to choose one or the other approach, for v4 the default is to use CPATH, for v5 we switch the default (and for maintainers we can recommend to switch already so that we gain plenty of experience with the change) |
This is just to add a comment that we are also facing problems associated with the setting of CPATH in modules. The problem arises for Fortran codes and the use of |
Is there a way to do the equivalent of passing |
This is still an on-going problem for our Fortran codes. I've just had to manually strip the setting of CPATH from all our new installations of |
This would be possible Alternative for admins: module_write hook to replace or remove CPATH |
This could be guarded behind an EasyBuild configuration option like |
Summary of maintainers meetingThere are 2 dimensions to this issue:
This means that builds carried out by EB mainly rely on We will add options to change how EB behaves in both situations: |
This doesn't seem to fully solve the initial problem: Unconditionally setting
Yes and the other variables should work the same way if we set them instead of |
We do not plan to change the default. This is not a widespread issue. Software needing this specific setup will be handled on a case-per-case basis through |
TLDR: Stop setting CPATH in module files and set
C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, INCLUDE
insteadThis came up for ROOT and was work-arounded in easybuilders/easybuild-easyblocks#2047
Basically: the C/C++ preprocessor considers the paths in the following order:
-I
CPATH
-isystem
CPLUS_INCLUDE_PATH
Now projects adding paths via
-isystem
have those ignored if the same folder/file name exists inCPATH
which happened for ROOT and LLVM resulting in taking an incompatible, EB installed LLVM over the included LLVMTalked to a Spack guy about the CPATH issue: They had the same: spack/spack#11555 and solved it by using
C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, INCLUDE
instead: spack/spack#14749So I guess we can and should be doing the same. For existing modules we could simply move the contents of
CPATH
to the other 3 variables after loading a moduleObvious downside: 3 variables with duplicated content instead of 1.
From Bennet Fauber:
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
Lists the variables for GNU Cs.
CPLUS_INCLUDE_PATH is particularly useful for --std=c++99 and what have you that are specific to C++. I am blanking on which it was, but one of the geographic libraries was using CFLAGS for that, and it wasn't working well....
The text was updated successfully, but these errors were encountered: