Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS13.1 M1 source code compilation but get arch x64 #6965

Closed
ingra14m opened this issue Dec 22, 2022 · 4 comments
Closed

MacOS13.1 M1 source code compilation but get arch x64 #6965

ingra14m opened this issue Dec 22, 2022 · 4 comments
Assignees
Labels
question Question on using Taichi

Comments

@ingra14m
Copy link

M1 Mac shows arch x64 when compiling the source code. I have to use llvm without M1 chip to compile successfully.

Environment:

  • MacOS Ventura 13.1
  • M1 Max 32G mem
  • Apple clang version 14.0.0
  • iterm2(without Rosette)

The error information is shown below:

CMake Error at /Users/ingram14/OutSideLib/taichi-llvm-15-m1/lib/cmake/llvm/LLVMExports.cmake:64 (set_target_properties):
The link interface of target "LLVMSupport" contains:

zstd::libzstd_shared

but the target was not found. Possible reasons include:

  • There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
/Users/ingram14/OutSideLib/taichi-llvm-15-m1/lib/cmake/llvm/LLVMConfig.cmake:230 (include)
cmake/TaichiCore.cmake:162 (find_package)
CMakeLists.txt:156 (include)

@ingra14m ingra14m added the question Question on using Taichi label Dec 22, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Dec 22, 2022
@bobcao3
Copy link
Collaborator

bobcao3 commented Dec 22, 2022

Can you double check that the entire shell environment and the code tools are all arm version before/ during compilation? You should be able to see that from the system monitor app

@erizmr erizmr moved this from Untriaged to Todo in Taichi Lang Dec 23, 2022
@ingra14m
Copy link
Author

Thanks for ur answer. I'm sure the shell environment is arm64, and I open the iTerm2 without Rosette

> uname -a
Darwin ZYEIRYANG-MB0 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64

The entire information during compilation is shown below:

--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is Clang 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/opt/llvm@11/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ingram14/Git_Project/taichi/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - success
--------------------------------------------------------------------------------

Configuring Project
  Working directory:
    /Users/ingram14/Git_Project/taichi/_skbuild/macosx-10.16-x86_64-3.8/cmake-build
  Command:
    cmake /Users/ingram14/Git_Project/taichi -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/Users/ingram14/Git_Project/taichi/_skbuild/macosx-10.16-x86_64-3.8/cmake-install -DPYTHON_VERSION_STRING:STRING=3.8.8 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/Users/ingram14/.local/lib/python3.8/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/Users/ingram14/opt/anaconda3/bin/python -DPYTHON_INCLUDE_DIR:PATH=/Users/ingram14/opt/anaconda3/include/python3.8 -DPYTHON_LIBRARY:PATH=/Users/ingram14/opt/anaconda3/lib/libpython3.8.dylib -DPython_EXECUTABLE:PATH=/Users/ingram14/opt/anaconda3/bin/python -DPython_ROOT_DIR:PATH=/Users/ingram14/opt/anaconda3 -DPython_INCLUDE_DIR:PATH=/Users/ingram14/opt/anaconda3/include/python3.8 -DPython_FIND_REGISTRY:STRING=NEVER -DPython_NumPy_INCLUDE_DIRS:PATH=/Users/ingram14/.local/lib/python3.8/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/Users/ingram14/opt/anaconda3/bin/python -DPython3_ROOT_DIR:PATH=/Users/ingram14/opt/anaconda3 -DPython3_INCLUDE_DIR:PATH=/Users/ingram14/opt/anaconda3/include/python3.8 -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_NumPy_INCLUDE_DIRS:PATH=/Users/ingram14/.local/lib/python3.8/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/Users/ingram14/.local/lib/python3.8/site-packages/ninja/data/bin/ninja -DTI_VERSION_MAJOR=1 -DTI_VERSION_MINOR=4 -DTI_VERSION_PATCH=0 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.16 -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64

-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is Clang 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /opt/homebrew/opt/llvm@11/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Taichi Version 1.4.0
       Commit dab203097278fe2b6c0b8d1e3413caed340f6e6a
Clang executable using host compiler /opt/homebrew/opt/llvm@11/bin/clang++
/opt/homebrew/opt/llvm@11/bin/clang++ --version: 11.1.0
-- Python: Using /Users/ingram14/opt/anaconda3/bin/python as the interpreter
    version: 3.8.8
    include: /Users/ingram14/opt/anaconda3/include/python3.8
    library: /Users/ingram14/opt/anaconda3/lib/libpython3.8.dylib
    numpy include: /Users/ingram14/.local/lib/python3.8/site-packages/numpy/core/include
