Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

static linking

claudio
Débutant
1 822 Visites
I am using ifort v8 to compile a f90 code that outputs directly to a web page. This apparently requires static linking which gives the warning: "Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking". When I run the code it fails with the message: "/usr/lib/libc.so.1: bad ELF interpreter..." Is there a way around this problem?? or, How can I compile the code so that it can write to the web page? Thank you. Claudio Mendoza.
0 Compliments
4 Réponses
TimP
Contributeur émérite III
1 822 Visites
The message about getpwuid() commonly occurs with a static link, and it is not necessarily meaningful. Evidently, in your case, it is telling the truth, at least to the extent that your application is still looking for libc.so.1.
Possibly, the .so which is found at run time is not the right one; for example, if you used the 64-bit compiler, and it is attempting to run with the 32-bit library. Do you have the same problem when using -i-static in place of -static ?
Sometimes, it is necessary to capture the ld link string which is passed by ifort -# and modify it to get a working static link. If yours is such a case, I would suggest filing a problem report on premier.intel.com.
0 Compliments
claudio
Débutant
1 822 Visites
Thanks for your kind reply. If I do as suggested I get the message
"ifort -i-static -o decay_fit decay_fit.o num_rec.o wapr_743.o
/usr/bin/ld: cannot find -lm" which refers to C math library.
0 Compliments
TimP
Contributeur émérite III
1 822 Visites
"cannot find -lm" would mean that libmath is missing from the paths which your Intel compiler inherits from gcc. This could mean that your gcc/glibc installation is incomplete, or that it has been changed since you installed an Intel 8.1 or earlier compiler.
0 Compliments
claudio
Débutant
1 822 Visites
Well...I have found a way round it that DOES NOT need to compile with the static option. The PHP script calls a shell-script that calls the f90 executable rather than directly calling the latter. That is all. It involves changing things around but it works fine! Thanks for your attention.
0 Compliments
Répondre