Install BatVI on Ubuntu
1
0
Entering edit mode
6.1 years ago

Dear all,

I am trying to install a software called BatVI, required for the identification of virus integrants. The README file states that the installation is obtained by launching the build.sh file. From previous trials and discussion with Dr Chandana Tennakoon (one of the authors), I understood the problem is due to the way Ubuntu handles the floating point. In particular there are exceptions when building a sub-routine for BatVI (called BatMis), so I got erros such as: undefined reference to 'log10', undefined reference to 'pow', undefined reference to 'log' and undefined reference to 'exp'. A portion of the log file is provided at the end. There are also errors during the compiling binaries step.

Any tips on how to resolve this problem?

Thank you

    $ ./build.sh
    ./build.sh: 1: [: unexpected operator
   [BREAK]
    ==========================================================
    COMPILING BatMis
    ==========================================================
    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 for g++... g++
    checking for C++ compiler default output file name... a.out
    checking whether the C++ compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables... 
    [BREAK]
    checking for _doprnt... no
    checking for floor... no
    checking for pow... no
    checking for sqrt... no
    checking Checking for SIMD support and for a gcc bug...... OK...
    configure: creating ./config.status
   [BREAK]
    make[1]: Entering directory '/usr/local/lib/batvi/BatMis-3.00'
    Making all in scripts
   [BREAK]
    make[2]: Entering directory '/usr/local/lib/batvi/BatMis-3.00/src'
    gcc -DHAVE_CONFIG_H -I. -I..    -w -O3 -funroll-loops -maccumulate-outgoing-args -msse2 -lm -g -O2 -MT adler32.o -MD -MP -MF .deps/adler32.Tpo -c -o adler32.o adler32.c
    mv -f .deps/adler32.Tpo .deps/adler32.Po
       [BREAK]
    ar cru libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 
    ar: `u' modifier ignored since `D' is the default (see `U')
       [BREAK]
    gcc -w -O3 -funroll-loops -maccumulate-outgoing-args -msse2 -lm -g -O2   -o bwtformatdb bwtformatdb.o BWT.o BWTConstruct.o MiscUtilities.o MemManager.o TextConverter.o r250.o QSufSort.o iniparser.o inistrlib.o dictionary.o DNACount.o Timing.o Socket.o HSP.o HSPstatistic.o karlin.o  
    HSP.o: In function `HSPAllocateHistogram':
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3244: undefined reference to `log10'
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3244: undefined reference to `log10'
    HSP.o: In function `HSPPrintHistogram':
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3303: undefined reference to `log10'
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3303: undefined reference to `pow'
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3307: undefined reference to `log10'
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3307: undefined reference to `pow'
    HSP.o: In function `HSPCountEvalueToHistogram':
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3284: undefined reference to `log10'
    /usr/local/lib/batvi/BatMis-3.00/src/HSP.c:3284: undefined reference to `log10'
    HSPstatistic.o: In function `stat_calcLengthAdjust':
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:203: undefined reference to `log'
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:203: undefined reference to `log'
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:203: undefined reference to `log'
    HSPstatistic.o: In function `initializeHSPstatistic':
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:127: undefined reference to `log'
    HSPstatistic.o: In function `stat_ungapCalcEvalue':
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:315: undefined reference to `pow'
    HSPstatistic.o: In function `stat_ungapEvalue2nominal':
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:323: undefined reference to `log'
    HSPstatistic.o: In function `stat_gapEvalue2nominal':
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:354: undefined reference to `log'
    HSPstatistic.o: In function `calcUngapCutoffScore':
    /usr/local/lib/batvi/BatMis-3.00/src/HSPstatistic.c:228: undefined reference to `log'
    karlin.o: In function `BlastKarlinLHtoK':
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:168: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:210: undefined reference to `pow'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:245: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:245: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:241: undefined reference to `pow'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:242: undefined reference to `exp'
    karlin.o: In function `BlastKarlinLambdaBis':
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:277: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:278: undefined reference to `pow'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:294: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:295: undefined reference to `pow'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:285: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:285: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:285: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:285: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:285: undefined reference to `exp'
    karlin.o:/usr/local/lib/batvi/BatMis-3.00/src/karlin.c:285: more undefined references to `exp' follow
    karlin.o: In function `BlastKarlinLambdaNR':
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:343: undefined reference to `pow'
    karlin.o: In function `BlastKarlinLtoH':
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:381: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:382: undefined reference to `pow'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:393: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:393: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:393: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:393: undefined reference to `exp'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:393: undefined reference to `exp'
    karlin.o:/usr/local/lib/batvi/BatMis-3.00/src/karlin.c:393: more undefined references to `exp' follow
    karlin.o: In function `BlastComputeLengthAdjustment':
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:512: undefined reference to `log'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:541: undefined reference to `log'
    /usr/local/lib/batvi/BatMis-3.00/src/karlin.c:504: undefined reference to `sqrt'
    collect2: error: ld returned 1 exit status
    Makefile:315: recipe for target 'bwtformatdb' failed
    make[2]: *** [bwtformatdb] Error 1
    make[2]: Leaving directory '/usr/local/lib/batvi/BatMis-3.00/src'
    Makefile:256: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/usr/local/lib/batvi/BatMis-3.00'
    Makefile:194: recipe for target 'all' failed
    make: *** [all] Error 2
    if [ -d "bin" ]; then echo bin exists; else mkdir bin; fi
    bin exists
    cp scripts/strip.pl bin 
    cp scripts/b2c.pl bin 
    cp scripts/build_complement bin 
    cp scripts/filter.pl bin
    cp scripts/build_index bin 
    cp scripts/ann2loc.pl bin 
    cp scripts/build_location.pl bin 
    cp scripts/build_revcmp bin 
    cp scripts/complement.pl bin
    cp scripts/fix_boundary bin 
    cp scripts/recover_boundary bin
    cp src/bwtformatdb bin 
    cp: cannot stat 'src/bwtformatdb': No such file or directory
    Makefile:677: recipe for target 'copy' failed
    make: *** [copy] Error 1
    /usr/local/lib/batvi
     [BREAK]

Note: [BREAK] I removed the text in between

software error genome • 1.9k views
ADD COMMENT
1
Entering edit mode

The math library seems to be in your compiler directives. You may want to try moving -lm to the end of the compile command. See this thread and the links there in.

ADD REPLY
0
Entering edit mode

You may want to try moving -lm to

no the linker flag is already here in the middle ...ccumulate-outgoing-args -msse2 -lm -g -O2 ..., but I think math.h is not included. The compiler thinks it's a custom foreign function IMHO

ADD REPLY
0
Entering edit mode

You are the c/c++ guru. But I recall having to do this in the past because "order of -l option matters for gcc".

ADD REPLY
0
Entering edit mode

I have seen this problem in other threads, but I did not understand what file I need to modify... gcc is not launched by build.sh; maybe the make files in the 'BatMIS' and 'batindel' directories?

ADD REPLY
0
Entering edit mode

I tried the following command: ~/Documents/Lab/virInt/batvi/BatMis-3.00/src $ gcc -w -O3 -funroll-loops -maccumulate-outgoing-args -msse2 -g -O2 -o bwtformatdb bwtformatdb.o BWT.o BWTConstruct.o MiscUtilities.o MemManager.o TextConverter.o r250.o QSufSort.o iniparser.o inistrlib.o dictionary.o DNACount.o Timing.o Socket.o HSP.o HSPstatistic.o karlin.o -lm then I ran /usr/local/lib/batvi$ ./build.sh but i am not sure if it worked.

ADD REPLY
2
Entering edit mode

When I moved by hand the -lm flag to the end, it compiled the bwtformatdb executable:

gcc -w -O3 -funroll-loops -maccumulate-outgoing-args -msse2 -g -O2   -o bwtformatdb bwtformatdb.o \
  BWT.o BWTConstruct.o MiscUtilities.o MemManager.o TextConverter.o r250.o QSufSort.o iniparser.o \
  inistrlib.o dictionary.o DNACount.o Timing.o Socket.o HSP.o HSPstatistic.o karlin.o -lm

I think you have to run make again, so it then compiles batman, batdecodefilterandreverse, then make copy - probably running./build.sh` at the batvi root dir will build them.

