Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building from source: libStatGen #61

Open
moldach opened this issue Jan 15, 2021 · 3 comments
Open

Error building from source: libStatGen #61

moldach opened this issue Jan 15, 2021 · 3 comments

Comments

@moldach
Copy link

moldach commented Jan 15, 2021

I'm working on a Linux based HPC working with private data hence the environment is restrictive (no internet connection); therefore packages must be built from source.

After downloading the file and transferring it to the cluster I try to build by specifying the PATH for libStatGen but I get an error:

$ wget https://github.com/statgen/bamUtil/archive/v1.0.14.tar.gz

$ tar -zxvf v1.0.14.tar.gz
$ cd bamUtil-1.0.14
$ make LIB_PATH_GENERAL=/project/M-mtgraovac182840/tools/libStatGen
make[1]: Entering directory '/project/M-mtgraovac182840/tools/bamUtil-1.0.14/src'
make -C /project/M-mtgraovac182840/tools/libStatGen --no-print-directory opt
ar -cru ../libStatGen.a obj/bgzf.o obj/knetfile.o
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[3]: *** [../Makefiles/Makefile.common:81: obj/Chromosome.o] Error 1
make[2]: *** [Makefiles/Makefile.base:15: general] Error 2
make[1]: *** [/project/M-mtgraovac182840/tools/libStatGen/Makefiles/Makefile.ext:50: /project/M-mtgraovac182840/tools/libStatGen/libStatGen.a] Error 2
make[1]: Leaving directory '/project/M-mtgraovac182840/tools/bamUtil-1.0.14/src'
make: *** [/project/M-mtgraovac182840/tools/libStatGen/Makefiles/Makefile.base:15: src] Error 2
@jonathonl
Copy link
Contributor

This is already fixed in the master branch of libStatGen. You can download at https://github.com/statgen/libStatGen/archive/master.zip.

@moldach
Copy link
Author

moldach commented Jan 27, 2021

Hi @jonathonl I've tried following the build instructions using the latest master branch of libStatGen but I'm getting an error still:

$ wget https://github.com/statgen/bamUtil/archive/v1.0.14.tar.gz
$ tar zxvf v1.0.14.tar.gz
$ cd bamUtil-1.0.14
$ wget https://github.com/statgen/libStatGen/archive/master.zip
$ unzip master.zip
$ make all
make[1]: Entering directory '/project/M-mtgraovac182840/tools/bamUtil-1.0.14/src'
make -C ../../libStatGen --no-print-directory opt
ar -cru ../libStatGen.a obj/bgzf.o obj/knetfile.o
g++  -O4 -pipe -Wall -Werror  -Wno-strict-overflow -I../include -I.   -D__ZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=6                                                                                                                    4 -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=uniniti                                                                                                                    alized]
     if (this->gs) delete gs;
         ~~~~~~^~
cc1plus: all warnings being treated as errors
make[3]: *** [../Makefiles/Makefile.common:81: obj/Chromosome.o] Error 1
make[2]: *** [Makefiles/Makefile.base:15: general] Error 2
make[1]: *** [../../libStatGen/Makefiles/Makefile.ext:50: ../../libStatGen/libStatGen.a] Error 2
make[1]: Leaving directory '/project/M-mtgraovac182840/tools/bamUtil-1.0.14/src'
make: *** [../libStatGen/Makefiles/Makefile.base:15: src] Error 2

@jonathonl
Copy link
Contributor

bamUtil is looking for libStatGen in the location "../libStatGen" relative to the bamUtil folder. You unzipped master.zip in the bamUtil directory instead in the parent directory. Also, master.zip unzips into a directory called libStatGen-master and bamUtil expects it to be called libStatGen.

From the bamUtil directory, you could run:

mv ../libStatGen ../libStatGen.bak && mv libStatGen ../libStatGen && make clean && make

Or, better yet, you could:

cd ../libStatGen && git pull && cd ../bamUtil && make clean && make

Or you could edit ../libStatGen/general/Makefile and remove -Werror so that it doesn't error on warnings. The source code that is failing doesn't get used by bamUtil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants