-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: build failure with Xcode 15 linker #24964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @adamjstewart. Could you add the contents of
I think that that shows why OpenBLAS gets rejected. |
That's the neat part, this file doesn't exist 😄 |
I have git clean -xdf
pip install scipy_openblas32==0.3.23.293.1
export LDFLAGS=-Wl,-ld_classic
spin build --with-scipy-openblas=32 works for me on Sonoma. If I don't use Have you tried setting PKG_CONFIG_PATH to the location of the OpenBLAS pkgconfig file? |
@andyfaff it works because you're using the old linker. If you don't override
See the "build env" file.
|
Oh yes, this is a continual pain. You can preserve it by adding
Adam's build explicitly uses |
Thanks for the tip! Here's the meson log: meson-log.txt Also: > otool -L /Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/lib/libopenblas.dylib
/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/lib/libopenblas.dylib:
/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/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/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 1336.0.0) |
Okay, so
If that does work with the classic linker, then I guess it's a linker problem indeed. The check works fine for me with the XCode 15 The check is: #ifdef __cplusplus
extern "C" {
#endif
void dgemm_();
void cblas_dgemm();
int main(int argc, const char *argv[])
{
dgemm_();
cblas_dgemm();
return 0;
}
#ifdef __cplusplus
}
#endif Maybe that standalone test helps? It should build with clang++ testfile.cpp -o testfile -I/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/include -L/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/lib -lopenblas Did you build |
Yes, Spack-installed gfortran and openblas from source. |
Yes, that testfile.cpp example fails for me: > clang++ testfile.cpp -o testfile -I/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/include -L/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/lib -lopenblas -v
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx14.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name testfile.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=14.0 -fvisibility-inlines-hidden-static-local-var -target-cpu apple-m1 -target-feature +v8.5a -target-feature +crc -target-feature +lse -target-feature +rdm -target-feature +crypto -target-feature +dotprod -target-feature +fp-armv8 -target-feature +neon -target-feature +fp16fml -target-feature +ras -target-feature +rcpc -target-feature +zcm -target-feature +zcz -target-feature +fullfp16 -target-feature +sm4 -target-feature +sha3 -target-feature +sha2 -target-feature +aes -target-abi darwinpcs -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=lldb -target-linker-version 1015.6 -v -fcoverage-compilation-dir=/Users/Adam/Downloads -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I /Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/include -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -fdebug-compilation-dir=/Users/Adam/Downloads -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -fcolor-diagnostics -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/folders/jv/cgkfvslj6nq1l7cw0c8c_8gm0000gn/T/testfile-bf393f.o -x c++ testfile.cpp
clang -cc1 version 15.0.0 (clang-1500.0.40.1) default target arm64-apple-darwin23.0.0
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch arm64 -platform_version macos 14.0.0 14.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o testfile -L/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/lib -L/usr/local/lib /var/folders/jv/cgkfvslj6nq1l7cw0c8c_8gm0000gn/T/testfile-bf393f.o -lopenblas -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a
ld: duplicate LC_RPATH '/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/gcc-13.2.0-qhn4xdjhn2p7k2fnvllfz2ca6xhwl2yu/lib' in '/Users/Adam/spack/opt/spack/darwin-sonoma-m2/apple-clang-15.0.0/openblas-0.3.24-lsn4jcy34p62ysj7qq2ghlsawu6sco6a/lib/libopenblas-r0.3.24.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation) |
Can you add
so we can see the symbols are actually present? |
Other request: objects.txt |
That looks the same as what I see on my machine:
I think this is a good place to stop, since I don't think there's much of a downside in adding the linker flag to use the classic linker, and revisiting once the new linker is a bit more mature. |
I've also had this issue on an ubuntu machine when installing numpy using pypy. I found a fix elsewhere, I no longer remember where, of pip install numpy --config-settings=setup-args="-Dallow-noblas=true", which fixes the issue for me |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
I'm unable to build numpy 1.26.1 with the new linker added in Xcode 15. However, adding the following allows the build to work:
export LDFLAGS=-Wl,-ld_classic
Reproduce the code example:
Error message:
Runtime information:
Numpy 1.26.1
Python 3.11.6
OpenBLAS 0.3.24
Context for the issue:
Possibly related to scipy/scipy#19357
@rgommers
The text was updated successfully, but these errors were encountered: