compomics / ms2pip

MS²PIP: Fast and accurate peptide spectrum prediction for multiple fragmentation methods, instruments, and labeling techniques.
https://ms2pip.readthedocs.io
Apache License 2.0
35 stars 18 forks source link

Potential issue with the C compiler on OS X #19

Closed ukirik closed 3 years ago

ukirik commented 6 years ago

Hi, I am trying to run MS2PIP locally, and during the compile step I get the following error:

clang: error: unknown argument: '-fno-var-tracking-assignments' error: command 'gcc' failed with exit status 1

A google search on the error message took me to another issue tracker ( https://groups.google.com/forum/#!topic/fix8-support/zaZvsMsS7II ) where following statement caught my attention:

g++-4.2.1 on mac does not support -fno-var-tracking-assignments.

Is it something that can be circumvented?

sdgroeve commented 6 years ago

Hi The flag will speed-up the compilation. Could you try compiling without the flag? It it works, please let us known.

yangminglintw commented 6 years ago

Hi, I use Anaconda python, and I have the same problem. I try conda install gcc and the problem is solved.

swillems commented 4 years ago

Hi guys,

Two years have passed and nowadays ms2pip is available on both conda and PyPi. Unfortunately, pip install ms2pip on OSX still gives the same error, due to the same reason. Cloning the github repo and removing line 69 with the statement "-fno-var-tracking-assignments" from setup.py with e.g. the command script:

git clone https://github.com/compomics/ms2pip_c.git
cd ms2pip_c
sed -i .bak '/-fno-var-tracking-assignments/d' setup.py
pip install cython
pip install .

allows me to install ms2pip without issues on OSX, even though installation is slow and takes between 15 minutes and an hour or so...

Is it feasible to include this directly in PyPi for end-user simplicity, worst case with a version flag or something?

Best, Sander

RalfG commented 4 years ago

Hi @swillems! Good point, macos support should be easy to implement. I'll try to publish precompiled wheels for macos to PyPI (and conda if it works), build with GitHub Actions. In that way, installation time for end-users should be just a few seconds. Compiling the decision trees does take some time, especially on macos apparently... I'll see if it works.

swillems commented 4 years ago

Excellent!

Minor note of interest. This does require me to do a brew install gcc as well (and perhaps more, but I'm not resetting my system to test this properly). Perhaps there are also opportunities with conda install gcc, but this seem to require specific versioning of gcc and feels less intuitive. If possible this should be incorporated in a pypi wheel, but no idea how feasible this is and I'll leave that up to you.

RalfG commented 3 years ago

macOS builds for ms2pip 3.6.2 are now on PyPI. Can you try installing with pip install ms2pip? I guess you don't need gcc to install the prebuild wheels?

swillems commented 3 years ago

Works like a charm on my machine with a fresh conda env. Great job!

While we are on the topic: I haven't actually checked if this works on Windows as well, care to comment?

RalfG commented 3 years ago

I think there are still a few non-POSIX compliant things going on in MS²PIP, so for now it's only Linux and macOS. Until that is fixed, WSL is the way to go for MS²PIP on Windows (as is the case for bioconda as well).

RalfG commented 2 years ago

Hi @swillems,

As of version 3.8.0, MS²PIP can be installed on Windows: https://github.com/compomics/ms2pip_c/releases/tag/v3.8.0

Best, Ralf