Error building dynare

Hi. I’m trying to build Dynare 4.1.2 (for Matlab 7.10) on a RedHat Enterprise Linux 5.5 system. The make gives the following error:

make[2]: Entering directory /tmp/dyn/dynare-4.1.2/mex/build/matlab/bytecode' g++ -ansi -fPIC -pthread -g -O2 -fno-omit-frame-pointer -Wall -shared -Wl,--version-script,/apps_local/matlab710/extern/lib/glnxa64/ -Wl,--no-undefined -Wl,-rpath-link,/apps_local/matlab710/bin/glnxa64 -L/apps_local/matlab710/bin/glnxa64 -o bytecode.mexa64 bytecode.o Interpreter.o Mem_Mngr.o SparseMatrix.o -lmx -lmex -lmat -lm -lstdc++ -lmwlapack -lmwblas /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libm.a(s_asinh.o): relocation R_X86_64_32 againsta local symbol’ can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/…/…/…/…/lib64/libm.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [bytecode.mexa64] Error 1
make[2]: Leaving directory /tmp/dyn/dynare-4.1.2/mex/build/matlab/bytecode' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/tmp/dyn/dynare-4.1.2/mex/build/matlab’
make: *** [all-recursive] Error 1

I have gcc 4.1.2 installed. I ran the following as root in the dynare 4.1.2 directory:

./configure --with-matlab=/apps_local/matlab710 MATLAB_VERSION=7.10 CPPFLAGS="-I/home/archive/res/pior/boost_1_43_0" --prefix=/apps_local/matlab710/dynare/dynare-4.1.2 --disable-octave

Any ideas?

Could you try to upgrade gcc?