statgen / fastQValidator

Validate FastQ Files
36 stars 10 forks source link

Problem compiling in Ubuntu #20

Open sharpo1 opened 5 years ago

sharpo1 commented 5 years ago

Hi. I downloaded the version containing both the FastQValidator and LibStatGen from: https://genome.sph.umich.edu/w/images/2/20/FastQValidatorLibStatGen.0.1.1a.tgz

Then I unzipped the package. Then cd into the directory and then typed "make all". Below is the error I get. Any idea what is wrong?


Error Message: make[1]: Entering directory /home/sharpo/linux-bi-tools/fastQValidator_0.1.1a/libStatGen' make[2]: Entering directory/home/sharpo/linux-bi-tools/fastQValidator_0.1.1a/libStatGen/samtools' ln -s ../samtools/bgzf.h ../include/bgzf.h ln -s ../samtools/knetfile.h ../include/knetfile.h ln -s ../samtools/khash.h ../include/khash.h ln -s ../samtools/bam.h ../include/bam.h mkdir -p obj gcc -O4 -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/bgzf.o -c bgzf.c gcc -O4 -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/knetfile.o -c knetfile.c ar -cru ../libStatGen.a obj/bgzf.o obj/knetfile.o mkdir -p obj/debug gcc -ggdb -O0 -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/debug/bgzf.o -c bgzf.c gcc -ggdb -O0 -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/debug/knetfile.o -c knetfile.c ar -cru ../libStatGen_debug.a obj/debug/bgzf.o obj/debug/knetfile.o mkdir -p obj/profile gcc -pg -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/profile/bgzf.o -c bgzf.c gcc -pg -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/profile/knetfile.o -c knetfile.c ar -cru ../libStatGen_profile.a obj/profile/bgzf.o obj/profile/knetfile.o make[2]: Leaving directory /home/sharpo/linux-bi-tools/fastQValidator_0.1.1a/libStatGen/samtools' make[2]: Entering directory/home/sharpo/linux-bi-tools/fastQValidator_0.1.1a/libStatGen/general' ln -s ../general/BaseAsciiMap.h ../include/BaseAsciiMap.h ln -s ../general/BaseQualityHelper.h ../include/BaseQualityHelper.h ln -s ../general/BaseUtilities.h ../include/BaseUtilities.h ln -s ../general/BasicHash.h ../include/BasicHash.h ln -s ../general/BgzfFileType.h ../include/BgzfFileType.h ln -s ../general/BgzfFileTypeRecovery.h ../include/BgzfFileTypeRecovery.h ln -s ../general/CharBuffer.h ../include/CharBuffer.h ln -s ../general/Chromosome.h ../include/Chromosome.h ln -s ../general/Cigar.h ../include/Cigar.h ln -s ../general/CigarRoller.h ../include/CigarRoller.h ln -s ../general/Error.h ../include/Error.h ln -s ../general/FileType.h ../include/FileType.h ln -s ../general/FortranFormat.h ../include/FortranFormat.h ln -s ../general/GenomeSequence.h ../include/GenomeSequence.h ln -s ../general/GenotypeLists.h ../include/GenotypeLists.h ln -s ../general/glfHandler.h ../include/glfHandler.h ln -s ../general/GzipFileType.h ../include/GzipFileType.h ln -s ../general/GzipHeader.h ../include/GzipHeader.h ln -s ../general/Hash.h ../include/Hash.h ln -s ../general/Input.h ../include/Input.h ln -s ../general/InputFile.h ../include/InputFile.h ln -s ../general/IntArray.h ../include/IntArray.h ln -s ../general/IntHash.h ../include/IntHash.h ln -s ../general/LongHash.h ../include/LongHash.h ln -s ../general/LongLongCounter.h ../include/LongLongCounter.h ln -s ../general/MapFunction.h ../include/MapFunction.h ln -s ../general/MathMatrix.h ../include/MathMatrix.h ln -s ../general/MathVector.h ../include/MathVector.h ln -s ../general/MemoryAllocators.h ../include/MemoryAllocators.h ln -s ../general/MemoryInfo.h ../include/MemoryInfo.h ln -s ../general/MemoryMapArray.h ../include/MemoryMapArray.h ln -s ../general/MemoryMap.h ../include/MemoryMap.h ln -s ../general/MiniDeflate.h ../include/MiniDeflate.h ln -s ../general/NonOverlapRegions.h ../include/NonOverlapRegions.h ln -s ../general/Parameters.h ../include/Parameters.h ln -s ../general/PedigreeAlleleFreq.h ../include/PedigreeAlleleFreq.h ln -s ../general/Pedigree.h ../include/Pedigree.h ln -s ../general/PedigreeDescription.h ../include/PedigreeDescription.h ln -s ../general/PedigreeFamily.h ../include/PedigreeFamily.h ln -s ../general/PedigreeGlobals.h ../include/PedigreeGlobals.h ln -s ../general/PedigreePerson.h ../include/PedigreePerson.h ln -s ../general/QuickIndex.h ../include/QuickIndex.h ln -s ../general/Random.h ../include/Random.h ln -s ../general/ReferenceSequence.h ../include/ReferenceSequence.h ln -s ../general/SmithWaterman.h ../include/SmithWaterman.h ln -s ../general/Sort.h ../include/Sort.h ln -s ../general/STLUtilities.h ../include/STLUtilities.h ln -s ../general/StringAlias.h ../include/StringAlias.h ln -s ../general/StringArray.h ../include/StringArray.h ln -s ../general/StringBasics.h ../include/StringBasics.h ln -s ../general/StringHash.h ../include/StringHash.h ln -s ../general/StringMap.h ../include/StringMap.h ln -s ../general/TrimSequence.h ../include/TrimSequence.h ln -s ../general/UncompressedFileType.h ../include/UncompressedFileType.h ln -s ../general/WindowsHelper.h ../include/WindowsHelper.h ln -s ../general/Constant.h ../include/Constant.h ln -s ../general/CSG_MD5.h ../include/CSG_MD5.h ln -s ../general/Generic.h ../include/Generic.h ln -s ../general/GenomeSequenceHelpers.h ../include/GenomeSequenceHelpers.h ln -s ../general/GreedyTupleAligner.h ../include/GreedyTupleAligner.h ln -s ../general/InplaceMerge.h ../include/InplaceMerge.h ln -s ../general/LongInt.h ../include/LongInt.h ln -s ../general/MathConstant.h ../include/MathConstant.h ln -s ../general/PackedVector.h ../include/PackedVector.h ln -s ../general/PedigreeAlleles.h ../include/PedigreeAlleles.h ln -s ../general/Performance.h ../include/Performance.h ln -s ../general/SimpleStats.h ../include/SimpleStats.h ln -s ../general/UnitTest.h ../include/UnitTest.h g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/BaseAsciiMap.o -c BaseAsciiMap.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/BaseQualityHelper.o -c BaseQualityHelper.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/BaseUtilities.o -c BaseUtilities.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/BasicHash.o -c BasicHash.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/BgzfFileType.o -c BgzfFileType.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/BgzfFileTypeRecovery.o -c BgzfFileTypeRecovery.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/CharBuffer.o -c CharBuffer.cpp -DVERSION="\"1.0.5\"" g++ -O4 -Werror -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/Chromosome.o -c Chromosome.cpp -DVERSION="\"1.0.5\"" In file included from GenomeSequence.h:47:0, from Chromosome.h:4, from Chromosome.cpp:2: GenomeSequenceHelpers.h: In member function ‘void ChromosomeInfo::setSpecies(const char)’: GenomeSequenceHelpers.h:67:44: error: argument to ‘sizeof’ in ‘char strncpy(char, const char, size_t)’ call is the same expression as the source; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] strncpy(species, newSpecies, sizeof(newSpecies)); ^ cc1plus: all warnings being treated as errors make[2]: [obj/Chromosome.o] Error 1 make[2]: Leaving directory `/home/sharpo/linux-bi-tools/fastQValidator_0.1.1a/libStatGen/general' make[1]: [general] Error 2 make[1]: Leaving directory `/home/sharpo/linux-bi-tools/fastQValidator_0.1.1a/libStatGen' make: *** [libStatGen/] Error 2