edit: I had another error, however:

cluster_bp.cpp: In function ‘void Load_Location(char*, std::map<std::__cxx11::basic_string<char>, unsigned int>&)’:
cluster_bp.cpp:1586:36: error: no match for ‘operator!=’ (operand types are ‘std::basic_istream<char>’ and ‘int’)
  while (getline(Location_File,Line)!=0)
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

Even so, the cluster_bp executable seems to have built.

ADD REPLY
1
Entering edit mode

replace

while (getline(Location_File,Line)!=0)

with

while (getline(Location_File,Line))
ADD REPLY
0
Entering edit mode

I modified cluster_bp.cpp at line 1586 as Pierre suggested, then I launched: /usr/local/lib/batvi/BatMis-3.00/src $ gcc -w -O3 -funroll-loops -maccumulate-outgoing-args -msse2 -g -O2 -o bwtformatdb bwtformatdb.o BWT.o BWTConstruct.o MiscUtilities.o MemManager.o TextConverter.o r250.o QSufSort.o iniparser.o inistrlib.o dictionary.o DNACount.o Timing.o Socket.o HSP.o HSPstatistic.o karlin.o -lm and I got: /usr/bin/ld: bwtformatdb.o: relocation R_X86_64_32 against.rodata.str1.1' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: BWT.o: relocation R_X86_64_32 against .rodata.str1.1' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: BWTConstruct.o: relocation R_X86_64_32 against.rodata.str1.8' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: MiscUtilities.o: relocation R_X86_64_32 against .bss' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: MemManager.o: relocation R_X86_64_32 against.rodata.str1.8' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: TextConverter.o: relocation R_X86_64_32S against .rodata' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: r250.o: relocation R_X86_64_32 against.bss' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: iniparser.o: relocation R_X86_64_32 against .rodata.str1.1' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: inistrlib.o: relocation R_X86_64_32 against.bss' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: dictionary.o: relocation R_X86_64_32 against .rodata.str1.1' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: DNACount.o: relocation R_X86_64_32S against.rodata' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: Timing.o: relocation R_X86_64_32 against .rodata.str1.1' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: Socket.o: relocation R_X86_64_32 against.rodata.str1.8' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: HSP.o: relocation R_X86_64_32 against .rodata' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: HSPstatistic.o: relocation R_X86_64_32 against.rodata.str1.8' cannot be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status`

