BerkeleyAutomation / python-fcl

Python binding of FCL library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'Symbol not found in flat namespace' and 'fatal error: 'octomap/OccupancyOcTreeBase.h' file not found` on OSX Sonoma 14.1

araistrick opened this issue · comments

Hello,

I encountered various issues trying to install python-fcl on an M3 Max OSX Sonoma 14.1 machine:

In a fresh python3.11 environment (or at least, my (base) conda environment), and also in my python3.10 environment with various other packages installed, i observed the following:

pip install python fcl
python
>>> import fcl

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/araistrick/miniconda3/lib/python3.11/site-packages/fcl/__init__.py", line 2, in <module>
    from .fcl import (
ImportError: dlopen(/Users/araistrick/miniconda3/lib/python3.11/site-packages/fcl/fcl.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '__ZNK3fcl17CollisionGeometryIdE34computeMomentofInertiaRelatedToCOMEv'

Note: pip chose to install python-fcl==0.7.0.5

Directly installing from github I get the following:

pip install 'python-fcl @ git+https://github.com/BerkeleyAutomation/python-fcl.git'

#warning "Using deprecated NumPy API, disable it with " \
       ^
      src/fcl/fcl.cpp:820:10: fatal error: 'octomap/OccupancyOcTreeBase.h' file not found
      #include "octomap/OccupancyOcTreeBase.h"
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-fcl
Failed to build python-fcl

I then tried to get octomap from homebrew:

brew install octomap
export CPATH="/opt/homebrew/include:$CPATH"
pip install 'python-fcl @ git+https://github.com/BerkeleyAutomation/python-fcl.git'

src/fcl/fcl.cpp:813:10: fatal error: 'numpy/arrayobject.h' file not found
      #include "numpy/arrayobject.h"
               ^~~~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1

I then tried manually adding my numpy.get_include() path to my CPATH:

export CPATH="/Users/araistrick/miniconda3/envs/infinigen/lib/python3.10/site-packages/numpy/core/include:$CPATH"
pip install 'python-fcl @ git+https://github.com/BerkeleyAutomation/python-fcl.git'  

 src/fcl/fcl.cpp:840:10: fatal error: 'fcl/common/types.h' file not found
      #include "fcl/common/types.h"
               ^~~~~~~~~~~~~~~~~~~~
      1 warning and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1

At which point it feels something deeper is going wrong and im not sure how to proceed, or perhaps im wrong in assuming that install from github would work.

Would appreciate any help, I recognize my environment is quite new. My numpy version is also very old (1.26.2) so I will update and retry also.

Hi, any updates? I face the same problem. I already tried moving your code from #74 and it did not work :((

Hey, Github released mac M1 CI runners finally and it appears to have built and tested successfully in #74 with macosx_arm64 wheels on both Github and PyPi

You should be able to pip install --upgrade python-fcl and get them. I'm going to close this but feel free to open new issues if the wheels don't work.