From cd1d1f43ed31d295a79e57f7e1d33c00e881f935 Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Sun, 12 Apr 2026 22:06:33 -0400 Subject: [PATCH 1/5] Fix build.sh to use Homebrew LLVM paths on mac --- build.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 0a4664756d..61bae8c373 100755 --- a/build.sh +++ b/build.sh @@ -54,16 +54,28 @@ fi PLATFORM="$(uname -s)" if [ "$PLATFORM" = "Linux" ]; then RAYLIB_NAME='raylib-5.5_linux_amd64' - OMP_LIB=-lomp5 SANITIZE_FLAGS=(-fsanitize=address,undefined,bounds,pointer-overflow,leak -fno-omit-frame-pointer) + INCLUDES=() STANDALONE_LDFLAGS=(-lGL) SHARED_LDFLAGS=(-Bsymbolic-functions) else + if ! command -v brew &>/dev/null; then + echo "Homebrew is not installed." + exit 0 + fi + # "--versions" is faster than normal "brew list llvm" + if ! brew list --versions llvm &>/dev/null; then + echo "LLVM is not installed via Homebrew. please 'brew install llvm'" + exit 0 + fi RAYLIB_NAME='raylib-5.5_macos' - OMP_LIB=-lomp SANITIZE_FLAGS=() - STANDALONE_LDFLAGS=(-framework Cocoa -framework IOKit -framework CoreVideo -framework OpenGL) - SHARED_LDFLAGS=(-framework Cocoa -framework OpenGL -framework IOKit -undefined dynamic_lookup) + # Homebrew "real" clang setup on mac + LLVM_PREFIX=$(brew --prefix llvm) + export PATH="$LLVM_PREFIX/bin:$PATH" + INCLUDES+=(-I$LLVM_PREFIX/include) + STANDALONE_LDFLAGS=(-framework Cocoa -framework IOKit -framework CoreVideo -framework OpenGL -L$LLVM_PREFIX/lib) + SHARED_LDFLAGS=(-framework Cocoa -framework OpenGL -framework IOKit -undefined dynamic_lookup -L$LLVM_PREFIX/lib) fi CLANG_WARN=( @@ -95,7 +107,7 @@ else fi RAYLIB_A="$RAYLIB_NAME/lib/libraylib.a" -INCLUDES=(-I./$RAYLIB_NAME/include -I./src -I./vendor) +INCLUDES+=(-I./$RAYLIB_NAME/include -I./src -I./vendor) LINK_ARCHIVES=("$RAYLIB_A") EXTRA_SRC="" @@ -252,7 +264,7 @@ if [ -z "$MODE" ]; then build/bindings.o "$STATIC_LIB" "$RAYLIB_A" -L$CUDA_HOME/lib64 $CUDNN_LFLAG -lcudart -lnccl -lnvidia-ml -lcublas -lcusolver -lcurand -lcudnn - $OMP_LIB $LINK_OPT + -lomp5 $LINK_OPT "${SHARED_LDFLAGS[@]}" -o "$OUTPUT" ) @@ -274,7 +286,7 @@ elif [ "$MODE" = "cpu" ]; then LINK_CMD=( ${CXX:-g++} -shared -fPIC -fopenmp build/bindings_cpu.o "$STATIC_LIB" "$RAYLIB_A" - -lm -lpthread $OMP_LIB $LINK_OPT + -lm -lpthread -lomp5 $LINK_OPT "${SHARED_LDFLAGS[@]}" -o "$OUTPUT" ) @@ -294,7 +306,7 @@ elif [ "$MODE" = "profile" ]; then tests/profile_kernels.cu vendor/ini.c \ "$STATIC_LIB" "$RAYLIB_A" \ -lnccl -lnvidia-ml -lcublas -lcurand -lcudnn \ - -lGL -lm -lpthread $OMP_LIB \ + -lGL -lm -lpthread -lomp5 \ -o profile echo "Built: ./profile" fi From cd52edc311ada7b98e5ada6edb2c8bc8c56f5787 Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Sun, 12 Apr 2026 23:18:34 -0400 Subject: [PATCH 2/5] fix accidental += when initializing INCLUDES in mac platform branch --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 61bae8c373..ee44e41371 100755 --- a/build.sh +++ b/build.sh @@ -73,7 +73,7 @@ else # Homebrew "real" clang setup on mac LLVM_PREFIX=$(brew --prefix llvm) export PATH="$LLVM_PREFIX/bin:$PATH" - INCLUDES+=(-I$LLVM_PREFIX/include) + INCLUDES=(-I$LLVM_PREFIX/include) STANDALONE_LDFLAGS=(-framework Cocoa -framework IOKit -framework CoreVideo -framework OpenGL -L$LLVM_PREFIX/lib) SHARED_LDFLAGS=(-framework Cocoa -framework OpenGL -framework IOKit -undefined dynamic_lookup -L$LLVM_PREFIX/lib) fi From b932c13ffbbc22d6b7f33f71000dfabd894848ae Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Mon, 13 Apr 2026 13:35:34 -0400 Subject: [PATCH 3/5] set CC and CXX and symlink lomp5 --- build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ee44e41371..21f7736014 100755 --- a/build.sh +++ b/build.sh @@ -72,7 +72,9 @@ else SANITIZE_FLAGS=() # Homebrew "real" clang setup on mac LLVM_PREFIX=$(brew --prefix llvm) - export PATH="$LLVM_PREFIX/bin:$PATH" + export CC=${CC:-$LLVM_PREFIX/bin/clang} + export CXX=${CXX:-$LLVM_PREFIX/bin/clang++} + ln -sf $LLVM_PREFIX/lib/libomp.dylib $LLVM_PREFIX/lib/libomp5.dylib INCLUDES=(-I$LLVM_PREFIX/include) STANDALONE_LDFLAGS=(-framework Cocoa -framework IOKit -framework CoreVideo -framework OpenGL -L$LLVM_PREFIX/lib) SHARED_LDFLAGS=(-framework Cocoa -framework OpenGL -framework IOKit -undefined dynamic_lookup -L$LLVM_PREFIX/lib) From 942c7f5e300b173a19b550f7b55eb54dfe23acad Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Mon, 13 Apr 2026 13:47:32 -0400 Subject: [PATCH 4/5] compress syntax --- build.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 21f7736014..aa2ff9055c 100755 --- a/build.sh +++ b/build.sh @@ -59,22 +59,15 @@ if [ "$PLATFORM" = "Linux" ]; then STANDALONE_LDFLAGS=(-lGL) SHARED_LDFLAGS=(-Bsymbolic-functions) else - if ! command -v brew &>/dev/null; then - echo "Homebrew is not installed." - exit 0 - fi - # "--versions" is faster than normal "brew list llvm" - if ! brew list --versions llvm &>/dev/null; then - echo "LLVM is not installed via Homebrew. please 'brew install llvm'" - exit 0 - fi + command -v brew &>/dev/null || {echo "Error: Homebrew isn't installed." && exit 1;} + brew ls --versions llvm &>/dev/null || {echo "Error: Homebrew LLVM isn't installed('brew install llvm')" && exit 1;} RAYLIB_NAME='raylib-5.5_macos' SANITIZE_FLAGS=() # Homebrew "real" clang setup on mac LLVM_PREFIX=$(brew --prefix llvm) export CC=${CC:-$LLVM_PREFIX/bin/clang} export CXX=${CXX:-$LLVM_PREFIX/bin/clang++} - ln -sf $LLVM_PREFIX/lib/libomp.dylib $LLVM_PREFIX/lib/libomp5.dylib + ln -sf $LLVM_PREFIX/lib/libomp.dylib $LLVM_PREFIX/lib/libomp5.dylib #f-ing mac INCLUDES=(-I$LLVM_PREFIX/include) STANDALONE_LDFLAGS=(-framework Cocoa -framework IOKit -framework CoreVideo -framework OpenGL -L$LLVM_PREFIX/lib) SHARED_LDFLAGS=(-framework Cocoa -framework OpenGL -framework IOKit -undefined dynamic_lookup -L$LLVM_PREFIX/lib) From c5ae3513ac46a693489c3d9fe07bdda81974a664 Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Mon, 13 Apr 2026 13:49:58 -0400 Subject: [PATCH 5/5] fix '}' unexpected syntax issue --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index aa2ff9055c..36a660da06 100755 --- a/build.sh +++ b/build.sh @@ -59,8 +59,8 @@ if [ "$PLATFORM" = "Linux" ]; then STANDALONE_LDFLAGS=(-lGL) SHARED_LDFLAGS=(-Bsymbolic-functions) else - command -v brew &>/dev/null || {echo "Error: Homebrew isn't installed." && exit 1;} - brew ls --versions llvm &>/dev/null || {echo "Error: Homebrew LLVM isn't installed('brew install llvm')" && exit 1;} + command -v brew &>/dev/null || { echo "Error: Homebrew not found" && exit 1; } + brew ls --versions llvm &>/dev/null || { echo "Error: Homebrew LLVM not found('brew install llvm')" && exit 1; } RAYLIB_NAME='raylib-5.5_macos' SANITIZE_FLAGS=() # Homebrew "real" clang setup on mac