gymreklab / GangSTR

A tool for profiling long STRs from short reads
GNU General Public License v2.0
85 stars 16 forks source link

Cannot build with the latest version #89

Closed Z-Zen closed 4 years ago

Z-Zen commented 4 years ago

Hello,

I was trying to install GangSTR on my debian machine. I installed the required libraries as mentioned in the pre-requisites. When compiling the software, I encountering the following error:

make  all-recursive
make[1]: Entering directory '/media/Script/prog/TandemRepeatSoftwares/GangSTR'
Making all in m4
make[2]: Entering directory '/media/Script/prog/TandemRepeatSoftwares/GangSTR/m4'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/media/Script/prog/TandemRepeatSoftwares/GangSTR/m4'
Making all in src
make[2]: Entering directory '/media/Script/prog/TandemRepeatSoftwares/GangSTR/src'
g++ -DHAVE_CONFIG_H -I. -I..  -I../src/ -I..  -I/usr/local/include    -g -O2  -D_GIT_VERSION="\"2.4.3.3-faac\"" -D_MACHTYPE="\"x86_64\"" -std=c++11      -g -O2  -D_GIT_VERSION="\"2.4.3.3-faac\"" -D_MACHTYPE="\"x86_64\"" -std=c++11 -MT GangSTR-main_gangstr.o -MD -MP -MF .deps/GangSTR-main_gangstr.Tpo -c -o GangSTR-main_gangstr.o `test -f 'main_gangstr.cpp' || echo './'`main_gangstr.cpp
In file included from ../src/bam_info_extract.h:26:0,
                 from main_gangstr.cpp:28:
../src/bam_io.h: In member function ‘bool BamCramReader::file_exists(const string&)’:
../src/bam_io.h:458:34: error: ‘F_OK’ was not declared in this scope
     return (access(path.c_str(), F_OK) != -1);
                                  ^~~~
../src/bam_io.h:458:38: error: ‘access’ was not declared in this scope
     return (access(path.c_str(), F_OK) != -1);
                                      ^
In file included from ../src/bam_info_extract.h:26:0,
                 from main_gangstr.cpp:28:
../src/bam_io.h: In copy constructor ‘BamAlignment::BamAlignment(const BamAlignment&)’:
../src/bam_io.h:77:26: warning: ignoring return value of ‘bam1_t* bam_copy1(bam1_t*, const bam1_t*)’, declared with attribute warn_unused_result [-Wunused-result]
     bam_copy1(b_, aln.b_);
                          ^
Makefile:587: recipe for target 'GangSTR-main_gangstr.o' failed
make[2]: *** [GangSTR-main_gangstr.o] Error 1
make[2]: Leaving directory '/media/Script/prog/TandemRepeatSoftwares/GangSTR/src'
Makefile:442: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/media/Script/prog/TandemRepeatSoftwares/GangSTR'
Makefile:374: recipe for target 'all' failed
make: *** [all] Error 2

Do you have any idea what can be the issue ?

Thanks.

nmmsv commented 4 years ago

thanks for reaching out! I haven't seen this issue, and I think it may be due to a compiler incompatibility. It seems like one easy fix is to add #include <unistd.h> to the file that causes the error. I have added this line and pushed to the master branch. Can you try it out to see if it works on your end?

Z-Zen commented 4 years ago

@nmmsv sure ! I will try it out, thanks for your work !

Z-Zen commented 4 years ago

Alright, I just tested it and I was able to compile ! Thanks a lot.

nmmsv commented 4 years ago

Perfect, please let me know if there were other issues!