MacOS: build-runtime fails #116

Closed
opened 2023-09-17 04:53:43 +00:00 by SethArchambault · 8 comments

When running the install instructions, came across this error, with a not very helpful error message!

$ ./orca dev build-runtime

Downloading ANGLE...
Extracting ANGLE...
Verifying ANGLE download...
Building Orca platform layer...
clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument]
ld: warning: directory not found for option '-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib'
ld: warning: directory not found for option '-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/'
ld: library not found for -lc
ERROR: The following command failed with code 1:
ld -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ -dylib -o build/bin/liborca.dylib build/orca_c.o build/orca_objc.o -Lsrc/ext/angle/bin -lc -framework Carbon -framework Cocoa -framework Metal -framework QuartzCore -weak-lEGL -weak-lGLESv2

Task failed with 1 error:
ERROR: The following command failed with code 1:
ld -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ -dylib -o build/bin/liborca.dylib build/orca_c.o build/orca_objc.o -Lsrc/ext/angle/bin -lc -framework Carbon -framework Cocoa -framework Metal -framework QuartzCore -weak-lEGL -weak-lGLESv2

Any idea what to do here? Here's some more details:

Macbook Pro 16-inch, 2021
MacOS 13.5.2
Python 3.11.3
Apple clang version 14.0.0 (clang-1400.0.29.202)
When running the install instructions, came across this error, with a not very helpful error message! ``` $ ./orca dev build-runtime Downloading ANGLE... Extracting ANGLE... Verifying ANGLE download... Building Orca platform layer... clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument] ld: warning: directory not found for option '-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib' ld: warning: directory not found for option '-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/' ld: library not found for -lc ERROR: The following command failed with code 1: ld -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ -dylib -o build/bin/liborca.dylib build/orca_c.o build/orca_objc.o -Lsrc/ext/angle/bin -lc -framework Carbon -framework Cocoa -framework Metal -framework QuartzCore -weak-lEGL -weak-lGLESv2 Task failed with 1 error: ERROR: The following command failed with code 1: ld -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ -dylib -o build/bin/liborca.dylib build/orca_c.o build/orca_objc.o -Lsrc/ext/angle/bin -lc -framework Carbon -framework Cocoa -framework Metal -framework QuartzCore -weak-lEGL -weak-lGLESv2 ``` Any idea what to do here? Here's some more details: ``` Macbook Pro 16-inch, 2021 MacOS 13.5.2 Python 3.11.3 Apple clang version 14.0.0 (clang-1400.0.29.202) ```

Ah just noticed the note about clang, but the instructions for resolving that don't work:

brew install clang
Warning: No available formula with the name "clang". Did you mean clean, cln, cling, vlang, clingo or clac?

Looks like installing llvm via homebrew is the way to install clang? Trying that now..

Ah just noticed the note about clang, but the instructions for resolving that don't work: ``` brew install clang Warning: No available formula with the name "clang". Did you mean clean, cln, cling, vlang, clingo or clac? ``` Looks like installing llvm via homebrew is the way to install clang? Trying that now..
Owner

Hm, you should be able to build the runtime itself using Apple's clang. It seems like maybe you are missing the full set of Xcode command-line tools or I am just looking in the wrong place for them.

Can you confirm if you have /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk on your computer?

Hm, you should be able to build the runtime itself using Apple's clang. It seems like maybe you are missing the full set of Xcode command-line tools or I am just looking in the wrong place for them. Can you confirm if you have `/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk` on your computer?
bvisness added the
macOS
label 2023-09-17 14:58:37 +00:00
bvisness self-assigned this 2023-09-17 15:45:31 +00:00

Indeed it's not there:

ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
ls: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk: No such file or directory

I use Xcode for my job as a mobile developer so I should have everything.

Ah I see the directory you are looking for is here:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib

Indeed it's not there: ``` ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk ls: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk: No such file or directory ``` I use Xcode for my job as a mobile developer so I should have everything. Ah I see the directory you are looking for is here: `/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib`

Made this change:

diff --git a/scripts/dev.py b/scripts/dev.py
index 1c17698..7ca47c7 100644
--- a/scripts/dev.py
+++ b/scripts/dev.py
@@ -151,7 +151,7 @@ def build_platform_layer_lib_win(release):
     ], check=True)

 def build_platform_layer_lib_mac(release):
-    sdk_dir = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
+    sdk_dir = "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk"

     flags = ["-mmacos-version-min=10.15.4", "-maes"]
     cflags = ["-std=c11"]

Hmm, I wonder if it's labelled like this since I recently updated MacOS to 13.5.2, but command line tools are from a prior version? Maybe I need to manually update those..

And it completed with some warnings:

./orca dev build-runtime

Building Orca platform layer...
clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument]
Building wasm3...
Building Orca runtime...
clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument]
ld: warning: object file (build/lib/libwasm3.a(m3_api_wasi.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_core.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_api_tracer.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_function.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_code.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_api_uvwasi.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_api_meta_wasi.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_compile.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_exec.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_env.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_api_libc.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_parse.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_bind.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_info.o)) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: object file (build/lib/libwasm3.a(m3_module.o)) was built for newer macOS version (13.0) than being linked (11.0)
Task completed successfully.

