spack unable to install gcc

1,032 views
Skip to first unread message

Alastair Neil

unread,
Sep 30, 2019, 9:50:15 PM9/30/19
to Spack
I have just picked up my experiment with spack and I seem to be falling at the first hurdle.  It seems there must be something simple I am missing, this is a CentOS 7.6 system with the standard gcc system compiler installed. 


I performed the git check out, set SPACK_ROOT, and sourced $SPACK_ROOT/share/spack/setup-env.sh

I wanted to test by installing g...@8.2.0  the actual version is not relevant the same issue happens with all versions I have tried.  So I issued:

I checked
spack compiler list

and it had picked up my compile gcc 4.8.5 so I tried:


spack install g...@8.2.0

all appears well with the dependencies being built
 
==> Installing zlib
==> Searching for binary cache of zlib
==> Warning: No Spack mirrors are currently configured
==> No binary for zlib found: installing from source
==> Fetching http://zlib.net/fossils/zlib-1.2.11.tar.gz
######################################################################## 100.0%
==> Staging archive: /tmp/root/spack-stage/zlib-1.2.11-nywa3dsq7ajb3mnjbc7y2mvohn744bgk/zlib-1.2.11.tar.gz
==> Created stage in /tmp/root/spack-stage/zlib-1.2.11-nywa3dsq7ajb3mnjbc7y2mvohn744bgk
==> No patches needed for zlib
==> Building zlib [Package]
==> Executing phase: 'install'
==> Successfully installed zlib
  Fetch: 0.73s.  Build: 3.13s.  Total: 3.87s.
[+] /opt/apps/Spack/opt/spack/linux-centos7-core2/gcc-4.8.5/zlib-1.2.11-nywa3dsq7ajb3mnjbc7y2mvohn744bgk

until the actual GCC compile:
 
==> Installing gcc
==> Searching for binary cache of gcc
==> Warning: No Spack mirrors are currently configured
==> No binary for gcc found: installing from source
==> Error: OSError: [Errno 2] No such file or directory: '/opt/apps/Spack/opt/spack/linux-centos7-core2/gcc-4.8.5/gcc-8.2.0-tm37s5zfoazozwk67nowyvsm2esizq6k/bin'

/opt/apps/Spack/var/spack/repos/builtin/packages/gcc/package.py:429, in setup_environment:
        426
        427        # Get the contents of the installed binary directory
        428        bin_path = self.spec.prefix.bin
  >>    429        bin_contents = os.listdir(bin_path)
        430
        431        # Find the first non-symlink compiler binary present for each language
        432        for lang in ['cc', 'cxx', 'fc', 'f77']:

it appears it is looking for the package it has yet to install.  I admit to being perplexed.  Any pointer gratefully received.

-Alastair


Petr Hanousek

unread,
Oct 1, 2019, 6:13:37 AM10/1/19
to Spack
Hi Alastair,
try this:
spack --debug install gcc
to see what all configuration it uses before the gcc installation begins. I've seen such an error before but don't remeber what was the solution. Just that the debug helped me to localize the problem.
Petr


Dne úterý 1. října 2019 3:50:15 UTC+2 Alastair Neil napsal(a):

phoenix

unread,
Oct 1, 2019, 9:33:06 AM10/1/19
to Spack
I'm having the same issue, on a fresh CentOS 7 virtual machine. I'm trying to debug the problem.

phoenix

unread,
Oct 1, 2019, 9:40:50 AM10/1/19
to Spack
Also --debug did not reveal any more useful information:

I've tried spack --debug install g...@8.2.0, but ended up with the same error. The only lines attributed to the gcc install are:

==> [2019-10-01-15:35:15.137341] Installing gcc
==> [2019-10-01-15:35:15.137385] Searching for binary cache of gcc
==> [2019-10-01-15:35:15.140449] No binary for gcc found: installing from source
==> [2019-10-01-15:35:15.223957] '/usr/bin/gcc' '-v' '/tmp/spack-implicit-link-infoijPNWj/main.c' '-o' '/tmp/spack-implicit-link-infoijPNWj/output'
==> [2019-10-01-15:35:15.255794] parsing implicit link info
==> [2019-10-01-15:35:15.256129] linker line:  /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/collect2 --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib>
==> [2019-10-01-15:35:15.256227] linkdir: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
==> [2019-10-01-15:35:15.256277] linkdir: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64
==> [2019-10-01-15:35:15.256320] linkdir: /lib/../lib64
==> [2019-10-01-15:35:15.256359] linkdir: /usr/lib/../lib64
==> [2019-10-01-15:35:15.256394] linkdir: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../..
==> [2019-10-01-15:35:15.256441] found raw link dirs: /usr/lib/gcc/x86_64-redhat-linux/4.8.5, /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64, /lib/../lib64, /usr/lib/../lib64, /usr/l>
==> [2019-10-01-15:35:15.256536] found link dirs: /usr/lib/gcc/x86_64-redhat-linux/4.8.5, /usr/lib64, /lib64, /usr/lib
==> [2019-10-01-15:35:15.342860] A dependency has updated CPATH, this may lead pkg-config to assume that the package is part of the system includes and omit it when invoked with '--cflags'.
==> [2019-10-01-15:35:15.350942] Error: OSError: [Errno 2] No such file or directory: '/site/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-8.2.0-q5tss7soouu5rbk2ujndl54ir3ainmiq/bin'