-- Found PythonInterp: /Users/ingram14/opt/anaconda3/bin/python (found suitable version "3.8.8", minimum required is "3.6")
-- Found PythonLibs: /Users/ingram14/opt/anaconda3/lib/libpython3.8.dylib
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Failed
-- Performing Test HAS_FLTO_THIN
-- Performing Test HAS_FLTO_THIN - Failed
-- Found pybind11: /Users/ingram14/.local/lib/python3.8/site-packages/pybind11/include (found version "2.10.2")
Using C++ compiler: /opt/homebrew/opt/llvm@11/bin/clang++
Clang compiler detected. Using std=c++17.
Building for processor x86_64
Setting -march=nehalem for x86_64 processors
Using float32 (single) precision as real
CMake Warning at cmake/TaichiCore.cmake:46 (message):
  CUDA backend not supported on OS X.  Setting TI_WITH_CUDA to OFF.
Call Stack (most recent call first):
  CMakeLists.txt:156 (include)


CMake Warning at cmake/TaichiCore.cmake:50 (message):
  OpenGL backend not supported on OS X.  Setting TI_WITH_OPENGL to OFF.
Call Stack (most recent call first):
  CMakeLists.txt:156 (include)


CMake Warning at cmake/TaichiCore.cmake:54 (message):
  C backend not supported on OS X.  Setting TI_WITH_CC to OFF.
Call Stack (most recent call first):
  CMakeLists.txt:156 (include)


-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib/libz.tbd (found version "1.2.11")
-- Could NOT find zstd (missing: zstd_LIBRARY zstd_INCLUDE_DIR)
-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib/libxml2.tbd (found version "2.9.4")
-- Found LLVM 16.0.0git
-- Using LLVMConfig.cmake in: /Users/ingram14/OutSideLib/taichi-llvm-15-m1/lib/cmake/llvm
LLVM include dirs /Users/ingram14/OutSideLib/taichi-llvm-15-m1/include
LLVM library dirs /Users/ingram14/OutSideLib/taichi-llvm-15-m1/lib
-- Found PythonInterp: /Users/ingram14/opt/anaconda3/bin/python (found suitable version "3.8.8", minimum required is "3")
PYTHON_LIBRARIES: /Users/ingram14/opt/anaconda3/lib/libpython3.8.dylib
C++ Flags:  -ffunction-sections -fdata-sections -DTI_ISE_NONE -std=c++17 -fsized-deallocation -Wno-deprecated-declarations -Wall  -Werror  -Wno-ignored-attributes  -Wno-nullability-completeness  -Wno-unused-private-field  -Wno-unneeded-internal-declaration  -DTI_ARCH_x64 -march=nehalem -DTI_PASS_EXCEPTION_TO_PYTHON -DTI_INCLUDED -DTI_WITH_LLVM -DTI_WITH_METAL
Build type: Release
-- Compiling LLVM byte code file for arch x64
-- Configuring done
CMake Error at /Users/ingram14/OutSideLib/taichi-llvm-15-m1/lib/cmake/llvm/LLVMExports.cmake:64 (set_target_properties):
  The link interface of target "LLVMSupport" contains:

    zstd::libzstd_shared

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /Users/ingram14/OutSideLib/taichi-llvm-15-m1/lib/cmake/llvm/LLVMConfig.cmake:230 (include)
  cmake/TaichiCore.cmake:162 (find_package)
  CMakeLists.txt:156 (include)

@ailzhang
Copy link
Contributor

@ingra14m according to cmake doc of CMAKE_HOST_SYSTEM_PROCESSOR: On Apple Silicon hosts, the architecture printed by uname -m may vary based on CMake's own architecture and that of the invoking process tree.

would you mind trying a new miniconda python environment https://docs.conda.io/en/latest/miniconda.html and make sure installing cmake from conda? Thanks!

@ingra14m
Copy link
Author

@ailzhang thx, I solved the problem by installing cmake in my python environment. Thank u for your answer!

@github-project-automation github-project-automation bot moved this from Todo to Done in Taichi Lang Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question on using Taichi
Projects
Status: Done
Development

No branches or pull requests

3 participants