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

static linking

claudio
Beginner
1,821 Views
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 Kudos
4 Replies
TimP
Honored Contributor III
1,821 Views
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 Kudos
claudio
Beginner
1,821 Views
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 Kudos
TimP
Honored Contributor III
1,821 Views
"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 Kudos
claudio
Beginner
1,821 Views
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 Kudos
Reply