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

Failed to install velocyto on macOS #351

Open
r-osorio opened this issue Jan 5, 2023 · 4 comments
Open

Failed to install velocyto on macOS #351

r-osorio opened this issue Jan 5, 2023 · 4 comments

Comments

@r-osorio
Copy link

r-osorio commented Jan 5, 2023

Attempting to install velocyto on mac OS monterey 12.4, and running into a similar error I have seen on other issue threads. When running pip install velocyto after installing dependencies with conda, I get:

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/username/miniconda3/envs/scv/include -fPIC -O2 -isystem /Users/username/miniconda3/envs/scv/include -I/Users/username/miniconda3/envs/scv/lib/python3.10/site-packages/numpy/core/include -I/Users/username/miniconda3/envs/scv/include/python3.10 -c velocyto/speedboosted.c -o build/temp.macosx-10.9-x86_64-cpython-310/velocyto/speedboosted.o -fopenmp -ffast-math
      clang: error: unsupported option '-fopenmp'
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

I have run brew install gcc and conda install gcc, and tried running CC=/usr/bin/gcc pip install velocyto, which worked for some people (#58 and #53), but still got

/usr/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/username/miniconda3/envs/scv/include -fPIC -O2 -isystem /Users/username/miniconda3/envs/scv/include -I/Users/username/miniconda3/envs/scv/lib/python3.10/site-packages/numpy/core/include -I/Users/username/miniconda3/envs/scv/include/python3.10 -c velocyto/speedboosted.c -o build/temp.macosx-10.9-x86_64-cpython-310/velocyto/speedboosted.o -fopenmp -ffast-math
      clang: error: unsupported option '-fopenmp'
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

I also tried installing python-dev, libgcc, and openmp, per other potential solutions i had looked up, none of which helped and result in the same error.

I have also tried installing from source, while modifying setup.py to have C_COMPILE = False and USE_CYTHON = False, as mentioned in #53. In this case, using pip install -e . appears to work, but then when trying to run velocyto --help, I get:

Traceback (most recent call last):
  File "/Users/username/miniconda3/envs/scv/bin/velocyto", line 33, in <module>
    sys.exit(load_entry_point('velocyto', 'console_scripts', 'velocyto')())
  File "/Users/username/miniconda3/envs/scv/bin/velocyto", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/Users/username/miniconda3/envs/scv/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/Users/username/miniconda3/envs/scv/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/username/Desktop/velocyto.py/velocyto/__init__.py", line 13, in <module>
    from .estimation import fit_slope, _fit1_slope, clusters_stats
  File "/Users/username/Desktop/velocyto.py/velocyto/estimation.py", line 7, in <module>
    from .speedboosted import _colDeltaCor, _colDeltaCorLog10, _colDeltaCorSqrt
ModuleNotFoundError: No module named 'velocyto.speedboosted'

Apologies if the answer is obvious, but I have been trying to find the problem and dont seem to understand what is preventing installation. I have also tried the same methods on an older Mac running OS Mojave 10.14 (intel chip), which had the same error messages regarding clang, gcc, and velocyto.speedboosted.

Thank you for any help you can provide. I would really like to use velocyto in my analysis if possible.

@LenonaFan
Copy link

I got the same problem. Does anyone know the solution?

@jumije
Copy link

jumije commented Jan 20, 2023

Hi r-osorio,

I encountered the same problems. I solved this by explicitly choosing the Homebrew gcc version installed and not the /usr/bin/gcc.

You can find the path to the Homebrew gcc version installed via brew list gcc. For me this was /opt/homebrew/bin/gcc-12. So I ran:
CC=/opt/homebrew/bin/gcc-12 pip install velocyto

In total, this means doing these steps for macOS:

# generate a new conda environment and activate it
conda create -n celloracle_env python=3.8
conda activate celloracle_env

# install dependencies for velocyto
conda install numpy scipy cython numba matplotlib scikit-learn h5py click
pip install pysam

# install gcc via brew
brew install gcc
brew list gcc

# use the Homebrew gcc version to install velocyto with pip
CC=/opt/homebrew/bin/gcc-12 pip install velocyto

# install celloracle
pip install celloracle

@r-osorio
Copy link
Author

Hi jumije,

Tried your steps and all went well until installing again. While this got me further than before, now I am running into:

clang: error: unsupported option '-fopenmp'
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

I came across this post and subsequently ran brew install llvm libomp, then retried, but still got the same error.

@liuyifang
Copy link

Hi r-osorio,

I encountered the same problems. I solved this by explicitly choosing the Homebrew gcc version installed and not the /usr/bin/gcc.

You can find the path to the Homebrew gcc version installed via brew list gcc. For me this was /opt/homebrew/bin/gcc-12. So I ran: CC=/opt/homebrew/bin/gcc-12 pip install velocyto

In total, this means doing these steps for macOS:

# generate a new conda environment and activate it
conda create -n celloracle_env python=3.8
conda activate celloracle_env

# install dependencies for velocyto
conda install numpy scipy cython numba matplotlib scikit-learn h5py click
pip install pysam

# install gcc via brew
brew install gcc
brew list gcc

# use the Homebrew gcc version to install velocyto with pip
CC=/opt/homebrew/bin/gcc-12 pip install velocyto

# install celloracle
pip install celloracle

It works! Thanks!

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

4 participants