SourceForge has been redesigned. Learn more.
Close

#1 not compiling for powerpc64 gcc 3.4.6 and 4.2.1

closed
nobody
5
2007-11-19
2007-11-14
hinri
No

compiling results in:

make all-am
make[1]: Entering directory `/gpfs/h02/kerstens/maq-0.6.1'
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c `test -f 'main.c' || echo './'`main.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c `test -f 'const.c' || echo './'`const.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c `test -f 'seq.c' || echo './'`seq.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c `test -f 'bfa.c' || echo './'`bfa.c
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o read.o `test -f 'read.cc' || echo './'`read.cc
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c `test -f 'fasta2bfa.c' || echo './'`fasta2bfa.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c `test -f 'fastq2bfq.c' || echo './'`fastq2bfq.c
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o merge.o `test -f 'merge.cc' || echo './'`merge.cc
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o match_aux.o `test -f 'match_aux.cc' || echo './'`match_aux.cc
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o match.o `test -f 'match.cc' || echo './'`match.cc
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o sort_mapping.o `test -f 'sort_mapping.cc' || echo './'`sort_mapping.cc
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o assemble.o `test -f 'assemble.cc' || echo './'`assemble.cc
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o pileup.o `test -f 'pileup.cc' || echo './'`pileup.cc
g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -m64 -c -o mapcheck.o `test -f 'mapcheck.cc' || echo './'`mapcheck.cc
mapcheck.cc: In function `bit64_t cal_f(int, bit64_t*, double*)':
mapcheck.cc:45: error: `expl' was not declared in this scope
mapcheck.cc:45: warning: unused variable 'expl'
mapcheck.cc:56: error: `logl' was not declared in this scope
mapcheck.cc:56: warning: unused variable 'logl'
make[1]: *** [mapcheck.o] Error 1

anyone who knows to solve this?

Discussion

  • lh3

    lh3 - 2007-11-19

    Logged In: YES
    user_id=1602510
    Originator: NO

    This is an OS problem. What OS are you using? Linux, AIX or Mac OS X? It seems that your OS supports "long double", but function "expl()" and "logl()" are not declared in <math.h>. This is a bit weird. Can you run "man exp" or "man expl" and show me the "SYNOPSIS" section in the manpage? Many thanks.

     
  • hinri

    hinri - 2007-11-19

    Logged In: YES
    user_id=1937278
    Originator: YES

    NAME
    exp, expf, expl - base-e exponential function

    SYNOPSIS
    #include <math.h>

    double exp(double x);

    float expf(float x);

    long double expl(long double x);

     
  • lh3

    lh3 - 2007-11-19

    Logged In: YES
    user_id=1602510
    Originator: NO

    I am not sure what is happening here... Could you try to compile the following codes with "g++ -Wall test.cpp"? As I did not have a PowerPC64 machine, I need to narrow down the problem with your help. At my side, gcc-3.4.6 on x86_64-linux is able to compile maq.
    --start of test.cpp--
    #include <math.h>
    #include <stdio.h>
    int main() {
    printf("expl(1.0)=%llf\n", expl(1.0));
    return 0;
    }
    --end of test.cpp--

    Many thanks.

     
  • hinri

    hinri - 2007-11-19

    Logged In: YES
    user_id=1937278
    Originator: YES

    On my x86 and x86_64 the test.cpp code compiles without any problem but on powerpc64 (powerpc64-unknown-linux-gnu) I got the following:

    test.c: In function 'main':
    test.c:4: warning: incompatible implicit declaration of built-in function 'expl'

     
  • lh3

    lh3 - 2007-11-19

    Logged In: YES
    user_id=1602510
    Originator: NO

    Thank you. I know what the problem is although I have no idea about its cause. Anyway, could you try the following codes with "g++ -Wall test2.cpp"? Use "g++" instead of "gcc". If you can compile it this time, I will know how to fix this problem in maq. Thanks in advance.
    --start test2.cpp--
    #include <math.h>
    #include <stdio.h>

    #ifdef __cplusplus
    extern "C" {
    #endif
    long double expl(long double);
    long double logl(long double);
    #ifdef __cplusplus
    }
    #endif

    int main()
    {
    printf("expl(1.0)=%Lf\n", expl(1.0));
    return 0;
    }
    --end test2.cpp--

     
  • hinri

    hinri - 2007-11-19

    Logged In: YES
    user_id=1937278
    Originator: YES

    Yes, the test2.cpp compiles correctly on powerpc64!
    Happy fixing maq.

     
  • lh3

    lh3 - 2007-11-19

    Logged In: YES
    user_id=1602510
    Originator: NO

    Thank you. I will make changes in Maq. Before you get the next release, you can also fix it by yourself. The way is to add following lines right below '#include <math.h>' in both 'assopt.c' and 'mapcheck.cc':

    --start of lines to be added--
    #ifdef __cplusplus
    extern "C" {
    #endif
    long double expl(long double);
    long double logl(long double);
    #ifdef __cplusplus
    }
    #endif
    --end of lines to be added--

     
  • lh3

    lh3 - 2007-11-19
    • status: open --> closed
     

Log in to post a comment.