shacklettbp/madrona

Intel mac build broken

SamanKazemkhani opened this issue · 1 comments

I'm getting the following error when trying to configure cmake on my Intel mac:

(base) samk@Samans-MBP build % cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE=Debug ../
-- Populating madronabundledtoolchain
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/samk/src/gpudrive/build/_deps/madronabundledtoolchain-subbuild
[ 11%] No configure step for 'madronabundledtoolchain-populate'
[ 22%] No build step for 'madronabundledtoolchain-populate'
[ 33%] No install step for 'madronabundledtoolchain-populate'
[ 44%] No test step for 'madronabundledtoolchain-populate'
[ 55%] Completed 'madronabundledtoolchain-populate'
[100%] Built target madronabundledtoolchain-populate
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Users/samk/src/gpudrive/external/madrona/external/madrona-toolchain/bundled-toolchain/toolchain/Toolchains/LLVM17.0.5.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Users/samk/src/gpudrive/external/madrona/external/madrona-toolchain/bundled-toolchain/toolchain/Toolchains/LLVM17.0.5.xctoolchain/usr/bin/clang - broken
CMake Error at /usr/local/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeTestCCompiler.cmake:70 (message):
  The C compiler

    "/Users/samk/src/gpudrive/external/madrona/external/madrona-toolchain/bundled-toolchain/toolchain/Toolchains/LLVM17.0.5.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/samk/src/gpudrive/build/CMakeFiles/CMakeScratch/TryCompile-diUooz
    
    Run Build Command(s):/usr/bin/make -f Makefile cmTC_79e58/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_79e58.dir/build.make CMakeFiles/cmTC_79e58.dir/build
    Building C object CMakeFiles/cmTC_79e58.dir/testCCompiler.c.o
    /Users/samk/src/gpudrive/external/madrona/external/madrona-toolchain/bundled-toolchain/toolchain/Toolchains/LLVM17.0.5.xctoolchain/usr/bin/clang   -arch x86_64 -o CMakeFiles/cmTC_79e58.dir/testCCompiler.c.o -c /Users/samk/src/gpudrive/build/CMakeFiles/CMakeScratch/TryCompile-diUooz/testCCompiler.c
    make[1]: /Users/samk/src/gpudrive/external/madrona/external/madrona-toolchain/bundled-toolchain/toolchain/Toolchains/LLVM17.0.5.xctoolchain/usr/bin/clang: Bad CPU type in executable
    make[1]: *** [CMakeFiles/cmTC_79e58.dir/testCCompiler.c.o] Error 1
    make: *** [cmTC_79e58/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/samk/src/gpudrive/build/CMakeFiles/CMakeOutput.log".
See also "/Users/samk/src/gpudrive/build/CMakeFiles/CMakeError.log".

This is not blocking me but it would be nice if I could develop locally. The regression must have been introduced between 2669441 (August 5, 2023) and 5911a3d (March 15, 2024).

Sorry about that. If this isn't a blocker for you, I don't really have the bandwidth to test / support intel macs since a) I don't have one and b) it's a dying platform.

I'd accept PRs that fix support.

In this case the issue is the bundled toolchain isn't compiled with x86 support. You'll need to pass -DMADRONA_USE_TOOLCHAIN=FALSE to cmake and then fix any errors you encounter after that point (you will likely need a fairly recent clang installed view homebrew). You may also need to disable bundled dependencies -DMADRONA_USE_BUNDLED=FALSE. Unfortunately turning off the bundled toolchain and bundled dependencies is basically untested. If you run into cmake issues there I will accept PRs that fix the problems, probably just minor CMAKE details.