P
post1000
I've recently been compiling numeric programs involving both C and
FORTRAN libraries. It would seem that the order of the libraries
linked seems critical, which, I suppose, is not surprising. What I am
trying to get a handle on is if there is general rules for the link
order. My operating system is linux and I am using the gcc/gfortran
compiliers (I can give more information on the versions if it would be
helpful). I am linking statically and the libraries that I am
explicitly linking are
npsol - a FORTRAN library for constrained optimization
lapack - a FORTRAN library of high level linear algebra algorithms
blas - a FORTRAN library of low level linear algebra algorithms
libgfortran.a - the gfortran standard library
libm.a - the standard C math library
The libraries first in the list make calls to libraries later in the
list. If I link in this order, then the program will compile, but not
in other orders (though I have not tried all other orders).
My question is this: Must one link so that libraries linked first can
call routines in libraries linked later, but not vice versa, or is
this simply an accident of the particular libraries I am using.
Thanks in advance for any advise on this question
Daniel
FORTRAN libraries. It would seem that the order of the libraries
linked seems critical, which, I suppose, is not surprising. What I am
trying to get a handle on is if there is general rules for the link
order. My operating system is linux and I am using the gcc/gfortran
compiliers (I can give more information on the versions if it would be
helpful). I am linking statically and the libraries that I am
explicitly linking are
npsol - a FORTRAN library for constrained optimization
lapack - a FORTRAN library of high level linear algebra algorithms
blas - a FORTRAN library of low level linear algebra algorithms
libgfortran.a - the gfortran standard library
libm.a - the standard C math library
The libraries first in the list make calls to libraries later in the
list. If I link in this order, then the program will compile, but not
in other orders (though I have not tried all other orders).
My question is this: Must one link so that libraries linked first can
call routines in libraries linked later, but not vice versa, or is
this simply an accident of the particular libraries I am using.
Thanks in advance for any advise on this question
Daniel