- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using an HP dual-cpu Opteron with Red Hat Enterprise Linux Workstation v.3.2.
I am testing static linking with ifort Version 8.1 Build 20050823Z Package ID: l_fc_pc_8.1.030 for the following simple program:
program hello
write (*,*) 'Hello, world from Fortran 90'
end
write (*,*) 'Hello, world from Fortran 90'
end
The following command:
ifort -static -ohello.f90.exe hello.f90
gives the message:
/opt/intel_fc_80/lib/libifcore.a(for_open_proc.o)(.text+0x3826): In function `for__compute_filename':
: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/intel_fc_80/lib/libifcore.a(for_open_proc.o)(.text+0x3909): In function `for__compute_filename':
: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/intel_fc_80/lib/libifcore.a(for_open_proc.o)(.text+0x3909): In function `for__compute_filename':
: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
How can I generate a completely statically-linked executable? Because of software QA rules, if my real application uses any shared libraries, and the operating system is updated, my application becomes "unqualified".
Message Edited by jeff_ryman on 10-20-2005 10:34 AM
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you actually check (e.g. with ldd) to see whether you got a static link?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Running ldd gives "not a dynamic executable".
My point was that executing a staticly linked executable generates messages stating that a shared runtime version of glibc will always be necessary. This seems to me to be a contradiction of what "static linking" means.
I was hopeful that all dynamic linking to runtime libraries could be eliminated. Past experience has shown that (for good or bad, depending on the circumstances) dynamic linking can lead to changed answers if shared system libraries are updated. I would prefer to know that answers will never change for a given executable. In addition, the software QA rules under which I am operating require requalification of the software if shared system libraries change. Requalification is a significant effort.
By the way, an executable compiled with Version 9.0 Build 20050912Z Package ID: l_fc_c_9.0.027 gives similar messages.
Thanks for any insight you can give me.
My point was that executing a staticly linked executable generates messages stating that a shared runtime version of glibc will always be necessary. This seems to me to be a contradiction of what "static linking" means.
I was hopeful that all dynamic linking to runtime libraries could be eliminated. Past experience has shown that (for good or bad, depending on the circumstances) dynamic linking can lead to changed answers if shared system libraries are updated. I would prefer to know that answers will never change for a given executable. In addition, the software QA rules under which I am operating require requalification of the software if shared system libraries change. Requalification is a significant effort.
By the way, an executable compiled with Version 9.0 Build 20050912Z Package ID: l_fc_c_9.0.027 gives similar messages.
Thanks for any insight you can give me.
Message Edited by jeff_ryman on 10-21-2005 03:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using -i-static This at least links with the static versions of the Intel libraries. I'm not sure it's possible to have a completely static link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The warning messages seem to be associated with the order of the ld command string set up by ifort. For example, a useless -Bdynamic instruction in the command string may cause ld to issue the warning.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have checked the ld options generated by my command line. There is no "-Bdynamic". I have also tried -i-static (without -static) which eliminates the error message, but then gives me an executable that is linked to shared system libraries (checked with ldd). Using both -static and -i-static gives the same error messages as I originally had. The program needs to link in the function 'for_compute_filename' in for_open_proc.o (a member of libifcore.a), and this calls 'getpwnam' and 'getpwuid', which are members of the shared system library glibc. I certainly don't know what 'for_compute_filename' is doing, but it seems strange to me that it needs to go read the password file, which is what 'getpwnam' and'getpwuid' are doing. The same program compiles and generates a completely statically-linked executable with the Lahey compiler. I am not trying to flame anyone; in fact, the Intel compiler was recommended for the program I am trying to qualify (MCNP5) because it creates an executable that the developers claim is 2 orders of magnitude faster than that from Lahey. However, if I don't have a completely statically-linked executable, it has the potential to cause me a good deal of grief later because I will have to requalify the software if the shared glibc library is updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I too am getting similar warnings with the "-static" flag (and the "-fast" flag, which includes the "-static" flag). Specifically mine are:
/opt/intel/intel-fc-9/9.0.028/lib/libifcore.a(for_open_proc.o): In function `for__compute_filename.':
./src/libfor/for_open_proc.c:(.text+0xc14): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
./src/libfor/for_open_proc.c:(.text+0xd05): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
And ldd reports that the resulting executable is not dynamically linked. I would like my program to be statically linked (as much as possible), but not have to ignore a warning at every compilation (or even turn off warnings, which I definitely don't want to do).
Regards,
Nym.
/opt/intel/intel-fc-9/9.0.028/lib/libifcore.a(for_open_proc.o): In function `for__compute_filename.':
./src/libfor/for_open_proc.c:(.text+0xc14): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
./src/libfor/for_open_proc.c:(.text+0xd05): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
And ldd reports that the resulting executable is not dynamically linked. I would like my program to be statically linked (as much as possible), but not have to ignore a warning at every compilation (or even turn off warnings, which I definitely don't want to do).
Regards,
Nym.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page