Using prebuilt package but with different compiler

132 views
Skip to first unread message

Pramod Kumbhar

unread,
Aug 16, 2016, 8:17:34 AM8/16/16
to Spack
Hello All,

I am new user of spack and this might be basic question:

I want to build package "cube" which is say dependent on qt.
I have built qt with gcc compiler and then want to use it while
building cube with other compilers (say intel).

I am trying this:

These are qt installed versions with gcc:

 spack module find qt
==> Error: the constraint 'None' matches multiple packages, and this is not allowed in this context
q...@4.8.6%g...@4.9.3~gtk~krellpatch~mesa arch=linux-redhat6-x86_64
q...@5.4.2%g...@4.9.3~gtk~krellpatch~mesa arch=linux-redhat6-x86_64
q...@5.5.1%g...@5.4.0~gtk~krellpatch~mesa arch=linux-redhat6-x86_64

Now I want to build cube and want to use above qt package. But spack
start building qt with intel compiler. In the documentation I read option of
packages.yaml where we can say buildable: False. But can this
be achieved via command line?

spack install --keep-stage -v cu...@4.3.4 +gui %in...@15.0.0 ^q...@5.5.1%g...@5.4.0~gtk~krellpatch~mesa    #here i tried ^q...@5.5.1%g...@5.4.0 etc.
==> Installing cube
==> Installing qt        => why?
==> Installing glib


Thanks!
Pramod

Elizabeth F

unread,
Aug 16, 2016, 8:47:27 AM8/16/16
to Pramod Kumbhar, Spack
Pramod,

In general, binaries built with one compiler are not compatible with those built by another compiler.  Even when they are, the dependencies package A was built with (using compiler CA) can be different from the dependencies package B will use when being built with compiler CB and depending on A (for example, compiler libraries such as libc).  These kinds of issues cause unending "dependency hell."  "I linked it, but then it crashes upon startup; why?"

Spack solves this problem by making sure that everything you link together was built by the same compiler (the same VERSION of the same compiler, in fact).  Sure, it is possible at times to build package A with compiler CA and then use it from package B built with CA.  But since Spack doesn't know where that is or is not OK, it stays on the safe side and build everything with the same compiler.  We're trading a little extra build time and HDD space for savings in human time and mental effort.

spack install --keep-stage -v cu...@4.3.4 +gui %in...@15.0.0 ^q...@5.5.1%g...@5.4.0~gtk~krellpatch~mesa    #here i tried ^q...@5.5.1%g...@5.4.0 etc.

I don't know why Spack did what it did on this command line.  But I will say that mixing compilers within a spec is almost certainly outside the bounds of what Spack is meant to do.

Finally... are you sure that this would even work if Spack did it for you?  Although I don't know the specifics for certain GNU vs. Intel compilers, I do know that in general, C++ compilers are incompatible with each other.

-- Elizabeth


--
You received this message because you are subscribed to the Google Groups "Spack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spack+unsubscribe@googlegroups.com.
To post to this group, send email to sp...@googlegroups.com.
Visit this group at https://groups.google.com/group/spack.
For more options, visit https://groups.google.com/d/optout.

Ben Boeckel

unread,
Aug 16, 2016, 10:39:14 AM8/16/16
to Pramod Kumbhar, Spack
On Tue, Aug 16, 2016 at 05:17:34 -0700, Pramod Kumbhar wrote:
> Now I want to build cube and want to use above qt package. But spack
> start building qt with intel compiler. In the documentation I read option of
> packages.yaml where we can say buildable: False. But can this
> be achieved via command line?

Not currently. Eventually, building something with a compiler will cause
the compiler to add a dependency on the compiler's runtime libraries
(e.g., glibc, libstdcxx, etc.) and as long as those don't conflict,
things should work fine. However, as Elizabeth said, currently spack
treats all compilers as incompatible with each other.

Related issues:

https://github.com/LLNL/spack/issues/896
https://github.com/LLNL/spack/issues/458

--Ben

pramod kumbhar

unread,
Aug 16, 2016, 11:17:37 AM8/16/16
to ben.b...@kitware.com, Spack
Dear Ben and Elizabeth,

Thank you very much for detailed information!

I can see the linking issues and potential problems.
I was trying to install some packages where we can use
the same package (e.g. cube/qt in this case with different
score-p builds). This is already summarised into the tickets
than Ben pointed.

Thanks again!

-Pramod



Reply all
Reply to author
Forward
0 new messages