ADD REPLY
0
Entering edit mode
6.1 years ago

in the file src/TypeNLimit.h

try to insert the following line:

#include <math.h>

if it doesn't work, try to insert this line too in the file "config.h"

ADD COMMENT
0
Entering edit mode

I added the line in both TypeNLimit.h (BatMis and BatIndels) but I am not sure if the program compiled properly; now building BatMis gave: make[2]: Leaving directory '/usr/local/lib/batvi/batindel/src' make[2]: Entering directory '/usr/local/lib/batvi/batindel' make[2]: Leaving directory '/usr/local/lib/batvi/batindel' make[1]: Leaving directory '/usr/local/lib/batvi/batindel' /usr/local/lib/batvi

ADD REPLY
0
Entering edit mode

If you did not see a warning/error then it probably did compile fine. Do you see expected executables?

ADD REPLY
0
Entering edit mode

I think not; talking with Dr Tennakoon, one of the files that should have been built turned out to be 'bwtformatdb'. But it is not there: /usr/local/lib/batvi/BatMis-3.00/bin$ ls ann2loc.pl build_index complement.pl recover_boundary b2c.pl build_location.pl filter.pl strip.pl build_complement build_revcmp fix_boundary

ADD REPLY

Login before adding your answer.

Traffic: 2512 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6