Menu

#582 build problem (and solution) for Tru64/gcc 4.3.3

open
nobody
5
2012-10-23
2010-02-13
No

See background reference:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14608

Building openbabel 2.2.3 with gcc 4.3.3 on Tru64 requires two things:
(1) -D_GLIBCXX_USE_C99_MATH in CXX_FLAGS , e.g.
CXXFLAGS='-D_GLIBCXX_USE_C99_MATH -g -O2' ./configure
(2) whenever isfinite() is used, #include <cmah> is needed, there are too many of them
and I got fed up after adding the first couple, so I just added it to the end of src/config.h.in
(adding it to the end of include/openbabel/babelconfig.h also get included to everything).

These steps are probably required for most older unix systems which is not linux nor Mac X.
(I'd like to know if either of these are needed on linux, actually, but can't be bothered, since openbabel is shipped with fedora)

Also I have a comment to make: the top level INSTALL is misleading. since isfinite() is C99, the c89 part in
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
is misleading, and further more, most of openbabel is c++ code so the effective variables are really CXX and CXXFLAGS, not CC/CFLAGS .

Discussion

  • Noel O'Boyle

    Noel O'Boyle - 2010-02-14

    Hi Hin-Tak, thanks for the comments and the fix.

    I want to ask whether you would be interested in running a nightly build on a Tru64 system. None of the developers have access to such a system and so errors like this occur from time to time, and are difficult to resolve. We have recently (i.e. in the last week) set up a build dashboard at http://my.cdash.org/index.php?project=Open%20Babel&date=2010-02-14 and are working through the warnings and test failures. The build procedure is simply a one command that should be run from cron. If you are happy to do so, please contact me off-list at baoilleach@gmail.com.

    • Noel
     
  • Hin-Tak Leung

    Hin-Tak Leung - 2010-02-14

    I am not sure about the nightly build - and still trying to look at some runtime problems - it crashes and corrupts the stack.

    gdb /usr/local/bin/babel

    GNU gdb (GDB) 7.0.1
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "alphaev68-dec-osf5.1a".
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/...
    Reading symbols from /usr/local/bin/babel...done.
    (gdb) run -imol2 MOL-1.mol2 -opdb gaba038.pdb
    Starting program: /usr/local/bin/babel -imol2 MOL-1.mol2 -opdb gaba038.pdb

    Program received signal SIGSEGV, Segmentation fault.
    0x000003ff80019e7c in ?? () from /sbin/loader
    (gdb) bt

    0 0x000003ff80019e7c in ?? () from /sbin/loader

    warning: Hit heuristic-fence-post without finding enclosing function for address 0x3ff80019e7c
    This warning occurs if you are debugging a function without any symbols
    (for example, in a stripped executable). In that case, you may wish to
    increase the size of the search with the `set heuristic-fence-post' command.

    Otherwise, you told GDB there was a function where there isn't one, or
    (more likely) you have encountered a bug in GDB.

    1 0x000003ff80019e38 in ?? () from /sbin/loader

    warning: Hit heuristic-fence-post without finding enclosing function for address 0x3ff80019e38
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    (gdb)


    The last babel on this machine was built on Nov 11 2005 with a libopenbabel.so.0.0.0 (current ggives is 3.0.3). I am building the latest version because the old one has stopped working (hasn't been used for a while) due to libstdc++ incompatibility related to pthread (the last one was possibliy built with a gcc 3.x; obviously libstdc++ has changed since)

     
  • Hin-Tak Leung

    Hin-Tak Leung - 2010-02-15

    I managed to fine out what was the last version of openbabel that worked - it was 1.100.2 (probably compiled with gcc 3.x). that verion of openbabel and/or gcc 4.3.3 doesn't need the -D_GLIBCXX_USE_C99_MATH in CXX_FLAGS, but the code needs

    include <cstring>

    include <cstdlib>

    in src/babelconfig.h and also #include <cstring> in src/tokenst.cpp

    when run, that version now dies with a floating exception, which looks like it might be fixable:

    (gdb) run -imol2 MOL-46.mol2 -opdb gaba046-11002.pdb
    Starting program: /usr/local/bin/babel-1.100.2 -imol2 MOL-46.mol2 -opdb gaba046-11002.pdb

    Program received signal SIGFPE, Arithmetic exception.
    0x000000012005635c in OpenBabel::IsNearZero (a=@0x11fffa728, epsilon=1.9999999999999999e-06) at obutil.cpp:80
    80 bool IsNearZero(const double &a, const double epsilon)
    (gdb) bt

    0 0x000000012005635c in OpenBabel::IsNearZero (a=@0x11fffa728, epsilon=1.9999999999999999e-06) at obutil.cpp:80

    1 0x00000001200d0078 in OpenBabel::ReadMol2 (ifs=..., mol=..., title=0xf8ffffffffffffff <Address 0xf8ffffffffffffff="" out="" of="" bounds="">) at mol2.cpp:113

    2 0x0000000000000004 in ?? ()

    warning: Hit beginning of text section without finding enclosing function for address 0x4
    This warning occurs if you are debugging a function without any symbols
    (for example, in a stripped executable). In that case, you may wish to
    increase the size of the search with the `set heuristic-fence-post' command.

    Otherwise, you told GDB there was a function where there isn't one, or
    (more likely) you have encountered a bug in GDB.
    Backtrace stopped: frame did not save the PC
    (gdb)