LuisaGroup/LuisaRender

CMake Generate step failed on MacOS 13.1(M1 Pro)

why986 opened this issue · 8 comments

Describe the bug
I failed to configure the project on my Mac. I would appreciate your help. Thanks.

Environment:

  • OS: MacOS 13.1 with M1 Pro
  • cmake 3.25.1
  • clang 14.0.0
  • embree installed by brew

CMake log
-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could not find sccache
CMake Warning (dev) at src/ext/assimp/CMakeLists.txt:63 (OPTION):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Shared libraries enabled
-- compiling zlib from sources
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Build an import-only version of Assimp.
INFO Hunter enabled or RT-extension not found. glTF import/export will be built without Open3DGC-compression.
-- Enabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IQM IRR LWO LWS M3D MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD
-- Disabled importer formats:
-- Treating all warnings as errors (for assimp library only)
-- Could not find sccache
-- Build spdlog: 1.11.0
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Build type: Release
-- Using the multi-header code from /Users/why/Desktop/LuisaRender/src/compute/src/ext/json/include/
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenGL.framework
-- Including Cocoa support
-- Performing Test EASTL_HAS_FCHAR8T_FLAG
-- Performing Test EASTL_HAS_FCHAR8T_FLAG - Success
-- Performing Test EASTL_HAS_ZCCHAR8T_FLAG
-- Performing Test EASTL_HAS_ZCCHAR8T_FLAG - Failed
-- Found embree: 3.13.5
-- Performing Test ABSL_INTERNAL_AT_LEAST_CXX17
-- Performing Test ABSL_INTERNAL_AT_LEAST_CXX17 - Success
-- Build with Metal backend
-- The OBJC compiler identification is AppleClang 14.0.0.14000029
-- Detecting OBJC compiler ABI info
-- Detecting OBJC compiler ABI info - done
-- Check for working OBJC compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- The OBJCXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting OBJCXX compiler ABI info
-- Detecting OBJCXX compiler ABI info - done
-- Check for working OBJCXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Could not find nvcc, please set CUDAToolkit_ROOT.
-- Could NOT find LLVM (missing: LLVM_DIR)
CMake Warning at src/compute/src/backends/llvm/CMakeLists.txt:36 (message):
LLVM not found. LLVM backend will not be built.

-- Configuring done
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJC_COMPILE_OBJECT
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

It seems that the bug is fixed after I add the following codes to the CMakeLists.txt:

if(APPLE)
    enable_language(OBJC)
endif()

Find solution in here
Will update if more bugs are found.

Hi, @why986.

A recent fix in LuisaCompute should have resolved this issue, and I just updated the dependencies in LuisaRender.

Would you please git pull and git submodule update --init --recursive to see if this fixes your errors?

Thanks. I will try now.

It seems that the bug is fixed after I add the following codes to the CMakeLists.txt:

if(APPLE)
    enable_language(OBJC)
endif()

Find solution in here Will update if more bugs are found.

Yes. This is the same fix we did.

See. Thanks for your reply!

It occurs another small bug after I pull the update and reconfigure the project (already deleted the built files):

CMake Error at src/compute/src/ext/CMakeLists.txt:168 (add_subdirectory):
  The source directory

    /Users/why/Desktop/LuisaRender/src/compute/src/ext/embree

  does not contain a CMakeLists.txt file.

There seems nothing under LuisaRender/src/compute/src/ext/embree.

Looks like the submodule is not correctly cloned. Would a git submodule update --recursive --init fix this issue? Otherwise, you could probably try cd into LuisaRender/src/compute/src/ext/embree and git checkout.

OK. It seems work. Thanks for your help!