3

I have a Racket program I want to link against a Fortran library and another library, because the Fortran API works well. I saw from a Stack Overflow answer by Jens Axel Søgaard that he was able to link to CBLAS and LAPACK. The libraries I'm using are different, but I'm hoping I'll be able to use them from Racket. It would be quite sweet.

My question I think is simple. Currently I build Racket programs that can execute on the required platform (Windows) like this:

$ raco exe -o MyProgram.exe MyProgram.rkt
$ raco distribute win MyProgram.exe

In the above, I was not compiling against or linking to anyone else's Fortran library. Now that I will be, what will my raco command(s) look like? Assume I have two libraries I need to link against: ${LIBPATH}/libeccodes_f90.dll ${LIBPATH}/libeccodes.dll

Community
  • 1
  • 1
gknauth
  • 2,310
  • 2
  • 29
  • 44

1 Answers1

2

The FFI in Racket uses libffi to dynamically load library files.

If it is possible to use the Fortran library from a C program, then it should be possible to use it from Racket too.

I am a bit unsure whether the LAPACK library I used was produced by a Fortran compiler - or whether something was done to make it usable from C.

If you pass the ++lib flag to raco exe the produced executable should include the shared library. The exact details I don't know.

soegaard
  • 30,661
  • 4
  • 57
  • 106