|
From: Samuel H. <sam...@gm...> - 2013-08-23 18:44:02
|
Hi all, I am author of https://github.com/fommil/netlib-java/ and I am trying to build native fortran binaries using Mingw. My binaries are building, but they are referencing the libgfortran.dll which means they are failing on the target platform, because it doesn't have that library. Because of the way that Java Native libraries are packaged, I need a single self-contained binary that I can load. It is possible to create such a binary on OS X (no cross-compiling) by passing the following command line arguments to a macports gcc (Xcode doesn't have gfortran): -dynamiclib -lgfortran -static-libgfortran /opt/local/lib/gcc48/libquadmath.a -static-libgcc (note the awkwardness with libquadmath) This results in a single dynamic library/application that can be run on any OS X machine without the need for fortran or gcc libraries (i.e. Joe Public). I've failed to repeat this process in Linux as the libgfortran.a is not compiled with -fPIC (allowing it to be included as part of a dynamic library). I am also completely lost how this would be achieved with MinGW. Any help to get a single library / application file that includes the libgfortran would be greatly appreciated! (NOTE: this is not the same as a static library: that would imply bundling the C library as well. As a workaround, I am prepared to consider a completely static library on Windows if you can help me with that. I think Linux users are intelligent enough to install the libgfortran through their package manager ;-P) -- Sam |