Looks like it's working!

$ orca --version
The Orca tool is running from a local source checkout and will
use that instead of the system Orca installation.

dev-bd780b2
Orca is running from a source checkout.
Source dir: /Users/.../..../../myproject/orca
Made this change: ``` diff --git a/scripts/dev.py b/scripts/dev.py index 1c17698..7ca47c7 100644 --- a/scripts/dev.py +++ b/scripts/dev.py @@ -151,7 +151,7 @@ def build_platform_layer_lib_win(release): ], check=True) def build_platform_layer_lib_mac(release): - sdk_dir = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" + sdk_dir = "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk" flags = ["-mmacos-version-min=10.15.4", "-maes"] cflags = ["-std=c11"] ``` Hmm, I wonder if it's labelled like this since I recently updated MacOS to 13.5.2, but command line tools are from a prior version? Maybe I need to manually update those.. And it completed with some warnings: ``` ./orca dev build-runtime Building Orca platform layer... clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument] Building wasm3... Building Orca runtime... clang: warning: argument unused during compilation: '-maes' [-Wunused-command-line-argument] ld: warning: object file (build/lib/libwasm3.a(m3_api_wasi.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_core.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_api_tracer.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_function.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_code.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_api_uvwasi.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_api_meta_wasi.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_compile.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_exec.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_env.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_api_libc.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_parse.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_bind.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_info.o)) was built for newer macOS version (13.0) than being linked (11.0) ld: warning: object file (build/lib/libwasm3.a(m3_module.o)) was built for newer macOS version (13.0) than being linked (11.0) Task completed successfully. ``` Looks like it's working! ``` $ orca --version The Orca tool is running from a local source checkout and will use that instead of the system Orca installation. dev-bd780b2 Orca is running from a source checkout. Source dir: /Users/.../..../../myproject/orca ```
Owner

Gotcha, thanks for looking into that. I guess I'll have to investigate how Apple installs the macOS SDKs and beef up the script. Sorry for the trouble!

Gotcha, thanks for looking into that. I guess I'll have to investigate how Apple installs the macOS SDKs and beef up the script. Sorry for the trouble!

@bvisness Ah yep, after running xcode-select --install, now my /Library/Developer/CommandLineTools/SDKs folder looks like this:

lrwxr-xr-x  1 root  wheel   14 Sep 17 12:37 MacOSX.sdk -> MacOSX13.3.sdk
drwxr-xr-x  7 root  wheel  224 Jul 30  2022 MacOSX12.1.sdk
drwxr-xr-x  7 root  wheel  224 Sep 17 12:37 MacOSX12.3.sdk
lrwxr-xr-x  1 root  wheel   14 Sep 17 12:36 MacOSX12.sdk -> MacOSX12.3.sdk
drwxr-xr-x  7 root  wheel  224 Nov 12  2022 MacOSX13.1.sdk
drwxr-xr-x  7 root  wheel  224 Mar  9  2023 MacOSX13.3.sdk
lrwxr-xr-x  1 root  wheel   14 Sep 17 12:36 MacOSX13.sdk -> MacOSX13.3.sdk

And running ./orca dev build-runtime builds with no problem!

Just tried out the examples - this is awesome - Thanks!

@bvisness Ah yep, after running `xcode-select --install`, now my /Library/Developer/CommandLineTools/SDKs folder looks like this: ``` lrwxr-xr-x 1 root wheel 14 Sep 17 12:37 MacOSX.sdk -> MacOSX13.3.sdk drwxr-xr-x 7 root wheel 224 Jul 30 2022 MacOSX12.1.sdk drwxr-xr-x 7 root wheel 224 Sep 17 12:37 MacOSX12.3.sdk lrwxr-xr-x 1 root wheel 14 Sep 17 12:36 MacOSX12.sdk -> MacOSX12.3.sdk drwxr-xr-x 7 root wheel 224 Nov 12 2022 MacOSX13.1.sdk drwxr-xr-x 7 root wheel 224 Mar 9 2023 MacOSX13.3.sdk lrwxr-xr-x 1 root wheel 14 Sep 17 12:36 MacOSX13.sdk -> MacOSX13.3.sdk ``` And running `./orca dev build-runtime` builds with no problem! Just tried out the examples - this is awesome - Thanks!
Collaborator

@bvisness Maybe we could just check the existence of the SDK folder in the build script and suggest people use xcode-select --install if they're not there?
The warnings should be fixed now (as part of #135)

@bvisness Maybe we could just check the existence of the SDK folder in the build script and suggest people use `xcode-select --install` if they're not there? The warnings should be fixed now (as part of #135)
Owner

Yes, I think that would be reasonably easy and would hopefully work well.

Yes, I think that would be reasonably easy and would hopefully work well.
Sign in to join this conversation.
No Label
macOS
windows
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hmn/orca#116
No description provided.