Skip to content
New issue

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

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

Already on GitHub? # to your account

Specify ARCHFLAGS envvar when installing ocean-lib on Mac #486

Closed
MantisClone opened this issue Sep 20, 2021 · 2 comments · Fixed by #499
Closed

Specify ARCHFLAGS envvar when installing ocean-lib on Mac #486

MantisClone opened this issue Sep 20, 2021 · 2 comments · Fixed by #499
Assignees

Comments

@MantisClone
Copy link
Contributor

Description

Add instruction for Mac users to READMEs. Set ARCHFLAGS envvar when installing ocean-lib:

ARCHFLAGS="-arch x86_64" pip3 install ocean-lib

where the x86_64 argument matchs your system's real architecture

Context

ocean-lib requires several low-level C/C++ dependencies that are compiled upon installation. On Linux platforms, pip seems to handle this process successfully. On Mac, however, pip passes conflicting arch flags for both ARM and x86

-arch arm64 -arch x86_64

which causes the compilation to fail with the following message:

building 'bitarray._bitarray' extension
  creating build/temp.macosx-10.9-universal2-3.9
  creating build/temp.macosx-10.9-universal2-3.9/bitarray
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/nic/Documents/GitHub/barge/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c bitarray/_bitarray.c -o build/temp.macosx-10.9-universal2-3.9/bitarray/_bitarray.o
  In file included from bitarray/_bitarray.c:12:
  In file included from /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:11:
  In file included from /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  #error Unsupported architecture
   ^

The solution described by this StackOverflow answer appears to solve the issue: https://stackoverflow.com/a/67715297

Your system's real architecture can be printed using

uname -p
@MantisClone MantisClone self-assigned this Sep 23, 2021
@calina-c calina-c changed the title Update READMEs, specify ARCHFLAGS envvar when installing ocean-lib on Mac Specify ARCHFLAGS envvar when installing ocean-lib on Mac Sep 24, 2021
@calina-c
Copy link
Contributor

I changed the title of the issue because I intend to reference it in the README for a more extensive explanation to what is happening.

@frostypenguin0100
Copy link

vis/stable htop-legacy/stable guile18/stable gtk2/x11

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants