Skip to content

Installation issue: openblas, using spack-built gcc on MacOS #42627

@benc303

Description

@benc303

Steps to reproduce the issue

This is on MacOS Sonoma on an M1, using Apple Clang 15.0.0. First, build gcc 13.2 with spack install gcc. This succeeds, and then get the location using spack location -i gcc, and paste the gfortran location in compilers.yaml, as described in the documentation.

Then, building openblas fails. This is the spec used:

$ spack spec -I openblas
Input spec
--------------------------------
 -   openblas

Concretized
--------------------------------
 -   [email protected]%[email protected]~bignuma~consistent_fpcsr+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=none arch=darwin-sonoma-m1
[+]      ^[email protected]%[email protected]~guile build_system=generic arch=darwin-sonoma-m1
[+]      ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=darwin-sonoma-m1
[+]          ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-sonoma-m1
[+]              ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-sonoma-m1
[+]          ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-sonoma-m1
[+]              ^[email protected]%[email protected] build_system=autotools arch=darwin-sonoma-m1
[+]                  ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-sonoma-m1
[+]          ^[email protected]%[email protected] build_system=autotools arch=darwin-sonoma-m1
[+]              ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-sonoma-m1
[+]                  ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools arch=darwin-sonoma-m1
[+]                      ^[email protected]%[email protected] build_system=autotools arch=darwin-sonoma-m1
[+]          ^[email protected]%[email protected]+compat+opt build_system=autotools arch=darwin-sonoma-m1

However, if gcc from homebrew is used instead of the Spac-built gcc, the installation succeeds.

Error message

Error message from `spack install`
    'make' '-j8' '-s' 'CC=/Users/benc/source/spack/lib/spack/env/clang/clang' 'FC=/Users/benc/source/spack/lib/spack/env/clang/gfortran' 'MAKE_NB_JOBS=0' 'ARCH=arm64' 'DYNAMIC_ARCH=1' 'DYNAMIC_OLDER=1' 'TARGET=GENERIC' 'USE_LOCKING=1' 'USE_OPENMP=0' 'USE_THREAD=0' 'RANLIB=ranlib' 'all'

2 errors found in build log:
     15883    ld: warning: could not create compact unwind for _dlatm1_: register 73 saved somewhere other than in fram
              e
     15884    ld: warning: could not create compact unwind for _dlatm7_: registers 27 and 28 not saved contiguously in 
              frame
     15885    ld: warning: could not create compact unwind for _dlarnd_: register 73 saved somewhere other than in fram
              e
     15886    dyld[85710]: Library not loaded: @rpath/libgfortran.5.dylib
     15887      Referenced from: <9DA52310-D1B1-3F45-AE73-8A3E4AB796A6> /private/var/folders/xp/w69f58vs2cq4jt0fdgtqdd3
              80000gn/T/benc/spack-stage/spack-stage-openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/spack-src/utest/o
              penblas_utest
     15888      Reason: tried: '/Users/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.0/openblas-0.3.26-2x5s7g2ay
              tes443mk2w5btjetkmlzqhy/lib/libgfortran.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Us
              ers/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.0/openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzq
              hy/lib/libgfortran.5.dylib' (no such file), '/Users/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.
              0/openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/lib64/libgfortran.5.dylib' (no such file), '/System/Vo
              lumes/Preboot/Cryptexes/OS/Users/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.0/openblas-0.3.26-2
              x5s7g2aytes443mk2w5btjetkmlzqhy/lib64/libgfortran.5.dylib' (no such file), '/Users/benc/opt/spack-dev/dar
              win-sonoma-m1/apple-clang-15.0.0/openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/lib/libgfortran.5.dylib
              ' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/benc/opt/spack-dev/darwin-sonoma-m1/apple-c
              lang-15.0.0/openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/lib/libgfortran.5.dylib' (no such file), '/U
              sers/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.0/openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlz
              qhy/lib64/libgfortran.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/benc/opt/spack
              -dev/darwin-sonoma-m1/apple-clang-15.0.0/openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/lib64/libgfortr
              an.5.dylib' (no such file)
  >> 15889    make[1]: *** [Makefile:52: run_test] Abort trap: 6
  >> 15890    make: *** [Makefile:161: tests] Error 2
If I try to build manually, by going to the build directory, sourcing `spack-build-env.txt` and running `make`, I get a different error:
/Users/benc/source/spack/lib/spack/env/clang/gfortran -O2 -Wl,-ld_classic -Wall -frecursive -fno-optimize-sibling-calls -fPIC -march=armv8.3-a  -all_load -headerpad_max_install_names -install_name "/private/var/folders/xp/w69f58vs2cq4jt0fdgtqdd380000gn/T/benc/spack-stage/spack-stage-openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/spack-src/exports/../libopenblas.0.dylib" -dynamiclib -o ../libopenblas_vortexp-r0.3.26.dylib ../libopenblas_vortexp-r0.3.26.a -Wl,-exported_symbols_list,osx.def  -L/Users/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.0/gcc-13.2.0-iy3bmxiucyibn7qqfpcaaevfelrpdixq/lib/gcc/aarch64-apple-darwin23.3.0/13.2.0 -L/Users/benc/opt/spack-dev/darwin-sonoma-m1/apple-clang-15.0.0/gcc-13.2.0-iy3bmxiucyibn7qqfpcaaevfelrpdixq/lib/gcc/aarch64-apple-darwin23.3.0/13.2.0/../../..  -lgfortran -lemutls_w -lquadmath -lemutls_w -lSystem 
Undefined symbols for architecture arm64:
  "_LAPACKE_cbbcsd", referenced from:
     -exported_symbol[s_list] command line option
  "_LAPACKE_cbbcsd_work", referenced from:
     -exported_symbol[s_list] command line option
  "_LAPACKE_cbdsqr", referenced from:
     -exported_symbol[s_list] command line option
  "_LAPACKE_cbdsqr_work", referenced from:
     -exported_symbol[s_list] command line option
  "_LAPACKE_cgbbrd", referenced from:
     -exported_symbol[s_list] command line option
... (many more lines like this)
  "_zlatms_", referenced from:
     -exported_symbol[s_list] command line option
  "_zlatmt_", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:155: libopenblas_vortexp-r0.3.26.dylib] Error 1
make[1]: Leaving directory '/private/var/folders/xp/w69f58vs2cq4jt0fdgtqdd380000gn/T/benc/spack-stage/spack-stage-openblas-0.3.26-2x5s7g2aytes443mk2w5btjetkmlzqhy/spack-src/exports'
make: *** [Makefile:145: shared] Error 2

Information on your system

$ spack debug report
* **Spack:** 0.22.0.dev0 (fae6d3780fbf034390048d1fc706545ab83421f5)
* **Python:** 3.9.6
* **Platform:** darwin-sonoma-m1
* **Concretizer:** clingo

Additional information

Files attached. No maintainers returned.

spack-build-env.txt
spack-build-out.txt

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions