This is not a Fortran programming question, but using gfortran to
build a 100% statically linked app on Linux. I thought someone
here might know.
I am trying to make 100% statically build app using gfortran
with gfortran opengl (i.e a GUI Fortran) So that anyone can
download the Linux executable and run it without needing to
have any libraries on their end. (no openGL installed, no
Fortran etc..)
I got the static link done, but unable to get rid of the following
warnings from the linker:
--------------------------
>./build_static_opengl_client.sh
/usr/lib/i386-linux-gnu/mesa/libGL.a(dlopen.o): In function `_mesa_dlopen':
(.text+0x9): warning: Using 'dlopen' in statically linked applications
requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libX11.a(xim_trans.o): In function `_XimXTransSocketUNIXConnect':
(.text+0xe87): warning: Using 'getaddrinfo' in statically linked
applications requires at runtime the shared libraries from the glibc version used for linking
------------------------------------------
The above script just contain the gfortran command and all the .a
libraries needed in the correct order. I do not think it is
important to show the script. But the final command is
gfortran -Wall ${PGM}.o -static $MODULES $LIBS -o ${PGM}
But can show the full script if needed. In the above MODULE and LIBS
are just a list of all the .o and .a files needed in the correct order.
I googled around, and it seems this is a known issue, and that it
is NOT possible to actually make a 100% statically link program on
linux? example:
http://stackoverflow.com/questions/3430400/linux-static-linking-is-dead
So, before I waste more time trying to make a fortran programs
using openGL that are 100% static linked (I spend few hrs already
to get this far), I thought to check with the experts here who might
work on linux if they can confirm this.
btw, I did test the Fortran opengl static linked small app, by copying
it to another linux system (another VM machine), and it come up
OK, GUI and all.
So, I guess that is becuase the other linux system had the
glibc there. But since all Linux systems will have glibc.so
(it will be strange to have Linux without glibc?) do I need to
really worry about this warning?
It is really bad that one can't make 100% pure static linked
app on Linux if it is true. I assume on windows this is not
the case? I need to look more into this. I want to try gfortran on
windows also (may be using cygwin) and see if I can do the same on windows
and get 100% static linked there).
--Nasser