Opened 2 years ago

#65794 new defect

gcc12 -universal on x86_64 installs dylibs built for arm64

Reported by: ShadSterling (Shad Sterling) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc:
Port: gcc12

Description

It looks like a bunch of libraries in /opt/local/lib/gcc12/ are for arm64 only when they should at least include x86_64

I discovered this by attempting to update R +builtin_lapack, which failed to build with

:info:build make[4]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_R/R/work/R-4.2.1/src/library/grDevices'
:info:build byte-compiling package 'grDevices'
:info:build Warning in solve.default(rgb) :
:info:build   unable to load shared object '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_R/R/work/R-4.2.1/modules//lapack.so':
:info:build   dlopen(/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_R/R/work/R-4.2.1/modules//lapack.so, 0x0006): symbol not found in flat namespace (__gfortran_concat_string)
:info:build Error in solve.default(rgb) : LAPACK routines cannot be loaded
:info:build Error: unable to load R code in package 'grDevices'

because earlier in the log building libRlapack.dylib failed with

:info:build /opt/local/bin/clang-mp-14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -fopenmp -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -a
rch x86_64 -o libRlapack.dylib dlamch.o dlapack.o cmplx.o  -install_name libRlapack.dylib -compatibility_version 4.2.0 -current_version 4.2.1  -headerpad_max_install_names -L"../../../lib" -lRblas -L/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.2.0 -L/opt/local/lib/gcc12 -lgfortran -lquadmath  -L"../../../lib" 
-lR
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build #ar -cr libRlapack.dylib dlamch.o dlapack.o cmplx.o 

Trying to work around that by switching to R +openblas, building openblas +native-universal fails with

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local/bin/gfortran-mp-12 -Os -m64 -O3 -m128bit-long-double -Wall -frecursive -fno-optimize-sibling-calls -m64  -msse3 -mssse3 -msse4.1 -mavx -mavx2
 -mavx2 -O3 -m128bit-long-double -Wall -frecursive -fno-optimize-sibling-calls -m64  -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mavx2 -fno-tree-vectorize -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -
o zblat3 zblat3.o ../libopenblas-r1.a -lpthread -lgfortran -lpthread -lgfortran 
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgfortran.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libgcc_s.1.1.dylib, file is universal (arm64) but does not contain the x86_64 architecture: /opt/local/lib/gcc12/libgcc_s.1.1.dylib
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build ld: warning: ignoring file /opt/local/lib/gcc12/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
:info:build Undefined symbols for architecture x86_64:
:info:build   "__gfortran_set_args", referenced from:
:info:build       _main in sblat1.o
:info:build   "__gfortran_set_options", referenced from:
:info:build       _main in sblat1.o
:info:build   "__gfortran_st_write", referenced from:
:info:build       _itest1_.part.0 in sblat1.o
:info:build       _stest_.constprop.0 in sblat1.o
:info:build       _stest_ in sblat1.o
:info:build       _check3_ in sblat1.o
:info:build       _check2_ in sblat1.o
:info:build       _check1_ in sblat1.o
:info:build       _check0_ in sblat1.o
:info:build       ...
:info:build   "__gfortran_st_write_done", referenced from:
:info:build       _itest1_.part.0 in sblat1.o
:info:build       _stest_.constprop.0 in sblat1.o
:info:build       _stest_ in sblat1.o
:info:build       _check3_ in sblat1.o
:info:build       _check2_ in sblat1.o
:info:build       _check1_ in sblat1.o
:info:build       _check0_ in sblat1.o
:info:build       ...
:info:build   "__gfortran_stop_string", referenced from:
:info:build       _check3_ in sblat1.o
:info:build       _check2_ in sblat1.o
:info:build       _check1_ in sblat1.o
:info:build       _check0_ in sblat1.o
:info:build       _MAIN__ in sblat1.o
:info:build   "__gfortran_transfer_character_write", referenced from:
:info:build       _check3_ in sblat1.o
:info:build       _check2_ in sblat1.o
:info:build       _check1_ in sblat1.o
:info:build       _check0_ in sblat1.o
:info:build       _MAIN__ in sblat1.o
:info:build       _header_ in sblat1.o
:info:build   "__gfortran_transfer_integer_write", referenced from:
:info:build       _itest1_.part.0 in sblat1.o
:info:build       _stest_.constprop.0 in sblat1.o
:info:build       _stest_ in sblat1.o
:info:build       _MAIN__ in sblat1.o
:info:build       _header_ in sblat1.o
:info:build   "__gfortran_transfer_real_write", referenced from:
:info:build       _stest_.constprop.0 in sblat1.o
:info:build       _stest_ in sblat1.o
:info:build ld: symbol(s) not found for architecture x86_64

Attachments (2)

R.main.log (502.8 KB) - added by ShadSterling (Shad Sterling) 2 years ago.
OpenBLAS.main.log (8.1 MB) - added by ShadSterling (Shad Sterling) 2 years ago.

Change History (2)

Changed 2 years ago by ShadSterling (Shad Sterling)

Attachment: R.main.log added

Changed 2 years ago by ShadSterling (Shad Sterling)

Attachment: OpenBLAS.main.log added
Note: See TracTickets for help on using tickets.