This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Error linking with libgfortran version (pardiso and lapack libs)
- From: Dennis Wassel <dennis dot wassel at googlemail dot com>
- To: fcostela <francisco dot costela at gmail dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 6 Nov 2009 14:13:04 +0100
- Subject: Re: Error linking with libgfortran version (pardiso and lapack libs)
- References: <26230499.post@talk.nabble.com>
2009/11/6 fcostela <francisco.costela@gmail.com>:
>
> Hi all,
>
> I am trying to compile a program that requires both LAPACK and Pardiso
> libraries on a Centos 4.5 x86_64 using gcc/gfortran. I am linking with the
> file libpardiso400_GNU430_IA64.so that was compiled with gcc/gfortran 4.3.
> I compiled LAPACK 3.2.1 using my current gfortran version 4.1.2 on my Centos
> (I could not update it to 4.2 or higher).
>
> However, when I compiled I got this error:
> /root/pardisolib/libpardiso400_GNU430_IA64.so: undefined reference to
> `_gfortran_os_error'
>
> I checked that my libgfortran version did not include that reference. Then I
> downloaded newer gfortran versions (4.3.1) to link with libgfortran.so.3
>
> This solved the problem about _gfortran_os_error but I got new errors
> concerning the LAPACK lib:
> /root/lapack-3.2.1/lapack_LINUX.a(dlamch.o)(.text+0xb04): En la función
> `dlamc2_':
> : undefined reference to `_gfortran_pow_r8_i4'
> /root/lapack-3.2.1/lapack_LINUX.a(ilaenv.o)(.text+0x7a): En la función
> `ilaenv_':
> : undefined reference to `_gfortran_copy_string'
>
> These two functions are not included in libgfortran.so.3. I found that the
> right version of gfortran that might solve both errors is gfortran.4.2.3
> (libgfortran.so.2). However I have not been able to find it for Centos
> x86_64. It looks like there is no libgfortran.so.2 compatible for this
> machine (or I could not find it!)
I stumbled over more or less the same issue a while ago. If you search
the list for "_gfortran_pow_r8_i4" you should find my message.
The proper way to fix this is to update to gfortran >= 4.3, because
4.3 introduced symbol versioning for libgfortran, so libgfortrans >=
4.3 are supposed to be downward compatible. You will have to recompile
LAPACK with the new version, however.
A very hackish approach would be to manually link against an older
version of libgfortran besides the automagically linked current
version, but this might break things. If you really want to try this,
I suggest your final compile command (use gfortran --verbose to see
the actual compiler command line - look for f951) should link against
the old library *after* the new one, so only the missing symbols are
picked from the old one.
If you cannot find prebuilt libraries, you can bootstrap gcc yourself
- it looks daunting at first, but is not that hard actually.
Cheers,
Dennis