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

can't upgrade/install torch-spline-conv and torch-scatter on Mac #18

Closed
cysmnl opened this issue Aug 16, 2018 · 13 comments
Closed

can't upgrade/install torch-spline-conv and torch-scatter on Mac #18

cysmnl opened this issue Aug 16, 2018 · 13 comments

Comments

@cysmnl
Copy link

cysmnl commented Aug 16, 2018

UserWarning:

                               !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 4.9 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                              !! WARNING !!

fatal error: 'forward_list' file not found
#include <forward_list>
^~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1

These are the errors I get trying to pip or manually install torch-spline-conv and torch-scatter.

I'm on a Mac OSX 10.12.6
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0

@rusty1s
Copy link
Member

rusty1s commented Aug 17, 2018

Hi,

I‘m not sure if I can help you, as this seems to be a problem with Mac and the new Extension API. Please verify that the official extension-cpp examples work on your machine and report back.

@cysmnl
Copy link
Author

cysmnl commented Aug 21, 2018

Hi,
I could not compile the extension-cpp/cpp folder via python jit.py
There's an issue with my system defaulting to the old clang complier which uses C++ 4.2.1.. I tried installing gcc8 with homebrew and linked it, but checking c++ -v still points to clang.

@rusty1s
Copy link
Member

rusty1s commented Aug 22, 2018

You need to use clang on macOS, and personally, this works fine for me :(

@cysmnl
Copy link
Author

cysmnl commented Aug 22, 2018

After reinstalling anaconda and installing a new environment, I was able to pip install torch-scatter just fine. But now I have trouble importing it.

(torch) cyml:~ cyrus$ python
Python 3.7.0 (default, Jun 28 2018, 07:39:16)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

import torch
import torch_scatter
Traceback (most recent call last):
File "", line 1, in
File "/Users/cyrus/anaconda3/envs/torch/lib/python3.7/site-packages/torch_scatter/init.py", line 3, in
from .mul import scatter_mul
File "/Users/cyrus/anaconda3/envs/torch/lib/python3.7/site-packages/torch_scatter/mul.py", line 3, in
from torch_scatter.utils.ext import get_func
File "/Users/cyrus/anaconda3/envs/torch/lib/python3.7/site-packages/torch_scatter/utils/ext.py", line 2, in
import scatter_cpu
ImportError: dlopen(/Users/cyrus/anaconda3/envs/torch/lib/python3.7/site-packages/scatter_cpu.cpython-37m-darwin.so, 2): Symbol not found: __ZN2at5ErrorC1ENS_14SourceLocationESs
Referenced from: /Users/cyrus/anaconda3/envs/torch/lib/python3.7/site-packages/scatter_cpu.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/cyrus/anaconda3/envs/torch/lib/python3.7/site-packages/scatter_cpu.cpython-37m-darwin.so

@rusty1s
Copy link
Member

rusty1s commented Aug 22, 2018

Please try installing from source:
python setup.py install

@PhillipMarshall
Copy link

I get the same error message on Linux "Symbol not found: __ZN2at5ErrorC1ENS_14SourceLocationESs".
After installing from source the error is still the same.

@cysmnl
Copy link
Author

cysmnl commented Aug 29, 2018

I am using Homebrew GCC 8.2.0 with an anaconda environment (python 3.7, GCC 4.0.1)
Tried installing pytorch_scatter-1.0.4 from source, no luck. I get the same error.
I can compile pytorch/extension-cpp/cpp, but still get error "Symbol not found: __ZN2at5ErrorC1ENS_14SourceLocationESs" when I import lltm_cpp.

Everything installs fine in redhat Linux in an anaconda environment (python 3.7, GCC 7.2.0)

@rusty1s
Copy link
Member

rusty1s commented Aug 30, 2018

I could reproduce the error on a mac. I will look into it.

@fighting41love
Copy link

Same error.
Mac OS mojave, GCC=5.2.0, python=3.6
ImportError: dlopen(~/lib/python3.6/site-packages/scatter_cpu.cpython-36m-darwin.so, 2): Symbol not found: __ZN2at5ErrorC1ENS_14SourceLocationESs Referenced from:~/lib/python3.6/site-packages/catter_cpu.cpython-36m-darwin.so Expected in: flat namespace in~/lib/python3.6/site-packages/scatter_cpu.cpython-36m-darwin.so

@chengaf
Copy link

chengaf commented Dec 4, 2018

After installing from source, the error still exists
undefined symbol: _ZN2at6detail20DynamicCUDAInterface10set_deviceE

@rusty1s
Copy link
Member

rusty1s commented Dec 12, 2018

I could resolve this issue by setting up a clean miniconda environment. It seems to be fixable by clearing the pip cache (rusty1s/pytorch_scatter#7).

@ludwigwinkler
Copy link

pip install -vvv torch-scatter (phd)
Created temporary directory: /private/var/folders/dk/g2vbp9_j2h73w35cywjv1sw40000gn/T/pip-ephem-wheel-cache-plrbxau5
Created temporary directory: /private/var/folders/dk/g2vbp9_j2h73w35cywjv1sw40000gn/T/pip-req-tracker-mc_3i5pl
Created requirements tracker '/private/var/folders/dk/g2vbp9_j2h73w35cywjv1sw40000gn/T/pip-req-tracker-mc_3i5pl'
Created temporary directory: /private/var/folders/dk/g2vbp9_j2h73w35cywjv1sw40000gn/T/pip-install-2c7znfo_
Collecting torch-scatter
1 location(s) to search for versions of torch-scatter:

Successfully installed torch-scatter-1.1.1
Cleaning up...
Removed build tracker '/private/var/folders/dk/g2vbp9_j2h73w35cywjv1sw40000gn/T/pip-req-tracker-mc_3i5pl'

FYI,
weirdly enough I could only make torch-scatter install in my conda environment after having it installed in my root python3 via pip3.
So clearing the wheels in the root pip cache was actually the wrong thing to do in my case (then again, it's in my specific case).
I'm not familiar with the inner workings of pip/conda to give recommendations, just wanted to add it to the thread. =)

PS: Thank you very much for the awesome library!

@koustuvsinha
Copy link

Installing clang compiler tools within my conda environment worked for me:

conda install -y clang_osx-64 clangxx_osx-64 gfortran_osx-64

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

No branches or pull requests

7 participants