Installing Assimpcy on Mac M1

Viewed 318

I have tried to install assimpcy on Mac Big Sur 11.2.3 (Silicon), despite installing gcc with the brew and Xcode tools, I have the following error when trying to install assimpcy via pip or building from git

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/isee/Documents/P3D/env/lib/python3.9/site-packages/numpy/core/include -I/Users/isee/Documents/P3D/env/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c ./assimpcy/all.cpp -o build/temp.macosx-10.9-universal2-3.9/./assimpcy/all.o -fopenmp
    clang: error: unsupported option '-fopenmp'
    clang: error: unsupported option '-fopenmp'
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------

UPDATE

Tried to install and use gcc compiler from home-brew, which now gives:

gcc-10: warning: this compiler does not support X86 (arch flags ignored)
gcc-10: error: unrecognized command-line option '-stdlib=libc++'
error: command '/opt/homebrew/bin/gcc-10' failed with exit code 1

So is there anyway to get this to run at all in the end ?

1 Answers

I guess the assimpcy tries to use OpenMP for its build. The option

gcc ... -fopenmp

will enable the OpenMP-support only for the GCC-compiler. Unfortunately, you are working with clang on your Mac M1. From my point of view you have 2 options to work around this issue:

  1. Switch to GCC for your use case, if this is possible
  2. Fix the compiler option for clang my using -fopenmp=libiomp5 for your clang-compiler. I guess you will have to fix the assimpcy build in their repo.

Hope that helps a little bit.

Related