-
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
Mix Clang and GNU Fortran on OS-X #568
Comments
@davydden: You're not alone! I'm also using mixed compilers on Linux. I have a user who wants his entire software stack built with GNU C/C++ and NAG Fortran compilers. I haven't gotten around to testing this yet, but your solution of manually editing 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 However, some packages behave differently based on compiler. For example, look at the package for ncurses. It applies a GCC patch when the compiler is set to If it doesn't, then we might need to start a conversation about better mixed compiler support. Allowing compilers like |
Spack shouldn't treat compilers specially. Compilers are just a build (or run) dependency. Compilers, Python, Perl, etc., are all quite similar. A package that requires a C (or Fortran) compiler should specify so as a dependency. Combining C and C++ compilers into one configuration item might make sense. Fortran compilers should probably be handled separately. |
Perhaps something like
|
Is this a documentation issue or a coding issue? Maybe the manual needs a Mac OSX section explaining how to set up mixed compilers. This practice seems to be common, but is not documented anywhere online (that I know of). |
I would say this is both a Spack issue and a documentation issue. Documenation issue: Spack issue: 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 Now, should this be named @davydden: I like your suggestion of keeping C and Fortran compilers separate. I don't think you need separate I don't think users should be made to modify compilers.yaml just to be able to use Clang or NAG. I do like being able to specify What are other people's thoughts on the ideal way to support mixed compilers? |
@adamjstewart you are right, that one does not need to have separate sections, something like
would be enough. And I like your idea about checking
will lead to a mixture of compilers whereas
will lead to the usage of In addition to that, one would still need to be able to query
IMHO that will be enough to cover mixing with an exception when two different compilers provide both fortran and C. For that one would need to hack Documentation |
Two thoughts:
What are other people's thoughts on the ideal way to support mixed
-- Elizabeth |
My users specifically request NetCDF, HDF5, and HDF4 built with OpenMPI, MPICH, and MVAPICH using GCC, Intel, PGI, and NAG. This is the reason we started using Spack instead of installing everything by hand. I actually really don't like the hash, and don't want to absorb anything else into it. If I want to uninstall all packages that were built with PGI and start over again, currently I can run My biggest complaint about the hash is that it's very difficult to find the installation path for a package, and the path is very long. Since I need 4 compilers, 3 MPI implementation, and 2 variants, I end up having to install 24 versions of HDF5. The only way to figure out which one is which is to run: spack find -p hdf5 %pgi ^openmpi+psm
==> 2 installed packages.
-- linux-x86_64 / pgi@16.3-0 ------------------------------------
hdf5@1.8.16~cxx~debug+fortran+mpi+shared+szip~threadsafe /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/pgi-16.3-0/hdf5-1.8.16-h2dssxiylgwvhtcqhuji22o4bwuukumu
hdf5@1.8.16+cxx~debug+fortran~mpi+shared+szip~threadsafe /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/pgi-16.3-0/hdf5-1.8.16-gezhgvksjcbzfcrp5bd5jsqljwmsmvcy (For the record, one of those packages doesn't depend on OpenMPI, but I haven't file a bug report yet). This is fine, but I don't see why we couldn't also install things in a path like: /soft/spack/opt/spack/linux-x86_64/pgi-16.3-0/hdf5-1.8.16/openmpi-1.10.2-<enabled variants> @tgamblin: from what I understand, the reason that we started using the super-long-hash is because there were problems with special characters in filenames. I don't see why we couldn't just use dashes for all of these instead. Regardless of whether we include more stuff in the installation path, I don't see why we need the hashes at all. Any information previously stored in the hash could be stored in a spack spec file in the directory. This would also solve the overly long shebang problem.
One of the reasons we decided to go with Spack instead of EasyBuild was that the EasyBuild toolchains seemed overly complicated and we didn't want to have to write configuration files for every installation. Spack is just simpler in that respect. With that said, I never tried out EasyBuild because it had too many dependencies that I didn't want to have to install.
I really like this! Some packages only depend on F77, not FC, and actually raise warnings when we try to supply both. We should specify compilers as build dependencies and use Spack's dependency resolution magic. I'm not sure how I feel about dropping If we make them build dependencies, how do you propose to tell Spack to compile with Clang for C/C++ and GCC for Fortran? Or something crazy specific like using 4 different compilers? How about |
I think dropping |
Same as we tell Spack to use OpenMPI vs. MPICH. Something like: mylib/package.py:
gcc-cxx/package.py:
packages.yaml:
Now I can just say:
Or I specify which compiler I want on the command line, just as I specify My biggest complaint about the hash is that it's very difficult to find the
Our options as I see it are:
Of the three options, I think that hashes are the least evil. By far. We -- Elizabeth |
Shit, you're right. I need this to install |
I find this a really BAD idea, which has possible ripercussion on the formal language used by spack (imho its best innovation if compared with other package managers). Besides :
is comprehensible by anyone, while :
will be a little bit more cryptic... |
On Fri, Mar 25, 2016 at 1:32 PM, Adam J. Stewart notifications@github.com
I see... Spack as it is currently designed requires you to use compatible
Build dependencies are quite new. One we figure out how to specify a set |
@citibeth: Why encode any of the spec in the installation directory name? Everything Spack needs to find how a package was built can be found in $ROOT/.spack/spec.yaml. All we need is a unique installation path. This can be something like: /soft/spack/opt/spack/linux-x86_64/pgi-16.3-0/hdf5-1.8.16/openmpi-1.10.2-1
/soft/spack/opt/spack/linux-x86_64/pgi-16.3-0/hdf5-1.8.16/openmpi-1.10.2-2
... or something as simple as: /soft/spack/opt/spack/openmpi-1
/soft/spack/opt/spack/openmpi-2
... It's not any less human readable, but it is much shorter. I'm just hoping for a way to tell my 24 hdf5 installations apart based on the path. And I know the super-long-hash is causing shebang problems for some people. |
@davydden's point for Link Dependencies Build dependencies Compilers
So really, compilers aren't build dependencies. They're build/link dependencies with special compatibility semantics. I would like Spack's dependency system to understand that, and I think people should remember the above distinctions before we go "fully general". That said, I think you could keep |
I think |
@adamjstewart Regarding the "shorter" directory name, remember that if you don't hash you need to track:
In the end I am not sure that removing the hashes in the installation dir will be either more readable or shorter. |
@alalazo: We are keeping track of those, in the |
However, that does not help you with YOUR problem. You're not building Maybe what we need is some kind of pluggable nicknames. When a packages is
And I know the super-long-hash is causing shebang problems for some people. What are the problems specifically? There's no reason hashes can't be -- Elizabeth |
i actually do liked the current directory naming. It is a good balance between |
@davydden: But what is better about: opt/spack/linux-x86_64/pgi-16.3-0/openmpi-1.10.2-gibftzb3wyfkxc2lqxvnmtkiv2kr6hib than: opt/spack/linux-x86_64/pgi-16.3-0/openmpi-1.10.2-1 Both are unique (you just need to use an incrementor to add a number to the end of each build). Both supply all of the necessary information on how it was build (all of this can be gathered from the |
@tgamblin: do you have any opinions on hash vs. no hash? I would like to get this discussion out of the way so we can focus on the more important issue of mixed compiler support. This was just a side thought that appears to have blown up 😛 |
On Fri, Mar 25, 2016 at 1:56 PM, Denis Davydov notifications@github.com
-- Elizabeth |
You really don't want a directory name that depends on the order things were built. I need a quick way to query what is already installed so that I do not rebuild it. With this scheme, I would need to do that lookup somewhere else.
I agree with this. I think we need a feature that we have implemented but not merged yet... Views These are described in the spack paper. @mplegendre implemented them, and we use them here. We can generate an arbitrarily-formatted hierarchy of symlinks that point back into the real Spack install tree. We call these With views you could write something like:
and Spack will generate a tree with that layout, full of symlinks back to the real Spack install. Now, when you generate a tree like that, many hashes may map to one path, because your path is essentially describing some smaller subspace of the full spack package space. Since no spack feature would be complete without some mechanism to deal with combinatorial issues like this, we added some preference rules so that you can choose which of the many hashes to prefer for each unique name in your view. That is, if I have something like:
Many patch versions may map to that. You can say which ones you want to prefer, and in what order. Spack will link in the first one that exists in You can use this to generate a consistent view of your package tree, and regenerate it over time as you upgrade things. Is this something you'd want @adamjstewart? I think we could resurrect the feature and iterate on it. We had postponed merging it because we didn't know how it would work with "environments", which are basically where you link a bunch of packages into the same root. We thought we could unify those two ideas somehow and allow hierarchies where some things might actually exist in the same root and others might be separate. Seems like what we've got now might solve your issues. |
in case it's a single compiler family, it would be |
@adamjstewart: why don't we start a separate topic on views and move the view stuff there. |
Suppose I have a complete spec. With the current system, I can generate a With an incrementor-based naming scheme, I would have to look in every -- Elizabeth On Fri, Mar 25, 2016 at 2:01 PM, Adam J. Stewart notifications@github.com
|
@tgamblin: Views sound pretty sweet. I would be happy with that compromise someday. In the meantime, judging by the number of open issues, I think we have bigger problems to deal with. How about we save that for another day. Don't want to add too many features before fixing the ones we already have. |
@adamjstewart Ok let's table the directory layout discussion and chalk it up to something we can solve with views. The features is (mostly) done and working, so I think it wouldn't be a huge pain. There are more complicated things on the table though. |
in general, I like this. This isn't a complete description of the space, though. You could have different compilers for That said, I do not think we are covering the full space of compiler mixing yet. In particular, the Intel compilers, in a noble effort to achieve gcc binary compatibility, allow you to specify which gcc they are compatible with, and they do a really weird search of your environment to find out what version of gcc you have installed in order to decide what to do by default. Read this, but wear a helmet so your head doesn't explode. I think |
i guess one has to constrain things at some point. I would check for consistency between C/CXX and F77/FC. Same applies to the @@adamjstewart 's idea about checking for |
@davydden: this sounds reasonable. I do not currently have time to get this implemented, though, and I think it should wait until after #378, #561, and probably #360 get merged in. Those are going to add some changes that will conflict with any implementation of this. What you can actually do right now is just edit compilers:
darwin-x86_64:
nag@5.0-clang-3.8:
# etc
darwin-x86_64:
nag@5.0-gcc-5.0:
# etc This isn't wonderful, but it does get the information into the spec, and it provides a way to specify things on the command line. It does not handle the Intel/gcc issue I brought up above. |
@tgamblin: This works for me for now. The only problem I see is that some packages build differently |
@tgamblin i think this would also break some packages, for example in PETSc there is
That, i suppose is bound to be broken. I am with @adamjstewart here that one should not allow people to name compilers arbitrary. I would keep the naming fixed and add mixing logic as well as
In case there is no mixing of compilers, the two should return the same family. |
If the workaround above is good enough for now, can we close this? I think a broader discussion of compilers as "proper" dependencies is in order, but I am not sure when we'll get to it and there is an increasing number of issues to deal with. |
What is the workaround? I need to figure out how to mix clang C++ and C with gfortran to build things like 'hdf5' and 'cgns'. |
I believe it's pretty standard now, and in the Spack manual.
…On Fri, Aug 2, 2019 at 4:27 PM Roscoe A. Bartlett ***@***.***> wrote:
What is the workaround? I need to figure out how to mix clang C++ and C
with gfortran to build things like 'hdf5' and 'cgns'.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#568?email_source=notifications&email_token=AAOVY56TZZUJ4HWLLAOA55DQCSKBHA5CNFSM4B6O4JUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OYJMA#issuecomment-517833904>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOVY56X2VUOW3MBXNEYJ6DQCSKBHANCNFSM4B6O4JUA>
.
|
Okay, as per: we have to manually modify the generated compilers.yaml file to add the path for 'f77' to point to the gfortran that Spack isntalled? How can I automated that? |
…ck#568) Since for now the cmake cleanup in coreneuron is not released, we added the new cmake options specifically for `coreneuron@develop`.
Spack correctly finds compilers on El Capitan
and the
compilers.yaml
looks all rightTo use this on OS-X, one really need a way to specify the usage of
together with
when building, say, OpenMPI with fortran support. That also includes changing the installation prefix
darwin-x86_64/gcc-5.3.0/
to something likedarwin-x86_64/gcc-5.3.0-clang-7.0.2/
.As a current workaround I guess one can edit
compilers.yaml
manually to something likeand then make
clang
default.The text was updated successfully, but these errors were encountered: