spack: Unable to specify dependency by hash

Hello, I’m trying to install lammps with an mvapich2 that is already installed, but Spack still tries to rebuild mvapich2. Am I missing something needed here?

[spack@login03 ~]$ spack find -l -f mvapich2
==> 3 installed packages.
-- linux-centos7-x86_64 / gcc@6.3.0 -----------------------------
qmt35td mvapich2@2.2%gcc

er3die3 mvapich2@2.2%gcc ldflags="-L/cm/shared/apps/slurm/current/lib64" 


-- linux-centos7-x86_64 / intel@17.0.4 --------------------------
2hro7lm mvapich2@2.2%intel ldflags="-L/cm/shared/apps/slurm/current/lib64" 

[spack@login03 ~]$ spack install --restage lammps %gcc@6.3.0 ^mvapich2/er3die3
==> libpciaccess is already installed in /hpc/spack/opt/spack/linux-centos7-x86_64/gcc-6.3.0/libpciaccess-0.13.5-uwak3icfpwpnppl643wooiqa4mykd5rg
==> bison is already installed in /hpc/spack/opt/spack/linux-centos7-x86_64/gcc-6.3.0/bison-3.0.4-7blhnzv2yrbjgt5rl2vzxsxiul7kmzmy
==> Installing mvapich2
==> Using cached archive: /hpc/spack/var/spack/cache/mvapich2/mvapich2-2.2.tar.gz
==> Staging archive: /hpc/spack/var/spack/stage/mvapich2-2.2-horahftsbn65ipxh3wzwx2tzzxtt66yy/mvapich2-2.2.tar.gz
==> Created stage in /hpc/spack/var/spack/stage/mvapich2-2.2-horahftsbn65ipxh3wzwx2tzzxtt66yy
==> Building mvapich2 [AutotoolsPackage]
==> Executing phase : 'autoreconf'

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

@adamjstewart I haven’t had a chance to catch up on the rest of the conversation, but the counterintuitive hash behavior on the command line that you mention above no longer occurs.

$ spack spec lammps ^mvapich2/er3die3 is perfectly legal syntax now, and Spack understands to translate that to $ spack install lammps ^mvapich2@version%compiler@version+variants^dependencies

Spack also still works without specifying the package name. $ spack spec lammps ^mvapich2/er3die3 and $ spack spec lammps ^/er3die3 are identical.

I made a typographical error, that’s why the first command didn’t work. I wanted the output of

$ spack spec mvapich2@2.2%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64" ch3_rank_bits=32 ~cuda~debug fabrics=sock process_managers=slurm threads=multiple arch=linux-centos7-x86_64

without the ^.

Also, can you paste the output of

spack spec lammps %gcc@6.3.0

and

spack find -Lvfd mvapich2?

spack find --very-long gives:

[spack@login03 ~]$ spack find --very-long mvapich2
==> 3 installed packages.
-- linux-centos7-x86_64 / gcc@6.3.0 -----------------------------
qmt35tdsl6x57ttizruzgghbrmpkugow mvapich2@2.2  er3die3ta7t3o7cpcouousnf3thssq54 mvapich2@2.2

-- linux-centos7-x86_64 / intel@17.0.4 --------------------------
2hro7lmb46bv54rqun4bopook5wfhxan mvapich2@2.2

spack spec --install-status gives:

[spack@login03 spack]$ spack spec --install-status lammps%gcc@6.3.0 ^/er3die3
Input spec
--------------------------------
     lammps%gcc@6.3.0
[+]      ^mvapich2@2.2%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  ch3_rank_bits=32 ~debug fabrics=sock process_managers=slurm threads=multiple arch=linux-centos7-x86_64 
[+]          ^bison@3.0.4%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]              ^m4@1.4.18%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64" +sigsegv arch=linux-centos7-x86_64 
[+]                  ^libsigsegv@2.11%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]          ^libpciaccess@0.13.5%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 

Normalized
--------------------------------
     lammps%gcc@6.3.0
         ^fftw
[+]      ^mvapich2@2.2%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  ch3_rank_bits=32 ~debug fabrics=sock process_managers=slurm threads=multiple arch=linux-centos7-x86_64 
[+]          ^bison@3.0.4%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]              ^m4@1.4.18%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64" +sigsegv arch=linux-centos7-x86_64 
[+]                  ^libsigsegv@2.11%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]          ^libpciaccess@0.13.5%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
                 ^libtool
                 ^pkg-config@0.9.0:
                 ^util-macros

Concretized
--------------------------------
     lammps@2016.11.17%gcc@6.3.0+lib~manybody~meam~rigid~user-atc~user-nc-dump~voronoi arch=linux-centos7-x86_64 
         ^fftw@3.3.6-pl2%gcc@6.3.0+double+float+long_double+mpi~openmp~pfft_patches~quad arch=linux-centos7-x86_64 
[+]          ^mvapich2@2.2%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  ch3_rank_bits=32 ~cuda~debug fabrics=sock process_managers=slurm threads=multiple arch=linux-centos7-x86_64 
[+]              ^bison@3.0.4%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]                  ^m4@1.4.18%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64" +sigsegv arch=linux-centos7-x86_64 
[+]                      ^libsigsegv@2.11%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]              ^libpciaccess@0.13.5%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]                  ^libtool@2.4.6%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 
[+]                  ^pkg-config@0.29.2%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64" +internal_glib arch=linux-centos7-x86_64 
[+]                  ^util-macros@1.19.1%gcc@6.3.0 ldflags="-L/cm/shared/apps/slurm/current/lib64"  arch=linux-centos7-x86_64 

spack install lammps%gcc@6.3.0 ^/er3die3 without --restage still tries to build mvapich2 again:

[spack@login03 spack]$ spack install lammps%gcc@6.3.0 ^/er3die3
==> libpciaccess is already installed in /hpc/spack/opt/spack/linux-centos7-x86_64/gcc-6.3.0/libpciaccess-0.13.5-uwak3icfpwpnppl643wooiqa4mykd5rg
==> bison is already installed in /hpc/spack/opt/spack/linux-centos7-x86_64/gcc-6.3.0/bison-3.0.4-7blhnzv2yrbjgt5rl2vzxsxiul7kmzmy
==> Installing mvapich2
==> Using cached archive: /hpc/spack/var/spack/cache/mvapich2/mvapich2-2.2.tar.gz
==> Already staged mvapich2-2.2-horahftsbn65ipxh3wzwx2tzzxtt66yy in /hpc/spack/var/spack/stage/mvapich2-2.2-horahftsbn65ipxh3wzwx2tzzxtt66yy
==> No patches needed for mvapich2
==> Building mvapich2 [AutotoolsPackage]
==> Executing phase : 'autoreconf'

Oh, I completely missed that, sorry. I was looking at the ldflags and got confused.

The problem is how you’re specifying the dependency. The hash includes the package name, version, variants, compiler, and dependencies. So when you say:

$ spack install lammps ^mvapich2/er3die3

Spack translates this to:

$ spack install lammps ^mvapich2 mvapich2@version%compiler@version+variants^dependencies

Try this instead:

$ spack install lammps ^/er3die3