Building problems on OSX amd64

Hey guys,
Tried to compile Odin using LLVM 17.6 and then upgraded to 19.6.1 and in both cased I am getting:

./build_odin.sh

  • clang++ src/main.cpp src/libtommath.cpp -Wno-switch -Wno-macro-redefined -Wno-unused-value ‘-DODIN_VERSION_RAW=“dev-2024-12”’ ‘-DGIT_SHA=“ad99d20d2”’ -std=c++14 -I/usr/local/Cellar/llvm/19.1.6/include -std=c++17 -stdlib=libc++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -L/usr/local/Cellar/llvm/19.1.6/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names --sysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -g -pthread -lm -lstdc++ -liconv -ldl -framework System -lLLVM -o odin
    In file included from src/main.cpp:71:
    In file included from src/checker.cpp:3870:
    src/check_expr.cpp:3598:30: warning: ‘&&’ within ‘||’ [-Wlogical-op-parentheses]
    is_type_integer(src_t) && is_type_bit_set(dst_t)) {
    ~^~~
    src/check_expr.cpp:3598:30: note: place parentheses around the ‘&&’ expression to silence this warning
    is_type_integer(src_t) && is_type_bit_set(dst_t)) {
    ^
    ( )
    1 warning generated.
  • set +x
    Undefined symbols for architecture x86_64:
    “___ulock_wait2”, referenced from:
    _sync._futex_wait_with_timeout-2216 in demo.o
    ld: symbol(s) not found for architecture x86_64

I can see in demo.o the reference:

strip demo.o 2>&1 | grep ‘ulock_wait2’
___ulock_wait

Any ideas? Thank you,
SorinS

1 Like

Are you on a macOS version < 11? If so you must compile Odin programs with -minimum-os-version:x.x where x.x is your version of macOS. We default to targeting macOS 11.

Sidenote, the compilation did actually work there, it just tried running the demo and failed that, so you should have a working compiler at that point.

Thank you for your response. I am on Sequoia 15.2 (i7 mac mini 2018). True that just the demo failed, so no biggie, just thought it would be useful to flag the issue although not that many people are using amd64 Macs anymore…
Happy New Year!

Oh that is strange. ulock_wait2 is supposed to be available from macOS 11 onwards. Definitely something to look into then.

Happy new year to you too!