spack: Compiler in spec ignored for build dependencies

I’ve never noticed this before, but I don’t think it’s the intended behavior??

$ spack spec eigen %intel
Input spec
--------------------------------
eigen%intel

Normalized
--------------------------------
eigen%intel
    ^cmake

Concretized
--------------------------------
eigen@3.2.10%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"~debug+fftw+metis+mpfr+scotch+suitesparse arch=linux-centos6-x86_64
    ^cmake@3.6.1%gcc@6.1.0~doc+ncurses+openssl+ownlibs~qt arch=linux-centos6-x86_64
        ^ncurses@6.0%gcc@6.1.0 arch=linux-centos6-x86_64
        ^openssl@1.0.2j%gcc@6.1.0 arch=linux-centos6-x86_64
            ^zlib@1.2.8%gcc@6.1.0+pic arch=linux-centos6-x86_64
    ^fftw@3.3.5%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"+float+long_double+mpi+openmp~pfft_patches~quad arch=linux-centos6-x86_64
        ^mvapich2@2.2%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"~debug~gforker+hydra~mrail~nemesis~nemesisib~nemesisibtcp+psm~remshell~slurm~sock arch=linux-centos6-x86_64
            ^bison@3.0.4%gcc@6.1.0 arch=linux-centos6-x86_64
                ^m4@1.4.17%gcc@6.1.0+sigsegv arch=linux-centos6-x86_64
                    ^libsigsegv@2.10%gcc@6.1.0 arch=linux-centos6-x86_64
            ^libpciaccess@0.13.4%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64
                ^libtool@2.4.6%gcc@6.1.0 arch=linux-centos6-x86_64
                ^pkg-config@0.29.1%gcc@6.1.0+internal_glib arch=linux-centos6-x86_64
                ^util-macros@1.19.0%gcc@6.1.0 arch=linux-centos6-x86_64
    ^gmp@6.1.1%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64
    ^metis@5.1.0%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"~debug~gdb~idx64~real64+shared arch=linux-centos6-x86_64
    ^mpfr@3.1.4%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64
    ^scotch@6.0.3%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"+compression~esmumps+metis~mpi+shared arch=linux-centos6-x86_64
        ^flex@2.6.1%gcc@6.1.0 arch=linux-centos6-x86_64
            ^gettext@0.19.8.1%gcc@6.1.0+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-centos6-x86_64
                ^bzip2@1.0.6%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64
                ^libxml2@2.9.4%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"~python arch=linux-centos6-x86_64
                    ^xz@5.2.2%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64
                ^tar@1.29%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64
            ^help2man@1.47.4%gcc@6.1.0 arch=linux-centos6-x86_64
    ^suite-sparse@4.5.3%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"+fpic+tbb arch=linux-centos6-x86_64
        ^openblas@0.2.19%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX"+fpic+openmp+shared arch=linux-centos6-x86_64
        ^tbb@4.4.4%intel@17.0.0 cflags="-axCORE-AVX2,AVX" cxxflags="-axCORE-AVX2,AVX" fflags="-axCORE-AVX2,AVX" arch=linux-centos6-x86_64

It looks like all of the build dependencies are building with GCC even though Intel was specified. @mathstuf Is this how things are supposed to work?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 37 (37 by maintainers)

Most upvoted comments

It seems like we should just be concretizing the DAG of things reachable via link edges, then concretize the build deps node by node per-build.

@ashkan2200 You should check out the documentation on packages.yaml. It does exactly what you’re looking for, permanently.

but I’ve heard that mixing C++ compilers with different dependencies can cause problems

C++ compilers use completely different ABIs since there is no standard (every MSVC version crossed with release and debug build modes and the calling conventions/mangling of GCC exist). Those two are the main ABIs and the standard library in use pretty much dictates it.

right, there is no reason to have build-only dependencies in DAG as they won’t influence anything, they are auxiliary packages needed to build things and that’s it.

I think they should eventually be in the DAG for provenance (in case their affect the build somehow) but right now we don’t include them to avoid having to rebuild things JUST because of a build dep. Once we can consider installed things during concretization I was planning to put them back.

But yes – I think their resolution should be entirely separate. We could even consider resolving them one-by-one so that if they have conflicting link dependencies, they do not interfere. The “normalization” restriction we use in concretization (i.e., only one instance of any dependency in the DAG, ever) stems from the conditions needed to get the dynamic linker to work consistently. It only has one symbol namespace. But since the build deps are really run as separate processes they don’t have that restriction.

Would it be useful to separate the build deps from the rest of the DAG in the output of spack spec?

@mathstuf suggested to resolve them separately https://github.com/LLNL/spack/issues/839 , which i would say is good to have.

@adamjstewart It’s supposed to allow the build dependencies to be recycled better and to avoid building them with “weird” compilers. It’s useful not only on Cray and BG/Q, but also on clusters like the new ppc64le machines at LLNL and ORNL, where we want to build codes with compilers like XL, but nobody wants to port, say, cmake or Qt (which cmake depends on) to XL. It would even be useful on regular Linux clusters when building with things like PGI.

IBM is working on packaging math libraries and tools with Spack for us and ORNL, and they were running into these issues, so we told them to focus on getting the HPC stuff building with the fancy compilers and not to worry about build deps.