Installation Errors on CentOS 7
I ran into a number of issues installing libStatGen version 1.0.14 on a CentOS 7 machine. I have the following prerequisite packaged installed via yum:
zlib.i686 1.2.7-17.el7
zlib.x86_64 1.2.7-17.el7
zlib-devel.x86_64 1.2.7-17.el7
openssl.x86_64 1:1.0.2k-21.el7_9
openssl-devel.x86_64 1:1.0.2k-21.el7_9
openssl-libs.x86_64 1:1.0.2k-21.el7_9
gcc-c++.x86_64 4.8.5-28.el7
When running make I get an issue with the -Werror flag.
g++ -O4 -pipe -Wall -Werror -Wno-strict-overflow -I../include -I. -D__ZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -D__STDC_LIMIT_MACROS -o obj/Chromosome.o -c Chromosome.cpp -DVERSION="\"1.0.0\""
Chromosome.cpp: In constructor ‘Chromosome::Chromosome(const string&, unsigned int, bool)’:
Chromosome.cpp:42:15: error: ‘*<unknown>.Chromosome::gs’ is used uninitialized in this function [-Werror=uninitialized]
if (this->gs) delete gs;
~~~~~~^~
cc1plus: all warnings being treated as errors
make[1]: *** [obj/Chromosome.o] Error 1
make[1]: Leaving directory `/opt/apps/libstatgen/1.0.14/general'
make: *** [general] Error 2
I was able to change the line calling the flag in general/Makefile. Removing the flag allowed for the installation to complete but when testing the installation with make test I run into the following error:
mkdir -p results && ./inputFileTest > results/results.log && diff data/InputFileTest.bam results/bgzfFile.glf && diff data/InputFileTest.txt results/defaultFile.glf && diff data/InputFileTest.gz results/defaultFile.gz && diff data/InputFileTest.gz results/gzipFile.glf && diff data/InputFileTest.txt results/InputFileTest.glf && diff data/InputFileTest.txt results/uncompressedFile.glf && diff data/textFile.gz results/textFile.gz && diff data/textFile.gz results/textFile1.gz && diff results/results.log expected/results.log
inputFileTest: InputFileTest.cpp:697: void IFILE_Test::test_ifread_ifgetc(const char*): Assertion `numBytesRead == DEFAULT_BUFFER_SIZE + 3' failed.
/bin/sh: line 1: 15262 Aborted ./inputFileTest > results/results.log
make[3]: *** [test] Error 134
make[2]: *** [inputFileTest] Error 2
make[1]: *** [test] Error 2
make[1]: Leaving directory `/opt/apps/libstatgen/1.0.14/general'
make: *** [general] Error 2
I am assuming that the installation succeeded because the errors presented by Werror are superficial and involve code cleanliness instead of outright installation failures. However, the issues presented above ought to be fixed to keep the project clean and easy to use. Please let me know if there is anything you need from me.
Thanks!
Please try v1.0.15, which was just released.
On the same system using GCC 8.2.0 I installed and tested the new release and I still ran into the following error:
mkdir -p results && ./inputFileTest > results/results.log && diff data/InputFileTest.bam results/bgzfFile.glf && diff data/InputFileTest.txt results/defaultFile.glf && diff data/InputFileTest.gz results/defaultFile.gz && diff data/InputFileTest.gz results/gzipFile.glf && diff data/InputFileTest.txt results/InputFileTest.glf && diff data/InputFileTest.txt results/uncompressedFile.glf && diff data/textFile.gz results/textFile.gz && diff data/textFile.gz results/textFile1.gz && diff results/results.log expected/results.log
inputFileTest: InputFileTest.cpp:697: void IFILE_Test::test_ifread_ifgetc(const char*): Assertion `numBytesRead == DEFAULT_BUFFER_SIZE + 3' failed.
/bin/sh: line 1: 18615 Aborted ./inputFileTest > results/results.log
make[3]: *** [test] Error 134
make[2]: *** [inputFileTest] Error 2
make[1]: *** [test] Error 2
make[1]: Leaving directory `/opt/apps/libstatgen/1.0.15/general'
make: *** [general] Error 2
Both errors involve the same failed test.
I have edited the last message to change a path for clarification.
I notice that CI/CD is not set up for this repo yet but it might be helpful to detect these errors prior to release. I could work on creating a few config files for this project to test make && make test on a series of operating systems to prevent these issues from occurring. I install bioinformatics apps for a living and I really want to help out the community with the errors that I have been encountering.
I just set up a clean Centos 7 VM and built/tested libStatgen without issue. Did you do a git pull to get the latest version or did you download a clean copy? If the former, you may need to run make clean && make && make test.