From: Samuel H. <sam...@gm...> - 2013-08-23 21:39:52
|
Hmm, I think I might have just fixed this by supplying the following gcc arguments: -shared /usr/lib/gcc/x86_64-w64-mingw32/4.6/libgfortran.a whereas this dynamically links the fortran lib (not what I want): -shared -lgfortran -static-libgfortran Does this sound right? -- Sam On 23 Aug 2013, at 19:43, Samuel Halliday <sam...@gm...> wrote: > 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 > |