gymreklab / GangSTR

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

Interesting Compiling issue #101

Closed MrDotOne closed 3 years ago

MrDotOne commented 3 years ago

I am attempting to install GangSTR on the HPC that i adminstrate, and i am using gcc/5.4.0, htslib/1.9. nlopt/2.4.2 and gsl/2.5. My configuration is:

./configure --prefix=/cm/shared/apps/GangSTR/2.4.6 HTSLIB_CFLAGS="-I$htslib_CF -I$nlopt_CF" HTSLIB_LIBS="-L$htslib_LD -L$nlopt_LD

where the CF and LD variables point to the appropriate things. When i go to compiled i get the following rather odd errror: ... g++ -DHAVE_CONFIG_H -I. -I.. -I../src/ -I.. -I -I -g -O2 -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\"" -std=c++11 -g -O2 -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\"" -std=c++11 -MT GangSTR-str_info.o -MD -MP -MF .deps/GangSTR-str_info.Tpo -c -o GangSTR-str_info.o test -f 'str_info.cpp' || echo './'str_info.cpp mv -f .deps/GangSTR-str_info.Tpo .deps/GangSTR-str_info.Po /bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\"" -std=c++11 -g -O2 -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\"" -std=c++11 -lgsl -lgslcblas -lm -L -L -lnlopt_cxx -lm -o GangSTR GangSTR-main_gangstr.o GangSTR-common.o GangSTR-options.o GangSTR-locus.o GangSTR-region_reader.o GangSTR-gc_region_reader.o GangSTR-ref_genome.o GangSTR-genotyper.o GangSTR-read_class.o GangSTR-frr_class.o GangSTR-flanking_class.o GangSTR-enclosing_class.o GangSTR-spanning_class.o GangSTR-likelihood_maximizer.o GangSTR-mathops.o GangSTR-read_extractor.o GangSTR-bam_io.o GangSTR-sample_info.o GangSTR-stringops.o GangSTR-read_pair.o GangSTR-realignment.o GangSTR-ssw.o GangSTR-ssw_cpp.o GangSTR-vcf_writer.o GangSTR-bam_info_extract.o GangSTR-str_info.o -lgsl -lgslcblas -lm -L -L -lnlopt_cxx -lm libtool: error: require no space between '-L' and '-L' make[2]: [GangSTR] Error 1 make[2]: Leaving directory `/root/temp/GangSTR-2.4.6/src' make[1]: [all-recursive] Error 1 make[1]: Leaving directory `/root/temp/GangSTR-2.4.6' make: *** [all] Error 2

Any thoughts? I would appreciate any pointers.

MrDotOne commented 3 years ago

Turns out this was bad substitution on my part, i fixed that, but now get a completely different error:

/root/temp/GangSTR-2.4.6/src/../src/bam_io.h:206: undefined reference to bam_aux_get' /root/temp/GangSTR-2.4.6/src/../src/bam_io.h:209: undefined reference tobam_aux2Z' GangSTR-bam_info_extract.o: In function BamAlignment::BamAlignment()': /root/temp/GangSTR-2.4.6/src/../src/bam_io.h:67: undefined reference tobam_init1' GangSTR-bam_info_extract.o: In function BamAlignment::~BamAlignment()': /root/temp/GangSTR-2.4.6/src/../src/bam_io.h:98: undefined reference tobam_destroy1' GangSTR-bam_info_extract.o: In function BamAlignment::GetStringTag(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const': /root/temp/GangSTR-2.4.6/src/../src/bam_io.h:206: undefined reference tobam_aux_get' /root/temp/GangSTR-2.4.6/src/../src/bam_io.h:209: undefined reference to bam_aux2Z' collect2: error: ld returned 1 exit status make[2]: *** [GangSTR] Error 1 make[2]: Leaving directory/root/temp/GangSTR-2.4.6/src' make[1]: [all-recursive] Error 1 make[1]: Leaving directory `/root/temp/GangSTR-2.4.6' make: [all] Error 2

nmmsv commented 3 years ago

Hello, Glad the first issue was fixed. Regarding the second problem, can you confirm that you have installed all the third-party packages?

GangSTR requires third party packages nlopt, gsl, and htslib.

MrDotOne commented 3 years ago

I have them installed as module files on the HPC:

[root@cc-dclrilog51 GangSTR-2.4.6]# module list Currently Loaded Modulefiles: 1) shared 3) cmsh 5) cluster-tools/7.0 7) gcc/5.4.0 9) gsl/2.5 2) cmgui/7.0 4) cmd 6) slurm/14.03.0 8) nlopt/2.4.2 10) htslib/1.9

i even explicitely export the LD and CFs:

[root@cc-dclrilog51 GangSTR-2.4.6]# export htslib_LD="/cm/shared/apps/htslib/1.9/lib" [root@cc-dclrilog51 GangSTR-2.4.6]# export htslib_CF="/cm/shared/apps/htslib/1.9/include/htslib" [root@cc-dclrilog51 GangSTR-2.4.6]# export nlopt_LD="/cm/shared/apps/nlopt/2.4.2/lib" [root@cc-dclrilog51 GangSTR-2.4.6]# export nlopt_CF="/cm/shared/apps/nlopt/2.4.2/include"

[root@cc-dclrilog51 GangSTR-2.4.6]# echo $htslib_LD /cm/shared/apps/htslib/1.9/lib

[root@cc-dclrilog51 GangSTR-2.4.6]# ./configure --prefix=/cm/shared/apps/GangSTR/2.4.6 HTSLIB_CFLAGS="-I$htslib_CF -I$nlopt_CF" HTSLIB_LIBS="-L$htslib_LD -L$nlopt_LD" checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports the include directive... yes (GNU style) checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for ar... ar checking the archiver (ar) interface... ar checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 3458764513820540925 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for GSL... yes checking for HTSLIB... yes checking for NLOPT... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating m4/Makefile config.status: creating Makefile config.status: creating src/Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands

Configuration summary for GangSTR version 2.4.6 CFLAGS: -g -O2 -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\"" CPPFLAGS: CXXFLAGS: -g -O2 -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\"" -std=c++11 LDFLAGS: HTSLIB_LIBS: -L/cm/shared/apps/htslib/1.9/lib -L/cm/shared/apps/nlopt/2.4.2/lib HTSLIB_CFLAGS: -I/cm/shared/apps/htslib/1.9/include/htslib -I/cm/shared/apps/nlopt/2.4.2/include GANGSTR_CFLAGS: -D_GIT_VERSION="\"2.4.6\"" -D_MACHTYPE="\"x86_64\""

Default installtion directories: programs: /cm/shared/apps/GangSTR/2.4.6/bin/

To change installtion path, use: ./configure --prefix NEW-PATH

and it sees it in the config, just the make is failing.

nmmsv commented 3 years ago

I checked the output from configure on my end, and it's mostly similar, except it has an additional term -lhts in HTSLIB_LIBS variable. Can you please check if manually adding that helps? Full disclosure: I'm not really familiar with build issues (working on it), I appreciate your patience.

MrDotOne commented 3 years ago

That actually worked! Thank you, and no worries about the building issues, it happens, and i am NOT a programmer in any sense of the word. I will let the end user know so they can test it.

Thank you again for your help.

nmmsv commented 3 years ago

That's great to hear! Please let me know if there were any other issues. Best, Nima