Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


GDL 0.8.11 compilation error on Solaris10 x86

  • ajheaps

    I'm using GCC 3.4.3 and the Sun Studio 11 Fortran compiler on a Solaris 10 X86 box. 

    plplot5.3.1 eventually compiled and examples look okay after some little tweaks along the way. readline-5.0 and gsl-1.7 compiled okay out of the box.  ImageMagick-6.1.9 and netcdf-3.6.0 are also on the system. So I start the configure:
    export CC=gcc
    export CXX=g++
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/export/home/andy/gsl-1.7/lib
    export PATH=$PATH:/export/home/andy/plplot-5.3.1/bin
    ./configure --prefix=/export/home/andy/gdl-0.8.11 \ --with-plplot=/export/home/andy/plplot-5.3.1 \ --with-gsldir=/export/home/andy/gsl-1.7 \ --with-readlinedir=/export/home/andy/readline-5.0 --with-hdf=no \ --with-hdf5=no \ --with-python=no \ --with-netcdf=/opt/tools/lib \ --with-Magick=/opt/graphics

    Everything looks okay in the configure stage and it finds plplot, gsl etc. okay.

    In the make stage it fails with:
    if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/export/home/andy/readline-5.0/include -I/export/home/andy/gsl-1.7/include -I/export/home/andy/plplot-5.3.1/include -I/opt/graphics/include -I/opt/tools/lib/include     -g -O2 -MT gdl-basic_fun.o -MD -MP -MF ".deps/gdl-basic_fun.Tpo" -c -o gdl-basic_fun.o `test -f 'basic_fun.cpp' || echo './'`basic_fun.cpp; \ then mv -f ".deps/gdl-basic_fun.Tpo" ".deps/gdl-basic_fun.Po"; else rm -f ".deps/gdl-basic_fun.Tpo"; exit 1; fi
    basic_fun.cpp: In function `BaseGDL* lib::getenv_fun(EnvT*)':
    basic_fun.cpp:2916: error: `environ' undeclared (first use this function)
    basic_fun.cpp:2916: error: (Each undeclared identifier is reported only once for each function it appears in.)
    basic_fun.cpp: In function `void lib::AddOmitNaNCpx(T&, T) [with T = DComplex]':
    basic_fun.cpp:1735:   instantiated from here
    basic_fun.cpp:1731: error: `isfinite' undeclared (first use this function)
    basic_fun.cpp: In function `void lib::AddOmitNaNCpx(T&, T) [with T = DComplexDbl]':
    basic_fun.cpp:1737:   instantiated from here

    Any ideas what is going wrong here?

              Many Thanks

    • Hi Andy!

      It is in my TODO list to port GDL to solaris, but as i don't have a modern solaris on a fast computer, i've postponed this.
      For the problems with basic_fun.cpp the solutions are published here: https://sourceforge.net/tracker/index.php?func=detail&aid=1239154&group_id=97659&atid=618684 .
      Please try the modifications suggested and keep us informed.
      Could you also tell me if round() is defined on solaris 10 (it is not for <= 9 at least)? Thanks.



      • ajheaps

        Hi Médéric,
              made some progress on the GDL compilation.  round() is defined on Solaris 10.  I had a look at the suggested mods and did the following:

        ** add in src/basic_fun.cpp under the #ifdef __APPLE__
        ... #endif statement
        #if !defined(__GLIBC__)
        extern char** environ;
        #include <ieeefp.h>

        ** Replace all instances of

        basic_fun.cpp then compiles okay.

        Next Error
        if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/export/home/andy/readline-5.0/include -I/export/home/andy/gsl-1.7/include -I/export/home/andy/plplot-5.3.1/include -I/opt/graphics/include -I/opt/tools/lib/include     -g -O2 -MT gdl-CFMTLexer.o -MD -MP -MF ".deps/gdl-CFMTLexer.Tpo" -c -o gdl-CFMTLexer.o `test -f 'CFMTLexer.cpp' || echo './'`CFMTLexer.cpp; \ then mv -f ".deps/gdl-CFMTLexer.Tpo" ".deps/gdl-CFMTLexer.Po"; else rm -f ".deps/gdl-CFMTLexer.Tpo"; exit 1; fi
        In file included from CFMTLexer.hpp:9,
                         from CFMTLexer.cpp:5:
        CFMTTokenTypes.hpp:30: error: expected identifier before numeric constant
        CFMTTokenTypes.hpp:30: error: expected `}' before numeric constant
        CFMTTokenTypes.hpp:30: error: expected unqualified-id before numeric constant
        CFMTTokenTypes.hpp:40: error: expected declaration before '}' token
        In file included from CFMTLexer.hpp:9,
                         from CFMTLexer.cpp:5:
        CFMTTokenTypes.hpp:39:1: unterminated #ifdef
        CFMTTokenTypes.hpp:1:1: unterminated #ifndef
        In file included from CFMTLexer.cpp:5:
        CFMTLexer.hpp:1:1: unterminated #ifndef

        This error is because CS is used and this is defined in the /usr/include/sys/regset.h.  The example code below has the same problem:

        #include <signal.h>
        int CS;

        gcc -c ll.cc
        ll.cc:3: error: expected unqualified-id before numeric constant
        ll.cc:3: error: expected `,' or `;' before numeric constant

        CS is converted into a numeric constant by the definition in signal.h. 

        To bypass this problem I changed the instances of CS to be MYCS in the following files:

        The compilation then failed with:
        if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/export/home/andy/readline-5.0/include -I/export/home/andy/gsl-1.7/include -I/export/home/andy/plplot-5.3.1/include -I/opt/graphics/include -I/opt/tools/lib/include     -g -O2 -MT gdl-CFMTLexer.o -MD -MP -MF ".deps/gdl-CFMTLexer.Tpo" -c -o gdl-CFMTLexer.o `test -f 'CFMTLexer.cpp' || echo './'`CFMTLexer.cpp; \ then mv -f ".deps/gdl-CFMTLexer.Tpo" ".deps/gdl-CFMTLexer.Po"; else rm -f ".deps/gdl-CFMTLexer.Tpo"; exit 1; fi
        In file included from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/bits/stl_tree.h:70,
                         from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/map:66,
                         from ./antlr/CharScanner.hpp:13,
                         from CFMTLexer.hpp:10,
                         from CFMTLexer.cpp:5:
        /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/bits/cpp_type_traits.h:69: error: expected unqualified-id before "namespace"
        /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/bits/cpp_type_traits.h:80: error: expected unqualified-id before "namespace"
        In file included from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/map:66,

        The cpp_type_traits.h line is:
        namespace __gnu_internal

        Any idea why this line isn't liked by gcc?
        I've done a google but there's nothing that looks obvious.


        • ajheaps

          I think the basic problem here is that Solaris 10 x86 isn't mature enough yet.  I'll come back to this when they do an update to Solaris 10.

          I swapped over to using Solaris 10 Sparc and gcc almost compiles GDL.  The final link step is where it fails with the appended message.  I compiled plplot with Sun's CC and Fortran and GDL with gcc.  This is the only combination that I can get to get anywhere near. 

          I guess the best end to this would be if both GDL and plplot could be compiled with Sun's tools as that's give the best GDL execution times.  Something for the future!


          GDL final error on Sparis 10 Sparc
          g++ -g -O2 -o gdl gdl-assocdata.o gdl-basic_fun_cl.o gdl-basic_fun.o gdl-basic_fun_jmg.o gdl-basic_op.o gdl-basic_pro.o gdl-basic_pro_jmg.o gdl-CFMTLexer.o gdl-color.o gdl-convert2.o gdl-datatypes.o gdl-dcommon.o gdl-dcompiler.o gdl-default_io.o gdl-dinterpreter.o gdl-dnode.o gdl-dpro.o gdl-dstructdesc.o gdl-dstructgdl.o gdl-dvar.o gdl-envt.o gdl-extrat.o gdl-FMTIn.o gdl-FMTLexer.o gdl-fmtnode.o gdl-FMTOut.o gdl-FMTParser.o gdl-gdleventhandler.o gdl-gdlexception.o gdl-gdlgstream.o gdl-GDLInterpreter.o gdl-GDLLexer.o gdl-GDLParser.o gdl-gdlpsstream.o gdl-gdlpython.o gdl-GDLTreeParser.o gdl-gdlwinstream.o gdl-gdlxstream.o gdl-getfmtast.o gdl-graphics.o gdl-gsl_fun.o gdl-ifmt.o gdl-initct.o gdl-initsysvar.o gdl-io.o gdl-libinit_cl.o gdl-libinit.o gdl-libinit_jmg.o gdl-math_fun.o gdl-math_fun_jmg.o gdl-math_utl.o gdl-ncdf_att_cl.o gdl-ncdf_cl.o gdl-ncdf_dim_cl.o gdl-ncdf_var_cl.o gdl-new.o gdl-objects.o gdl-ofmt.o gdl-plotting.o gdl-print.o gdl-print_tree.o gdl-read.o gdl-str.o gdl-terminfo.o gdl-topython.o gdl-typetraits.o gdl-hdf_fun.o gdl-hdf_pro.o gdl-magick_cl.o gdl-gdlwidget.o gdl-widget.o gdl-basegdl.o gdl-hdf5_fun.o gdl-libinit_mes.o gdl-file.o gdl-image.o gdl-gdljournal.o gdl-convol.o gdl-convol_inc0.o gdl-convol_inc1.o gdl-convol_inc2.o gdl-sigfpehandler.o gdl-gdlzstream.o gdl-gdl.o gdl-arrayindex.o gdl-fftw.o  -lcurses ../src/antlr/libantlr.a -L/usr/X11R6/lib -L/export/fire/local/andy/readline-5.0/lib -lreadline -L/export/fire/local/andy/gsl-1.7/lib /export/fire/local/andy/gsl-1.7/lib/libgsl.so /export/fire/local/andy/gsl-1.7/lib/libgslcblas.so -L/export/fire/local/andy/plplot-5.3.1/lib -L/opt/graphics/lib -L/opt/GNU/gcc-3.2.2/lib -L/opt/GNU/lib /export/fire/local/andy/plplot-5.3.1/lib/libplplotcxxd.so /export/fire/local/andy/plplot-5.3.1/lib/libplplotd.so /export/fire/local/andy/plplot-5.3.1/lib/libcsirocsa.so -lc -lgd-1.4 -lm /opt/graphics/lib/libMagick++.so -L/usr/openwin/lib -L/opt/fonts/lib /opt/graphics/lib/libWand.so /opt/graphics/lib/libMagick.so /opt/graphics/lib/liblcms.so /opt/graphics/lib/libtiff.so /opt/graphics/lib/libjpeg.so -lXext -lSM -lICE -lX11 -lsocket -lnsl -lXt -lbz2 -lz -lpthread /opt/graphics/lib/libltdl.so /opt/fonts/lib/libfreetype.so -ldl /opt/GNU/gcc-3.2.2/lib/./libstdc++.so -L/home/opt-user/gcc-3.2.2.obj/sparc-sun-solaris2.8/libstdc++-v3/src -L/home/opt-user/gcc-3.2.2.obj/sparc-sun-solaris2.8/libstdc++-v3/src/.libs -L/home/opt-user/gcc-3.2.2.obj/gcc -L/opt/tools/lib/lib -lnetcdf -Wl,-R -Wl,/export/fire/local/andy/gsl-1.7/lib -Wl,-R -Wl,/export/fire/local/andy/plplot-5.3.1/lib -Wl,-R -Wl,/opt/graphics/lib -Wl,-R -Wl,/opt/fonts/lib -Wl,-R -Wl,/opt/GNU/gcc-3.2.2/lib/. -Wl,-R -Wl,/export/fire/local/andy/gsl-1.7/lib -Wl,-R -Wl,/export/fire/local/andy/plplot-5.3.1/lib -Wl,-R -Wl,/opt/graphics/lib -Wl,-R -Wl,/opt/fonts/lib -Wl,-R -Wl,/opt/GNU/gcc-3.2.2/lib/.
          ld: warning: file /opt/GNU/gcc-3.2.2/lib/libstdc++.so: linked to /opt/GNU/gcc-3.2.2/lib/./libstdc++.so: attempted multiple inclusion of file
          ld: warning: file /opt/graphics/lib/libtiff.so: attempted multiple inclusion of file
          Undefined                       first referenced
          symbol                             in file
          plstream::sfnam(char const*)        gdl-graphics.o
          plstream::gspa(double&, double&, double&, double&)gdl-plotting.o
          plstream::wind(double, double, double, double)gdl-graphics.o
          plstream::scolor(int)               gdl-graphics.o
          plstream::vpor(double, double, double, double)gdl-graphics.o
          plstream::scolbg(int, int, int)     gdl-gdlgstream.o
          plstream::~plstream()               gdl-gdlgstream.o
          plstream::font(int)                 gdl-graphics.o
          plstream::init()                    gdl-gdlpsstream.o
          plstream::col0(int)                 gdl-gdlgstream.o
          plstream::wid(int)                  gdl-plotting.o
          plstream::box(char const*, double, int, char const*, double, int)gdl-plotting.o
          plstream::adv(int)                  gdl-gdlgstream.o
          plstream::lsty(int)                 gdl-plotting.o
          plstream::bop()                     gdl-gdlgstream.o
          plstream::eop()                     gdl-gdlgstream.o
          plstream::w3d(double, double, double, double, double, double, double, double, double, double, double)gdl-plotting.o
          std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storagegdl-basic_fun_cl.o
          plstream::gchr(double&, double&)    gdl-plotting.o
          plstream::cont(double**, int, int, int, int, int, int, double*, int, void (*)(double, double, double*, double*, void*), void*)gdl-plotting.o
          __gnu_cxx::__exchange_and_add(int volatile*, int)gdl-basic_fun_cl.o
          std::basic_istream<char, std::char_traits<char> >::seekg(long long, std::_Ios_Seekdir)gdl-FMTIn.o
          plstream::spage(double, double, int, int, int, int)gdl-graphics.o
          plstream::gesc(char*)               gdl-gdlgstream.o
          plstream::ptex(double, double, double, double, double, char const*)gdl-plotting.o
          plstream::flush()                   gdl-plotting.o
          plstream::mtex(char const*, double, double, double, char const*)gdl-plotting.o
          plstream::mesh(double*, double*, double**, int, int, int)gdl-plotting.o
          std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&)gdl-basic_fun.o
          plstream::poin(int, double*, double*, int)gdl-plotting.o
          plstream::box3(char const*, char const*, double, int, char const*, char const*, double, int, char const*, char const*, double, int)gdl-plotting.o
          std::basic_ostream<char, std::char_traits<char> >::seekp(long long, std::_Ios_Seekdir)gdl-FMTOut.o
          std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)gdl-basic_pro.o
          plstream::join(double, double, double, double)gdl-plotting.o
          std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)gdl-basic_pro.o
          plstream::schr(double, double)      gdl-gdlgstream.o
          plstream::fontld(int)               gdl-graphics.o
          plstream::SetOpt(char*, char*)      gdl-graphics.o
          plstream::scol0(int, int, int, int) gdl-gdlgstream.o
          plstream::ssym(double, double)      gdl-plotting.o
          plstream::ssub(int, int)            gdl-gdlgstream.o
          plstream::cmd(int, void*)           gdl-gdlxstream.o
          plstream::gpage(double&, double&, int&, int&, int&, int&)gdl-gdlgstream.o
          plstream::plstream(int, int, char const*, char const*)gdl-graphics.o
          plstream::scmap1(int*, int*, int*, int)gdl-graphics.o
          plstream::spause(int)               gdl-graphics.o
          ld: fatal: Symbol referencing errors. No output written to gdl
          collect2: ld returned 1 exit status
          *** Error code 1
          make: Fatal error: Command failed for target `gdl'