[MacPorts] #74336: OpenBLAS fails to build on 10.13 High Sierra

MacPorts noreply at macports.org
Sat Aug 22 17:43:42 UTC 2026


#74336: OpenBLAS fails to build on 10.13 High Sierra
------------------------+-------------------------------
  Reporter:  JohnFHall  |      Owner:  (none)
      Type:  defect     |     Status:  assigned
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.12.5
Resolution:             |   Keywords:  highsierra X86_64
      Port:  openBLAS   |
------------------------+-------------------------------

Comment (by JULWAL1):

 This a *manual* "workaround" solution…\\
 (ignore the Terminal app prompts $ and #)

 Install or upgrade as normal:

 {{{$ sudo port install OpenBLAS}}} or {{{$ sudo port upgrade OpenBLAS}}}


 You should get the Linking error at 82% like this:


 {{{
 :info:build [ 82%] Linking Fortran shared library lib/libopenblas.dylib
 :info:build /opt/local/bin/cmake -E cmake_link_script
 CMakeFiles/openblas_shared.dir/link.txt --verbose=ON
 :info:build collect2: fatal error: posix_spawnp: Argument list too long
 :info:build compilation terminated.
 :info:build /opt/local/bin/gfortran-mp-15 -pipe -Os -m64  -fPIC -mmacosx-
 version-min=10.12 -dynamiclib -Wl,-headerpad_max_install_names
 -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64
 -current_version 0.3.0 -o lib/libopenblas.0.3.dylib -install_name
 @rpath/libopenblas.0.dylib @CMakeFiles/openblas_shared.dir/objects1.rsp
 @CMakeFiles/openblas_shared.dir/objects2.rsp
 @CMakeFiles/openblas_shared.dir/objects3.rsp
 @CMakeFiles/openblas_shared.dir/objects4.rsp
 @CMakeFiles/openblas_shared.dir/linkLibs.rsp
 :info:build make[2]: *** [lib/libopenblas.0.3.dylib] Error 1
 :info:build make[2]: Leaving directory `/opt/local/var/macports/build
 /OpenBLAS-383854d5/work/build'
 :info:build make[1]: *** [CMakeFiles/openblas_shared.dir/all] Error 2
 :info:build make[1]: Leaving directory `/opt/local/var/macports/build
 /OpenBLAS-383854d5/work/build'
 :info:build make: *** [all] Error 2
 :info:build make: Leaving directory `/opt/local/var/macports/build
 /OpenBLAS-383854d5/work/build'
 :info:build Command failed:  cd "/opt/local/var/macports/build/OpenBLAS-
 383854d5/work/build" && /usr/bin/make -w all VERBOSE=ON
 :info:build Exit code: 2

 }}}


 To resolve this and successfully finish the upgrade / install, I did the
 following for macOS Sierra and then for macOS Catalina:

 {{{
 $ cd /opt/local/var/macports/build/OpenBLAS-*/work/
 }}}
 (or use:  {{{cd $(port work OpenBLAS}}})

 {{{
 $ pwd
 /opt/local/var/macports/build/OpenBLAS-383854d5/work
 }}}

 {{{
 $ ls -al
 total 23592
 drwxr-xr-x    9 macports  wheel       306 22 Aug 14:17 .
 drwxr-xr-x    3 macports  wheel       102 22 Aug 09:34 ..
 -rw-r--r--    1 macports  wheel  12071496 22 Aug 10:09 .CC_PRINT_OPTIONS
 drwxr-xr-x    2 macports  wheel        68 22 Aug 09:34 .home
 -rw-r--r--    1 macports  wheel       320 22 Aug 14:17
 .macports.OpenBLAS.state
 drwxr-xr-x    2 macports  wheel        68 22 Aug 10:09 .tmp
 drwxr-xr-x  146 macports  wheel      4964 16 Jul 20:53 OpenBLAS-0.3.34
 drwxr-xr-x   34 macports  wheel      1156 22 Aug 14:17 build
 }}}
 {{{
 $ sudo -s
 }}}

 {{{
 # cd build
 }}}

 {{{
 # pwd
 /opt/local/var/macports/build/OpenBLAS-383854d5/work/build
 }}}

 {{{
 # cat CMakeFiles/openblas_shared.dir/objects*.rsp | xargs -n 50 ar rcs
 libopenblas_full.a
 /opt/local/bin/ranlib: file: libopenblas_full.a(xerbla.c.o) has no symbols
 …
 (repeats)
 …
 /opt/local/bin/ranlib: file: libopenblas_full.a(la_constants.f90.o) has no
 symbols
 …
 (repeats)
 …
 }}}

 {{{
 # ranlib libopenblas_full.a
 ranlib: file: libopenblas_full.a(la_constants.f90.o) has no symbols
 }}}

 For Sierra:

 {{{
 # /opt/local/bin/gfortran-mp-15 -pipe -Os -m64 -fPIC -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -mmacosx-version-
 min=10.12 -dynamiclib -o lib/libopenblas.0.3.dylib -install_name
 @rpath/libopenblas.0.dylib -Wl,-all_load libopenblas_full.a
 @CMakeFiles/openblas_shared.dir/linkLibs.rsp
 }}}

 For Catalina:

 {{{
 # /opt/local/bin/gfortran-mp-15 -pipe -Os -m64 -fPIC -isysroot
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -mmacosx-version-
 min=10.15 -dynamiclib -o lib/libopenblas.0.3.dylib -install_name
 @rpath/libopenblas.0.dylib -Wl,-all_load libopenblas_full.a
 @CMakeFiles/openblas_shared.dir/linkLibs.rsp
 }}}

 Check it created: libopenblas.0.3.dylib  with ~12.5 MB in size:

 {{{
 # ls -alh lib/libopenblas.0.3.dylib
 -rwxr-xr-x  1 root  wheel    12M 22 Aug 15:25 lib/libopenblas.0.3.dylib
 }}}

 Create the two missing symlinks:

 {{{
 # ln -sf libopenblas.0.3.dylib lib/libopenblas.0.dylib

 # ln -sf libopenblas.0.3.dylib lib/libopenblas.dylib
 }}}

 Confirm they link to the original:

 {{{
 # ls -alh lib/libopenblas*.dylib
 -rwxr-xr-x  1 root  wheel    12M 22 Aug 15:25 lib/libopenblas.0.3.dylib
 lrwxr-xr-x  1 root  wheel    21B 22 Aug 15:25 libopenblas.0.dylib ->
 libopenblas.0.3.dylib
 lrwxr-xr-x  1 root  wheel    21B 22 Aug 15:25 libopenblas.dylib ->
 libopenblas.0.3.dylib
 }}}


 {{{
 # cd ..
 }}}


 {{{
 # pwd
 /opt/local/var/macports/build/OpenBLAS-383854d5/work
 }}}

 Freshen the .macports.OpenBLAS.state file:

 {{{
 # touch .macports.OpenBLAS.state
 }}}


 Fool MacPorts that the build phase is done:

 {{{
 # echo "target: org.macports.build" >> .macports.OpenBLAS.state
 }}}


 Verify:

 {{{
 # cat .macports.OpenBLAS.state
 version: 2
 checksum: f7ffebed6576f4de735542bc9009ac0be372fc941a5b60f79161ac79d29207d0
 variant: +gcc15
 variant: +lapack
 target: org.macports.fetch
 target: org.macports.checksum
 target: org.macports.extract
 target: org.macports.patch
 target: org.macports.configure
 target: org.macports.build
 }}}

 {{{
 # exit
 }}}


 Complete the destroot stage:

 {{{
 $ sudo sudo port destroot OpenBLAS
 --->  Upgrading already installed dependencies of OpenBLAS
 --->  Computing dependencies for OpenBLAS
 --->  Staging OpenBLAS into destroot
 }}}

 Verify:

 {{{
 $ cat
 /opt/local/var/macports/build/OpenBLAS-*/work/.macports.OpenBLAS.state
 version: 2
 checksum: f7ffebed6576f4de735542bc9009ac0be372fc941a5b60f79161ac79d29207d0
 variant: +gcc15
 variant: +lapack
 target: org.macports.fetch
 target: org.macports.checksum
 target: org.macports.extract
 target: org.macports.patch
 target: org.macports.configure
 target: org.macports.build
 target: org.macports.destroot
 }}}


 {{{
 $ ls -alRh /opt/local/var/macports/build/OpenBLAS-*/work/destroot
 }}}

 Make sure you can see the following sub-folders and dylib files in the
 destroot folder:
 {{{
 /opt/local/include
 /opt/local/include/openblas
 /opt/local/lib
 /opt/local/lib/libopenblas.0.3.dylib
 /opt/local/lib/libopenblas.0.dylib
 /opt/local/lib/libopenblas.dylib
 /opt/local/lib/cmake
 /opt/local/lib/cmake/OpenBLAS
 /opt/local/lib/pkgconfig
 }}}


 Finish the install phase:
 (-k to keep the work directory if you need to)

 {{{
 $ sudo port -k install OpenBLAS
 --->  Computing dependencies for OpenBLAS
 --->  Scanning binaries for linking errors
 --->  No broken files found.
 --->  No broken ports found.
 }}}

 Verify OpenBLAS installed successfully:

 {{{
 $ port installed openBLAS
 The following ports are currently installed:
   OpenBLAS @0.3.33_1+gcc15+lapack
   OpenBLAS @0.3.34_0+gcc15+lapack (active)
 }}}

 To view the contents of OpenBLAS:

 {{{
 $ port contents OpenBLAS
 Port OpenBLAS @0.3.34_0+gcc15+lapack contains:
   /opt/local/include/cblas_openblas.h
   /opt/local/include/f77blas.h
   /opt/local/include/lapack.h
   /opt/local/include/lapacke.h
   /opt/local/include/lapacke_config.h
   /opt/local/include/lapacke_example_aux.h
   /opt/local/include/lapacke_mangling.h
   /opt/local/include/lapacke_utils.h
   /opt/local/include/openblas/cblas.h
   /opt/local/include/openblas/f77blas.h
   /opt/local/include/openblas/lapack.h
   /opt/local/include/openblas/lapacke.h
   /opt/local/include/openblas/lapacke_config.h
   /opt/local/include/openblas/lapacke_example_aux.h
   /opt/local/include/openblas/lapacke_mangling.h
   /opt/local/include/openblas/lapacke_utils.h
   /opt/local/include/openblas/openblas_config.h
   /opt/local/include/openblas_config.h
   /opt/local/lib/cmake/OpenBLAS/OpenBLASConfig.cmake
   /opt/local/lib/cmake/OpenBLAS/OpenBLASConfigVersion.cmake
   /opt/local/lib/cmake/OpenBLAS/OpenBLASTargets-macports.cmake
   /opt/local/lib/cmake/OpenBLAS/OpenBLASTargets.cmake
   /opt/local/lib/libopenblas.0.3.dylib
   /opt/local/lib/libopenblas.0.dylib
   /opt/local/lib/libopenblas.dylib
   /opt/local/lib/pkgconfig/openblas.pc
 }}}

 Double-check the dylib and symlinks installed ok:

 {{{
 $ ls -lh /opt/local/lib/libopenblas*.dylib
 -rwxr-xr-x  1 root  wheel    12M 22 Aug 15:46
 /opt/local/lib/libopenblas.0.3.dylib
 lrwxr-xr-x  1 root  wheel    21B 22 Aug 15:46
 /opt/local/lib/libopenblas.0.dylib -> libopenblas.0.3.dylib
 lrwxr-xr-x  1 root  wheel    21B 22 Aug 15:46
 /opt/local/lib/libopenblas.dylib -> libopenblas.0.3.dylib
 }}}

 Some diagnostic info:

 {{{
 $ otool -L /opt/local/lib/libopenblas.0.3.dylib
 /opt/local/lib/libopenblas.0.3.dylib:
         /opt/local/lib/libopenblas.0.dylib (compatibility version 0.0.0,
 current version 0.0.0)
         @rpath/libgfortran.5.dylib (compatibility version 6.0.0, current
 version 6.0.0)
         @rpath/libgcc_s.1.1.dylib (compatibility version 1.0.0, current
 version 1.1.0)
         @rpath/libquadmath.0.dylib (compatibility version 1.0.0, current
 version 1.0.0)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
 version 1252.0.0)

 $ nm -gU /opt/local/lib/libopenblas.0.3.dylib | grep -i dgesv
 00000000008f5600 T _LAPACKE_dgesv
 00000000008f56d0 T _LAPACKE_dgesv_work
 00000000008f5930 T _LAPACKE_dgesvd
 00000000008f5ad0 T _LAPACKE_dgesvd_work
 00000000008f60b0 T _LAPACKE_dgesvdq
 00000000008f62b0 T _LAPACKE_dgesvdq_work
 00000000008f6960 T _LAPACKE_dgesvdx
 00000000008f6b90 T _LAPACKE_dgesvdx_work
 00000000008f7130 T _LAPACKE_dgesvj
 00000000008f7300 T _LAPACKE_dgesvj_work
 00000000008f76f0 T _LAPACKE_dgesvx
 00000000008f7960 T _LAPACKE_dgesvx_work
 000000000003c590 T _dgesv_
 00000000004b4378 T _dgesvd_
 0000000000594a29 T _dgesvdq_
 00000000004bb852 T _dgesvdx_
 000000000056d5d1 T _dgesvj_
 00000000004bd468 T _dgesvx_

 $ nm -gU /opt/local/lib/libopenblas.0.3.dylib | grep -E
 "openblas_get_num_threads|openblas_get_parallel"
 0000000000227b60 T _openblas_get_num_threads
 0000000000229d80 T _openblas_get_num_threads_
 0000000000227970 T _openblas_get_parallel
 0000000000227980 T _openblas_get_parallel_
 }}}


 Note: If you have the previous version of OpenBLAS installed, then you can
 run the three diagnostic commands (above) BEFORE upgrading and make a note
 of the Terminal output/results.

 Then upgrade/install and run the diagnostic commands afterwards and check
 that the output is similar.

 Hope this helps (and can be of use to the OpenBLAS developers to fix it
 properly).



 ----


 **Question:** Is there a quick way for me to check or test that the port
 in question is actually working correctly??

 Also, when I run:
 {{{
 python3 -c "import numpy as np; np.show_config()"
 Build Dependencies:
   blas:
     detection method: pkgconfig
     found: true
     include directory: /opt/local/include/openblas
     lib directory: /opt/local/lib
     name: openblas
     openblas configuration: USE_64BITINT= NO_CBLAS= NO_LAPACK= NO_LAPACKE=
 DYNAMIC_ARCH=OFF
       DYNAMIC_OLDER=OFF NO_AFFINITY=1 USE_OPENMP= NEHALEM MAX_THREADS=56
     pc file directory: /opt/local/lib/pkgconfig
     version: 0.3.33
   lapack:
     detection method: pkgconfig
     found: true
     include directory: /opt/local/include/openblas
     lib directory: /opt/local/lib
     name: openblas
     openblas configuration: USE_64BITINT= NO_CBLAS= NO_LAPACK= NO_LAPACKE=
 DYNAMIC_ARCH=OFF
       DYNAMIC_OLDER=OFF NO_AFFINITY=1 USE_OPENMP= NEHALEM MAX_THREADS=56
     pc file directory: /opt/local/lib/pkgconfig
     version: 0.3.33
 ...
 ...
 ...
 }}}

 it still shows the previous version - Do I have to re-install py313-numpy
 to get it to register the upgraded version??

-- 
Ticket URL: <https://trac.macports.org/ticket/74336#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list