mnnpy icon indicating copy to clipboard operation
mnnpy copied to clipboard

Does not install on macOS

Open veghp opened this issue 6 years ago • 13 comments

Tried installing this for scanpy, as recommended (pip install mnnpy), on a macOS High Sierra (v10.13.4) within a Miniconda environment, but it returns an error:

clang: error: unsupported option '-fopenmp'
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for mnnpy

From what I've read online, clang on OSX is different, which may be the problem. Is there a way to install mnnpy on Mac?

veghp avatar Jul 30 '18 11:07 veghp

I'm having exactly the same issue

clang: error: unsupported option '-fopenmp' error: command 'gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for mnnpy Running setup.py clean for mnnpy Failed to build mnnpy

aopisco avatar Aug 17 '18 01:08 aopisco

I was able to install mnnpy with the homebrew version of gcc 8.2 on OSX 10.13.6. Just had to point to the usable gcc.

export CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8
pip install mnnpy

cfriedline avatar Sep 06 '18 03:09 cfriedline

I also get

clang: error: unsupported option '-fopenmp'
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for mnnpy
Running setup.py clean for mnnpy
Failed to build mnnpy

The above suggestion re: gcc doesn't work for me

bjstewart1 avatar Sep 11 '18 21:09 bjstewart1

@bjstewart1 I'm using mnn through scanpy (https://scanpy.readthedocs.io/en/latest/api/scanpy.api.pp.mnn_correct.html) - have you tried that option?

aopisco avatar Sep 11 '18 21:09 aopisco

@aopisco ideally i'd like to integrate with my R workflow. Scanpy is a bit fiddly in terms of working with reticulate, which is why I thought i'd try mnnpy directly.

bjstewart1 avatar Sep 12 '18 06:09 bjstewart1

@bjstewart1 I see what you mean... may I ask why you don't use the R version from Marioni's lab (in library scater)?

aopisco avatar Sep 12 '18 15:09 aopisco

@aopisco I've got a lot of cells! Looking for a fast implementation of mnncorrect and in R it is really very slow. Their fastMNN works fast - my experience is that whilst it works well for bringing together large clusters, it (?the denoising) seems to hinder identification of rare cell types... Anyway, I thought it would be good to experiment with this implementation of mnncorrect, if I could install it!

bjstewart1 avatar Sep 12 '18 16:09 bjstewart1

In fact, what is more, installation of scanpy on my mac did not include mnnpy (or mnn_correct as it is called there) presumably because it cannot be installed because of this issue:

/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Imnnpy -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c mnnpy/_utils.c -o build/temp.macosx-10.6-intel-3.6/mnnpy/_utils.o -O2 -ffast-math -march=native -fopenmp
  clang: error: unsupported option '-fopenmp'
  clang: error: unsupported option '-fopenmp'
  error: command '/usr/bin/clang' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for mnnpy

bjstewart1 avatar Sep 18 '18 13:09 bjstewart1

After much reinstalling, and steps I almost certainly cannot replicate, it now installs. Required installing llvm from brew and lomp from brew....

bjstewart1 avatar Sep 25 '18 08:09 bjstewart1

Glad you guys could work it out. I was actually developing from my mac but didn't encounter the issue. I may have installed all those deps without knowing...

chriscainx avatar Nov 07 '18 03:11 chriscainx

I was able to install mnnpy with the homebrew version of gcc 8.2 on OSX 10.13.6. Just had to point to the usable gcc.

export CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8
pip install mnnpy

@cfriedline that worked for me.

The following steps worked on two different macs for me

  1. $ brew install gcc --without-multlib
  2. $ export CC=/usr/local/Cellar/gcc/8.2.0/bin/gcc-8
  3. pip install mnnpy

cornhundred avatar Jan 08 '19 22:01 cornhundred

Another thing to try if you are struggling with this is the following slight adjustment to the above recipe

brew install gcc export CC=/usr/local/Cellar/gcc/8.3.0/bin/g++-8 pip install mnnpy

(the relevant adjustment is g++ instead of gcc, not the version number ;-) )

This worked for me in an anaconda environment on MacOS Mojave.

LiBuchauer avatar May 07 '19 10:05 LiBuchauer

Hi,

I tried the solutions you guys mentioned, but I still can not install mnnpy package. What should I do?

yzcv avatar Nov 03 '19 09:11 yzcv