error compiling 1.7.3 on RedHat

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
sbuonopane
Posts: 11
Joined: Wed Jun 23, 2004 12:03 pm
Location: Bucknell University

error compiling 1.7.3 on RedHat

Post by sbuonopane »

I get the error listed below.
Seems like a conflict between math.h and tclAppInit.cpp.?

Steve


local/OpenSees1.7.3/SRC/reliability/FEsensitivity -I/usr/local/OpenSees1.7.3/SRC/reliability/tcl -I/usr/local/OpenSees1.7.3/SRC/unittest -I/usr/local/OpenSees1.7.3/SRC -I/usr/local/OpenSees1.7.3/OTHER/SuperLU_3.0/SRC -I/usr/local/OpenSees1.7.3/SRC/package -c tclAppInit.cpp
In file included from /usr/include/c++/3.2.3/cmath:51,
from /usr/include/c++/3.2.3/bits/locale_facets.tcc:41,
from /usr/include/c++/3.2.3/locale:46,
from /usr/include/c++/3.2.3/bits/istream.tcc:37,
from /usr/include/c++/3.2.3/istream:297,
from /usr/include/c++/3.2.3/fstream:45,
from /usr/local/OpenSees1.7.3/SRC/handler/FileStream.h:30,
from tclAppInit.cpp:83:
/usr/include/math.h:288: declaration of C function `int matherr(__exception*)'
conflicts with
tclAppInit.cpp:55: previous declaration `int matherr()' here
make[2]: *** [tclAppInit.o] Error 1
make[2]: Leaving directory `/usr/local/OpenSees1.7.3/SRC/tcl'
make[1]: *** [tcl] Error 2
make[1]: Leaving directory `/usr/local/OpenSees1.7.3/SRC/modelbuilder/tcl'
make: *** [all] Error 2
Stephen Buonopane
Dept. of Civil Engineering
Bucknell Univ.
Lewisburg, PA 17837
aneeman
Posts: 90
Joined: Thu Jan 12, 2006 1:13 pm
Contact:

Post by aneeman »

It's a real issue (your compiler is smarter than mine! )
It doesn't look like matherr actually gets used in 1.7.3. I did a grep on it, and here's where I found it:

SRC/tcl/mpiMain.cpp:extern "C" int matherr();
SRC/tcl/mpiMain.cpp://int *tclDummyMathPtr = (int *)matherr;
SRC/tcl/mpiParameterMain.cpp:extern "C" int matherr();
SRC/tcl/mpiParameterMain.cpp://int *tclDummyMathPtr = (int *)matherr;
SRC/tcl/tclAppInit.cpp:extern "C" int matherr();
SRC/tcl/tclAppInit.cpp://int *tclDummyMathPtr = (int *) matherr;
SRC/tcl/tkAppInit.cpp:extern "C" int matherr();
SRC/tcl/tkAppInit.cpp:int *tclDummyMathPtr = (int *) matherr;


So it's all just declarations. I'd just try commenting it out for now; Frank is out this month..

good luck,

alisa
sbuonopane
Posts: 11
Joined: Wed Jun 23, 2004 12:03 pm
Location: Bucknell University

Post by sbuonopane »

Thanks for the help. I will try it out.
Did you get 1.7.3 to compile on linux? RedHat?

steve
Stephen Buonopane
Dept. of Civil Engineering
Bucknell Univ.
Lewisburg, PA 17837
aneeman
Posts: 90
Joined: Thu Jan 12, 2006 1:13 pm
Contact:

Post by aneeman »

sbuonopane wrote:Thanks for the help. I will try it out.
Did you get 1.7.3 to compile on linux? RedHat?

steve
yes, but it was like fedora core 2. I got compiles other places also; yellowdog (Linux kernel version 2.6.15-rc5 for mac G4) and other similar intel kernels.

alisa
simon
Posts: 4
Joined: Wed Aug 30, 2006 1:14 pm
Location: Los Angeles

Post by simon »

Maybe the version of your compiler has something to do with it? I am using CentOS 4 (which is basically Red Hat Entreprise Linux), and I didn't have any problem. I use the CVS version though, and I just updated today (9/25).

My version of gcc is:

Code: Select all

gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)
which you can find out by

Code: Select all

gcc -v
- Simon
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

i have commented out the matherr() declaration, the declaration is not subsequently in the files .. the update can be obtained from cvs if needed.
Post Reply