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
make compilers a build dependency without using depends_on() #896
Comments
Just my two cents : compilers are not dependencies. If we proceed with this we will lose the possibility to say something like:
because we will end up with 2 providers for the same virtual dependency in one DAG. In fact the line above will look to
as long as virtual dependency resolution is concerned. I think the ability to handle situations like this (mixing compilers in one DAG) is one of the key differences between
|
@alalazo : i agree with you that treating compilers exactly the same as packages using I think we can all agree that if a package has
Namely, by introducing new command
. |
If you need just a check that a particular compiler is present, then an optional
I think something like this may be done quickly and neatly, but it's something different (at least to my understanding) from what the issue and related link initially proposed. |
I believe I was one of the first people to bring this up (#568). A big reason why this would be useful would be to allow you to mix compilers. Right now, you can hack compilers:
linux-x86_64:
nag@6.0:
cc: /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-4.4.7/gcc-5.3.0-fygfl7rvyuiteto27dlhmilp5cstw2o2/bin/gcc
cxx: /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-4.4.7/gcc-5.3.0-fygfl7rvyuiteto27dlhmilp5cstw2o2/bin/g++
f77: /blues/gpfs/home/software/nag/6.0/bin/nagfor
fc: /blues/gpfs/home/software/nag/6.0/bin/nagfor But the resulting package is not NAG. It's GCC C/C++ and NAG Fortran. Without including the version number, there is no difference between NAG 6.0/GCC 5.3.0 and NAG 6.0/GCC 4.4.7. There is also no difference between NAG/GCC and NAG/Intel, or Clang/GCC and Clang/Intel. As @tgamblin suggested, adding version suffixes like Being able to explicitly run something on the command line like:
would solve this in my opinion. As for the actual implementation, I have no allegiances. Like @davydden, I want a way to specify that a particular package needs a certain compiler (CC, CXX, F77, and/or FC) and a way to explicitly choose which one to satisfy that virtual dependency/need. It doesn't need to be the same mechanic as As for specifying the compiler to build a subpackage for, I think this should still work:
|
There are build-time and run-time dependency. A compiler is a build-time dependency. Thus the expression
will be just fine -- they don't conflict. It's like building different packages with different versions of |
@alalazo :
i think it still solves the issue i described above.
agree. It is different in that these however-we-call-these-requreiemts-or-needs are not part of the DAG.
agree. I would say the trick should be to make, in @alalazo 's terminology,
together with
then This whole conretization check only affects a single node in DAG in the same way compilers are conretized. So i hope it should be doable, perhaps even quickly.
👍
if I understand you correct, you suggest to keep build time dependencies outside of DAG whereas run-time dependencies within the DAG. In this sense this is indeed a related issue/solution strategy. |
See #839 for how this could work. |
Closing in favor of #31357 |
this idea materialised in numerous discussions [1] : #882 (comment) #876 (comment)
Essentially, each package should know which compilers it needs. Same applies to
mpi
. We may need just C/C++ part of thempi
library, or we may need bothc/c++
andfortran
compiler wrappers.Foropempi
one could haveand then in some packageor alike.(update: see #896 (comment)).That's how it is done in Homebrew (see for example Hypre https://github.com/Homebrew/homebrew-science/blob/master/hypre.rb#L17). I think it is a good idea to adopt a similar approach.
I see several reasons why this is important, here is one. I am currently helping our sysadmin to use
spack
. On some Linuxesgfortran
was not available when he first runspack isntall dealii
.dealii
has a lot of dependencies and quite big DAG was created.openmpi
together with some other packages were installed successfully. Luckily for us,openblas
failed due to missing fortran compilers. I helped him to debug the issue, we removedcompilers.yaml
and everything went fine withopenblas
. Howeverhypre
failed even whencompilers.yaml
had proper links to fortran compilers. That is becauseopenmpi
happened to be installed before we fixedgfortran
issue and thus did not compile Fortran part of the library. Obviously a fix is to reinstallopenmpi
.You can imagine that for newcomers those errors would be very difficult to track down. What is worse is that DAG fails to build somewhere in the middle. Such issues could be made more transparent if packages would declare which compilers they need. In this case, the whole DAG would probably have failed to conretize as no fortran compiler would be found. This would be a much easier to fix even for a newcomer to
spack
.Additionally once compilers are made dependencies of packages, their mixing
c/c++
andfortran
from different families (clang/gcc) would probably be easier as one would search for a working fortran compiler among all compilers known to spack. Of course, the whole conretization logic would be more complicated, probably with restrictions to use at maximum two different compiler suites forc/c++
andf77/fc
each.[1] i will update the links if I find more
The text was updated successfully, but these errors were encountered: