CAVEconnectome / MeshParty

Apache License 2.0
35 stars 16 forks source link

trimesh_io crashes on Import for Mac OS #45

Closed william-silversmith closed 4 years ago

william-silversmith commented 5 years ago
(mp) wms:~/MeshParty$ python test.py
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    from meshparty import trimesh_io
  File "/Users/wms/MeshParty/meshparty/trimesh_io.py", line 5, in <module>
    from pykdtree.kdtree import KDTree
ModuleNotFoundError: No module named 'pykdtree'

On installing pykdtree:

(mp) wms:~/MeshParty$ pip install pykdtree
Collecting pykdtree
  Using cached https://files.pythonhosted.org/packages/aa/29/dcea65f86356bfa032b32cc326db7d84c272c5c8fc5a82f485c247592a75/pykdtree-1.3.1.tar.gz
Requirement already satisfied: numpy in /Users/wms/.virtualenvs/mp/lib/python3.6/site-packages (from pykdtree) (1.17.1)
Building wheels for collected packages: pykdtree
  Building wheel for pykdtree (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/wms/.virtualenvs/mp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/setup.py'"'"'; __file__='"'"'/private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-wheel-ghqx78lw --python-tag cp36
       cwd: /private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/pykdtree
  copying pykdtree/test_tree.py -> build/lib.macosx-10.9-x86_64-3.6/pykdtree
  copying pykdtree/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pykdtree
  running build_ext
  building 'pykdtree.kdtree' extension
  creating build/temp.macosx-10.9-x86_64-3.6
  creating build/temp.macosx-10.9-x86_64-3.6/pykdtree
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/Users/wms/.virtualenvs/mp/lib/python3.6/site-packages/numpy/core/include -c pykdtree/kdtree.c -o build/temp.macosx-10.9-x86_64-3.6/pykdtree/kdtree.o -std=c99 -O3 -fopenmp
  clang: error: unsupported option '-fopenmp'
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pykdtree
  Running setup.py clean for pykdtree
Failed to build pykdtree
Installing collected packages: pykdtree
  Running setup.py install for pykdtree ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/wms/.virtualenvs/mp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/setup.py'"'"'; __file__='"'"'/private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-record-w_lwpef5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/wms/.virtualenvs/mp/bin/../include/site/python3.6/pykdtree
         cwd: /private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/
    Complete output (15 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.6
    creating build/lib.macosx-10.9-x86_64-3.6/pykdtree
    copying pykdtree/test_tree.py -> build/lib.macosx-10.9-x86_64-3.6/pykdtree
    copying pykdtree/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pykdtree
    running build_ext
    building 'pykdtree.kdtree' extension
    creating build/temp.macosx-10.9-x86_64-3.6
    creating build/temp.macosx-10.9-x86_64-3.6/pykdtree
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/Users/wms/.virtualenvs/mp/lib/python3.6/site-packages/numpy/core/include -c pykdtree/kdtree.c -o build/temp.macosx-10.9-x86_64-3.6/pykdtree/kdtree.o -std=c99 -O3 -fopenmp
    clang: error: unsupported option '-fopenmp'
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/wms/.virtualenvs/mp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/setup.py'"'"'; __file__='"'"'/private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-install-v8uv0d17/pykdtree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_v/0h6xtv2d009cmxcft7snynvh0000gn/T/pip-record-w_lwpef5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/wms/.virtualenvs/mp/bin/../include/site/python3.6/pykdtree Check the logs for full command output.
william-silversmith commented 5 years ago

Looks like this is the relevant issue:

https://github.com/storpipfugl/pykdtree/issues/37

william-silversmith commented 5 years ago

Cool, you can build it if you do the following:

(mp) wms:~/MeshParty$ export USE_OMP=0
(mp) wms:~/MeshParty$ pip install pykdtree
fcollman commented 5 years ago

I think pykdtree is listed in the requirements. I haven't a had a problem building pykdtree on my mac, but you seem to be building for 10.9, which is a very old version of OS. Did you try set export MACOSX_DEPLOYMENT_TARGET=10.XX where XX is whatever version you are running, I find this is an important thing to have in my bash_profile to make compilation work right.

william-silversmith commented 5 years ago

This is a good idea, I should try that next time.

fcollman commented 5 years ago

can i close this issue?

william-silversmith commented 5 years ago

It might be good to mention this in the Readme, but yes.

On Tue, Sep 24, 2019 at 2:51 PM Forrest Collman notifications@github.com wrote:

can i close this issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sdorkenw/MeshParty/issues/45?email_source=notifications&email_token=AATGQSOZRWY6GZYHGELKTWLQLJORRA5CNFSM4IXJ7NE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7PNQEA#issuecomment-534698000, or mute the thread https://github.com/notifications/unsubscribe-auth/AATGQSK7QI6JWSJSUOKNKE3QLJORRANCNFSM4IXJ7NEQ .