Member Site › Forums › Rosetta 3 › Rosetta 3 – Build/Install › compiler option not found
- This topic has 6 replies, 3 voices, and was last updated 2 years, 10 months ago by akhmelin.
-
AuthorPosts
-
-
December 8, 2021 at 6:28 pm #3881
Hi all,
I recently had to update my OSX command line tools and in doing so went from clang 12.0 to 13.0
I’m trying to compile Rosetta build 2021.16.61629 and am running into an issue. I was previously able to compile fine with clang v12.0.
As far as I can tell there seems to be an issue with the -rpath option, but that doesn’t make much sense. See the fail point and error messages below.
Not sure if this is a zlib issue given the fail point. As far as I can tell I have zlib installed properly.
clang++ -v -o build/external/release/macos/12.0/64/x86/clang/13.0/default/libzlib.dylib -dynamiclib -install_name /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.0/64/x86/clang/13.0/default/libzlib.dylib -stdlib=libc++ -Wl,-rpath=/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.0/64/x86/clang/13.0/default -Wl,-rpath=$ORIGIN -Wl,-rpath=$ORIGIN/../lib build/external/release/macos/12.0/64/x86/clang/13.0/default/dummy_zlib.os -Lexternal/lib -Lbuild/external/release/macos/12.0/64/x86/clang/13.0/default -Lexternal -L/usr/lib
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin21.1.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/ld” -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -dylib -arch x86_64 -dylib_install_name /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.0/64/x86/clang/13.0/default/libzlib.dylib -platform_version macos 12.0.0 12.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o build/external/release/macos/12.0/64/x86/clang/13.0/default/libzlib.dylib -Lexternal/lib -Lbuild/external/release/macos/12.0/64/x86/clang/13.0/default -Lexternal -L/usr/lib -L/usr/local/lib -rpath=/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.0/64/x86/clang/13.0/default “-rpath=$ORIGIN” “-rpath=$ORIGIN/../lib” build/external/release/macos/12.0/64/x86/clang/13.0/default/dummy_zlib.os -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.osx.a
ld: unknown option: -rpath=/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.0/64/x86/clang/13.0/default
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-
December 10, 2021 at 4:57 pm #16083Anonymous
(not an answer, but so you don’t feel ignored): We’ve been kicking this around on Slack and nobody knows. A few reports of “uh, I think I saw that once, I don’t remember how I fixed it, then it went away”.
-
December 10, 2021 at 7:52 pm #16084
Thanks for checking in Steven.
I’ve done a fair amount of googling and it seems like there are lots of examples of weird clang linker errors.
https://developer.apple.com/forums/thread/666700
Best I can understand is that there are some enviromental variables that are not being set/read right by the build system and it’s trying to pass info that just doesn’t work for the build system that is being used.
-
-
December 15, 2021 at 2:26 pm #16086
Made some progress but would love some suggestions on a fix.
Based on some info I found here:
https://forum.dlang.org/post/ueffisfpnwkypiimjjpo@forum.dlang.org
it sounds like
-rpath=/blah/blah/blah
Is not a valid input for mac’s ld linker. I made the change on the command line to
“-rpath” “/blah/blah/blah”
And it worked!
So that’s good, but the problem is I don’t know how to solve this at source. My guess is that something about the newer OSX/CommandLineTools is not recognized by the compiler settings for my version of Rosetta (2021.16.61629).
Is there a new commercial release planned, or can someone point me to the right settings file I need to change to make sure everything is properly recognized?
-
January 24, 2022 at 3:25 am #16108Anonymous
Any updates to this? Running into the same issue.
-
January 24, 2022 at 7:16 pm #16110Anonymous
Potential Solution but failed: I attempted to use an alternative version of clang to compile with. However, I still ran into the exact same error with clang v9 and clang v11. These are the steps I took below and received the exact same error as the initial post but with the alternative compiler being called.
My info:
MacOS: 12.1 (Monterey)
Default Clang with “xcode-select –install”: 13.0
Rosetta Version: rosetta_src_2021.16.61629
Step 1:
brew install llvm@11
Step 2:
# Modify user.settings
cd rosetta_xx/main/source
cp /tools/build/user.settings.template /tools/build/user.settings
vim tools/build/user.settings# Point to legacy clang under overrides
“overrides” : {
## Uncomment the following line to import the full operating system environment. Useful for
## compiling with scons on different systems.
#”ENV” : os.environ,
“cxx” : “/usr/local/opt/llvm@11/bin/clang++”,
“cc” : “/usr/local/opt/llvm@11/bin/clang”,
},
Step 3:
# Build without using cxx= or cxx_ver= | Here’s mine but with mpi as extras
./scons.py bin mode=release extras=mpi -j8
-
-
February 16, 2022 at 2:57 pm #16136
Bit more followup here.
I’m still unable to complete the compile, but have somewhat tracked down the issue.
The default built compile command gives me an error:
clang++ -v -o build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -dynamiclib -install_name /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -stdlib=libc++ -Wl,-rpath=/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default -Wl,-rpath=$ORIGIN -Wl,-rpath=$ORIGIN/../lib build/external/release/macos/12.2/64/x86/clang/13.0/default/dummy_zlib.os -Lexternal/lib -Lbuild/external/release/macos/12.2/64/x86/clang/13.0/default -Lexternal -L/usr/lib
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin21.3.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/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -dylib -arch x86_64 -dylib_install_name /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -platform_version macos 12.0.0 12.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -Lexternal/lib -Lbuild/external/release/macos/12.2/64/x86/clang/13.0/default -Lexternal -L/usr/lib -L/usr/local/lib -rpath=/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default "-rpath=$ORIGIN" "-rpath=$ORIGIN/../lib" build/external/release/macos/12.2/64/x86/clang/13.0/default/dummy_zlib.os -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.osx.a
ld: unknown option: -rpath=/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/defaultHowever a bit of adjustment of the command line to change from -rpath=/blah/blah/blah to “-rpath” “/blah/blah/blah” seems to work. I also have to get rid of the $ORIGIN containing sections:
This then at least “works” but scons doesn’t recognize it and won’t let me complete a comiple.
clang++ -v -o build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -dynamiclib -install_name /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -stdlib=libc++ -Wl,-rpath "/Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default" -Lexternal/lib -Lbuild/external/release/macos/12.2/64/x86/clang/13.0/default -Lexternal -L/usr/lib
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin21.3.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/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -dylib -arch x86_64 -dylib_install_name /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -platform_version macos 12.0.0 12.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o build/external/release/macos/12.2/64/x86/clang/13.0/default/libzlib.dylib -Lexternal/lib -Lbuild/external/release/macos/12.2/64/x86/clang/13.0/default -Lexternal -L/usr/lib -L/usr/local/lib -rpath /Users/benstranges/PROJECTS/rosetta_src_2021.16.61629_bundle/main/source/build/external/release/macos/12.2/64/x86/clang/13.0/default -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.osx.aAnyone have any ideas how to adjust my build settings to get this to work?
-
-
AuthorPosts
- You must be logged in to reply to this topic.