-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Arbitrary mixed compiler #5655
Comments
U know that there’s documentation, right? ;-) Reopen if issue persist |
I’m very familiar with the useful documentation of spack, @davydden. Including that page, for which I know I can add gfortan to Clang and make a mixed toolchain. My issue is about having an option of using Clang in a mixed toolchain or not. The documentation itself says “Modern compilers typically come with related compilers for C, C++ and Fortran bundled together. When possible, results are best if the same compiler is used for all languages.”, which is part of my reason to raise it. If I can create 2 compilers, one with only Clang for c/c++ and another “virtual” compiler that has the mixed toolchain, all packages that don’t depend on openmpi or a similar dependency could be used in a non-mixed toolchain with only Clang. Only the packages needing mpi would need the mixed toolchain. This same method would apply to Nag compilers, where one might want to have an option of Nag and an option of Nag+something else (which is not ideal, but sometimes you have no real choice). |
Three points:
p.s. the proper solution is actually separating c/c++ and fortran compilers, we discussed it long time ago (I don't remember the issue name/number), but no-one yet implemented this. The reason being it's not trivial. All places which take compilers (like commandline |
there are some useful links and discussions #638 (comment) and #568 (comment) |
Thanks for your comments @davydden. I'm thinking about it and there are some arguments I'd like to make as well to know the developer's opinion on it.
I understand your point, however if the pure toolchain and the mixed one are treated as separate it becomes easy to identify what packages were build in a non-ideal environment. This also makes it easy to later recompile the non-ideal packages in a good environment or eliminate them in one swoop.
I think this is an absolutely legitimate issue. But this would have to be addressed in any case for a mixed toolchain based on the discussions you sent me. As mentioned in one of the discussions, if I have Clang as C/C++ compiler and gfortran and compile a package that could have patches either for Clang or GCC, one of the patches would be missed. So it seems inevitable that the support for mixed toolchains will become a bit more elaborate. I understand the idea to separate the compilers, but maybe there are different ways of tackling the issue. It would be possible to make use of the fact that mixed toolchains depend on a mix of pure toolchains by definition. For example, if
Conceptually this would take advantage of the fact that a mixed toolchain is effectively a virtual toolchain resulting from a mix of pure ones. Therefore, it should be possible to check if it is a mixed one by a mixed entry and, if it is, expand the pure compilers. This could allow using the original compilers to check for patches using the syntax already in place and also to make modules with the same system. Hopefully you think this idea has its merits. |
it certainly does. Ping others who might be interested in the discussion @alalazo @adamjstewart @tgamblin |
this is also a relevant discussion #896 |
it's also related to this PR #5503 where |
Is there a way to add an arbitrary compiler to compilers.yaml?
The case is that I'm on Mac OS High Sierra and to install openmpi I need gfortran from gcc. This forces me to have a mixed toolchain.
However, a mixed toolchain is not exactly recommended. If possible, I'd like to keep the pure clang compiler available (since it works for many packages) and define an arbitrary mixed toolchain as a workaround only for installing C and Fortran dependent packages, such as openmpi.
I have the system Clang, spack's Clang and spack's GCC installed. I'd like to add an additional compiler to
compilers.yaml
that has Clang for C/C++ compiler and gfortran, such as:However, when I add the "mix" compiler, upon a
spack compilers
I get:Is it possible to specify a compiler in this or a similar manner?
The text was updated successfully, but these errors were encountered: