compilation fails at datatypes.cpp

Help
Joanna
2012-10-29
2013-06-03
  • Joanna
    Joanna
    2012-10-29

    I am trying to compile the latest CVS on a Mac 10.5.8.  I have tried the ./configure way and the cmake way, and both of them fail when trying to compile datatypes.cpp.  i have also tried mkdir m4 and autoreconf -vfi, but that doesn't work either.  Below is the error report from cmake (the error from the ./configure is basically the same).

    Building CXX object src/CMakeFiles/gdl.dir/datatypes.cpp.o
    /Users/joanna/gdl/cvs/gdl-29oct12/src/getas.cpp:77: error: template-id ‘GetAs<>’ for ‘typename Data_< <template-parameter-1-1> >::Ty Data_<SpDPtr>::GetAs(SizeT)’ does not match any template declaration
    /Users/joanna/gdl/cvs/gdl-29oct12/src/getas.cpp:77: error: invalid function declaration
    /Users/joanna/gdl/cvs/gdl-29oct12/src/getas.cpp:86: error: template-id ‘GetAs<>’ for ‘typename Data_< <template-parameter-1-1> >::Ty Data_<SpDObj>::GetAs(SizeT)’ does not match any template declaration
    /Users/joanna/gdl/cvs/gdl-29oct12/src/getas.cpp:86: error: invalid function declaration
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp: In member function ‘int Data_< <template-parameter-1-1> >::Scalar2index(SizeT&) const ’:
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp:5333:   instantiated from here
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp:2066: warning: comparison is always false due to limited range of data type
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp: In member function ‘int Data_< <template-parameter-1-1> >::Scalar2index(SizeT&) const ’:
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp:5335:   instantiated from here
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp:2066: warning: comparison is always false due to limited range of data type
    /Users/joanna/gdl/cvs/gdl-29oct12/src/basic_op.cpp: In function ‘T pow(T, T) ’:
    /Users/joanna/gdl/cvs/gdl-29oct12/src/basic_op.cpp:3866:   instantiated from ‘Data_<Sp2>* Data_< <template-parameter-1-1> >::Pow(BaseGDL*) ’
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp:5333:   instantiated from here
    /Users/joanna/gdl/cvs/gdl-29oct12/src/basic_op.cpp:3831: warning: comparison is always false due to limited range of data type
    /Users/joanna/gdl/cvs/gdl-29oct12/src/basic_op.cpp: In function ‘T pow(T, T) ’:
    /Users/joanna/gdl/cvs/gdl-29oct12/src/basic_op.cpp:3866:   instantiated from ‘Data_<Sp2>* Data_< <template-parameter-1-1> >::Pow(BaseGDL*) ’
    /Users/joanna/gdl/cvs/gdl-29oct12/src/datatypes.cpp:5335:   instantiated from here
    /Users/joanna/gdl/cvs/gdl-29oct12/src/basic_op.cpp:3831: warning: comparison is always false due to limited range of data type
    make: ***  Error 1
    make: ***  Error 2
    make: ***  Error 2

    Thanks for your help,
    Joanna

     
  • Alain C.
    Alain C.
    2012-11-05

    sorry, I cannot help you, I have access only to a 10.6.8 and succeed to compile the current CVS version to the end using usual way :
    $ mkdir m4
    $ autoreconf -vfi
    $ ./configure -with-gsl=$HOME/GDL/gsl-1.13/Compilation/ \
            -with-plplot=$HOME/GDL/plplot-5.9.9/Compilation/ \
            -with-GraphicsMagick=$HOME/GDL/GraphicsMagick-1.3.15/Compilation/ \
            -with-netcdf=no -with-hdf=no -with-hdf5=no -with-python=no \
            -with-readlinedir=/opt/local/ -with-pslib=no -with-openmp=no \
            -with-wxWidgets=no -with-Magick=no
    $ make -j 6

    (In CVS, I see no recent significant changes in datatype.h/cpp which may affect includes,
    and no troubles were reported on others OS)

    my gcc version on 10.6.8 is:
    gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
    may be you can have a look on that ?

    Alain

     
  • Joanna
    Joanna
    2012-11-09

    Switching both gcc and g++ to version 4.2 did the trick (they were previously 4.0).  Thanks for the tip!
    Joanna