mktrost commented 5 years ago

There are two ways to solve this issue: 1) download the latest version of libStatGen, 2) make a few changes to the version of libStatGen that you have.

1) If you just want to switch to the latest version, it can be found here: https://github.com/statgen/libStatGen (the master branch). With this solution, you do not need to edit any files.

2) Make edits to the version of libStatGen you have to get it to compile (these edits are included in the latest version of libStatGen in option 1).
a) Edit libStatGen/general/GenomeSequenceHelpers.h and libStatGen/general/MemoryMapArray.h as seen here: https://github.com/statgen/libStatGen/commit/8efb024b92e2aa417b127bc3703d178d4530b828 b) Here are the resolutions to additional compile issues (that you haven't hit yet): Edit: libStatGen/general/PedigreeLoader.cpp, line 639 from "int" to "bool" https://github.com/statgen/libStatGen/commit/25b5257a4db5273f44ea5a57a7ae24ce01b4ad68 c) You may also need to update libStatGen/general/Makefile to replace: USER_WARNINGS ?= -Werror with USER_WARNINGS ?= -Wno-strict-overflow

Please let me know if you have questions on how to do either of these. Also, please let me know if you are able to get it to work or if you run into any additional issues.

xapple commented 4 years ago

I was also trying to install fastQValidator and encountered the same problem. It seems like we are not the only ones as the three last issues opened in the tracker concern compilation errors.

The first thing to note is that the official distribution that appears on this page is outdated:

https://genome.sph.umich.edu/wiki/FastQValidator

If you download that tgz file mentioned below and type make it will not work.

https://genome.sph.umich.edu/w/images/2/20/FastQValidatorLibStatGen.0.1.1a.tgz

I would recommend that the author removes this old distribution to avoid other users encountering the same problem and getting discouraged. Instead, the author should publish a simple installation procedure that is tested on a fresh installation of Ubuntu 20 LTS. Or alternatively a precompiled binary.

In the current state, the only way to install it is to clone both repositories from github and compile them separately.

Since I wanted to use this program, I did just that. And I recorded the procedure. If you type the following commands on a newly created virtual machine where you are sudoer, you will get a working copy of fastQValidator. Simple.

$ sudo apt-get update
$ sudo apt-get install python3-pip ipython3
$ pip3 install --user fasta
$ ipython3

In [1]: from fasta.validator import Validator

In [2]: Validator.install("~/programs/fastQValidator/")

In [3]: exit()

$ export PATH=$HOME/programs/fastQValidator:$PATH
$ fastQValidator
ERROR: No filename specified.  See below for usage help. [...]

How about creating a README.md file in the repository root and including these instructions? This would help users greatly I think.