UWPR / Comet

An tandem mass spectrometry (MS/MS) sequence database search tool.
https://uwpr.github.io/Comet/
Apache License 2.0
45 stars 13 forks source link

Comet installation as part of OpenMS - Error in MSToolkit (mzIMLTools/CsubSample) #37

Closed CelieDs closed 1 year ago

CelieDs commented 1 year ago

Hi there!

First I wanted to thank you for the great tool! I am trying to use it as part of OpenMS and I encountered an issue I can't figure out. I downloaded the zip file and extracted it in the bin folder of open-ms from : https://github.com/UWPR/Comet/releases/tag/v2023.01.2 Then I opened that folder and typed "make" into it to create the comet.exe file, and this error occurred:

g++ -O3 -static -I. -I./include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DGCC -DHAVE_EXPAT_CONFIG_H /s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/src/mzIMLTools/CMzIdentML.cpp -c -o /s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/obj/CMzIdentML.o
g++ -O3 -static -I. -I./include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DGCC -DHAVE_EXPAT_CONFIG_H /s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/src/mzIMLTools/CSubSample.cpp -c -o /s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/obj/CSubSample.o
/s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/src/mzIMLTools/CSubSample.cpp: In member function ‘void CSubSample::writeOut(FILE*, int)’:
/s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/src/mzIMLTools/CSubSample.cpp:21:12: error: ‘exit’ was not declared in this scope
     exit(69);
            ^
/s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/src/mzIMLTools/CSubSample.cpp:24:42: error: ‘fprintf’ was not declared in this scope
   for (i = 0; i<tabs; i++) fprintf(f, " ");
                                          ^
/s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/src/mzIMLTools/CSubSample.cpp:25:67: error: ‘fprintf’ was not declared in this scope
   fprintf(f, "<SubSample sample_ref=\"%s\"/>\n", sampleRef.c_str());
                                                                   ^
make[1]: *** [/s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/obj/CSubSample.o] Error 1
make[1]: Leaving directory `/s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit'
make: *** [comet.exe] Error 2

Thanks in advance for your help !

Célie

jke000 commented 1 year ago

Without being able to replicate your build environment, I'm just guessing. What happens if you add the following two lines to the list of #include statments at the head of /s/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/MSToolkit/CSubSample.h:

#include <stdio.h>
#include <stdlib.h>

Unfortunately if you're encountering those build errors, I suspect you'll face others as well (as opposed to everything magically compiling w/o errors with the 'make' command). What is the operating system you're using?

CelieDs commented 1 year ago

Hello!

Thank you for your prompt reply and sorry for the lack of information regarding the building environment. I am working on a Linux environment with Centos7. I am trying to install Comet in a conda environment where only OpenMS (v.2.8) is installed, in order to integrate the different steps of processing of my data into a Nextflow pipeline.

When adding those two lines in CSubSample.h, and relaunching 'make' I get the following error :

make[1]: Leaving directory `/s
/scratch/envconda/env/nf-openms_2.8/bin/comet/Comet-2023.01.2/CometSearch'
g++ Comet.o -o comet.exe -O3 -static -std=c++11 -fpermissive -Wall -Wextra -Wno-char-subscripts -DGITHUBSHA='""' -DCURL_STATICLIB -DHTTP_ONLY -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__LINUX__ -D_NOSQLITE -IMSToolkit/include -IMSToolkit/src/expat-2.2.9/lib -IMSToolkit/src/zlib-1.2.11 -ICometSearch -LMSToolkit -LCometSearch -lcometsearch -lmstoolkitlite -lm -lpthread 
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [comet.exe] Error 1

Thanks in advance,

Célie

CelieDs commented 1 year ago

Hello again,

I just found a workaround to use Comet in my pipeline. It is actually possible to download a conda environment containing all the OpenMS third parties already installed (https://anaconda.org/bioconda/openms-thirdparty). Thus, launching Comet from this environment solved my problem :)

Thanks again for your time,

Célie

jke000 commented 1 year ago

Another option is to download the compiled linux binary distributed here (comet.linux.exe, make it executable with "chmod +x comet.linux.exe") and run that Comet on your system. Also, all of those "/usr/bin/ld" linker errors are due to missing components of your build environment. Some combination of glibc-devel, glibc-static, libstdc++-devel, libstdc++-static are needed. I'd install them all aka "yum install glibc-devel, glibc-static, libstdc++-devel, libstdc++-static" which would hopefully fix the compile. Anyways, glad you found a solution.