/site/spack/var/spack/repos/builtin/packages/gcc/package.py:429, in setup_environment:

        426
        427        # Get the contents of the installed binary directory
        428        bin_path = self.spec.prefix.bin
  >>    429        bin_contents = os.listdir(bin_path)
        430
        431        # Find the first non-symlink compiler binary present for each language
        432        for lang in ['cc', 'cxx', 'fc', 'f77']:


Traceback (most recent call last):
  File "/site/spack/lib/spack/spack/build_environment.py", line 774, in child_process
    setup_package(pkg, dirty=dirty)
  File "/site/spack/lib/spack/spack/build_environment.py", line 704, in setup_package
    pkg.setup_environment(spack_env, run_env)
  File "/site/spack/var/spack/repos/builtin/packages/gcc/package.py", line 430, in setup_environment
OSError: [Errno 2] No such file or directory: '/site/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-8.2.0-q5tss7soouu5rbk2ujndl54ir3ainmiq/bin'
==> [2019-10-01-15:35:15.351390] READ LOCK: /site/spack/opt/spack/.spack-db/lock[0:0] [Acquiring]
==> [2019-10-01-15:35:15.351559] READ LOCK: /site/spack/opt/spack/.spack-db/lock[0:0] [Acquired]
==> [2019-10-01-15:35:15.358486] READ LOCK: /site/spack/opt/spack/.spack-db/lock[0:0] [Released]
==> [2019-10-01-15:35:15.359226] ChildError: OSError: [Errno 2] No such file or directory: '/site/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-8.2.0-q5tss7soouu5rbk2ujndl54ir3ainmiq/bin'
/site/spack/var/spack/repos/builtin/packages/gcc/package.py:429, in setup_environment:

        426
        427        # Get the contents of the installed binary directory
        428        bin_path = self.spec.prefix.bin
  >>    429        bin_contents = os.listdir(bin_path)
        430
        431        # Find the first non-symlink compiler binary present for each language
        432        for lang in ['cc', 'cxx', 'fc', 'f77']:

Traceback (most recent call last):
  File "/site/spack/lib/spack/spack/build_environment.py", line 774, in child_process
    setup_package(pkg, dirty=dirty)
  File "/site/spack/lib/spack/spack/build_environment.py", line 704, in setup_package
    pkg.setup_environment(spack_env, run_env)
  File "/site/spack/var/spack/repos/builtin/packages/gcc/package.py", line 430, in setup_environment
OSError: [Errno 2] No such file or directory: '/site/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-8.2.0-q5tss7soouu5rbk2ujndl54ir3ainmiq/bin'


Should I file a bug report?
spack.txt

Alastair Neil

unread,
Oct 1, 2019, 11:51:01 AM10/1/19
to Spack

I hacked the gcc package file and replaced:

        bin_path = self.spec.prefix.bin
        bin_contents = os.listdir(bin_path) 
 
with:

        bin_path = self.spec.prefix.bin
        if os.path.exists(bin_path):
            bin_contents = os.listdir(bin_path)
        else:
            return

and now the package install seems to be proceeding normally.  I assume this was some attempt to permit multistage recompilation gone awry?

Alastair Neil

unread,
Oct 1, 2019, 3:09:02 PM10/1/19
to Spack
I can confirm that the modifications I made to
/opt/apps/spack/var/spack/repos/builtin/packages/gcc/package.py

resolved the issue and I was able to install gcc 9.2.0

Peter Scheibel

unread,
Oct 1, 2019, 9:50:40 PM10/1/19
to Spack
Hi Alastair,

Thanks for reporting this! This is now fixed in Spack's develop branch (see: https://github.com/spack/spack/pull/13000).

- Peter
Reply all
Reply to author
Forward
0 new messages