Advice on linking with Fortran?

Carlos Santander csantander619 at gmail.com
Fri Dec 8 14:19:30 PST 2006


Bill Baxter escribió:
> I'd like to link with some Fortran math libs on Windows, but there seems 
> to be a problem in that there isn't a "dmf" or other Fortran compiler 
> that spits out dmd-compatible object files.
> 
> coff2omf would work I suppose if I didn't mind shelling out $15.
> 
> I have managed to get something working, but the process is a bit 
> convoluted.  MinGW can be coaxed to create a dll using a crazy command 
> line like
> 
> gcc -mno-cygwin -shared -o blaslapack.dll 
> -Wl,--out-implib=blaslapack.lib -Wl,--export-all-symbols 
> -Wl,--allow-multiple-definition -Wl,--enable-auto-import 
> -Wl,--whole-archive liblapack.a libf77blas.a libcblas.a 
> -Wl,--no-whole-archive libatlas.a -lg2c
> 
> Then you can use implib on the result like:
>    implib /system blaslapack.lib blaslapack.dll
> 
> To get something which can be used to link with DMD.
> 
> But I'd rather not use a DLL for this since BLAS/LAPACK are libraries 
> (it comes to 11MB) with tons of things I don't really need.  I probably 
> only need a few K of what's in that DLL.  Static linking would make much 
> more sense.
> 
> Anyone done the Fortran/D thing?  Any advice?
> Thanks,
> --bb

I guess you could try Christof Meerwald's OpenWatcom Tools: 
http://cmeerw.org/prog/owtools/
"I am currently working on getting OpenWatcom's tools working with Digital Mars 
C++ to provide an alternative to the already dated Digital Mars tools."

And then use the OpenWatcom Fortran compiler: 
http://www.openwatcom.com/index.php/Main_Page

HTH.

-- 
Carlos Santander Bernal



More information about the Digitalmars-d mailing list