Skip to content
Prev 10236 / 15075 Next

Compiling a portable binary that includes Fortran code

Diego,

if you compiled the binary on your Mac with gfortran installed the library created still links to the libgfortran.3.dylib library. In your package shared object file there is now a link to the libgfortran.3.dylib library and when installing to R, this link is searched for but cannot be found, as it is on your Mac and not on the user?s Mac. I guess, if you include the static library instead of the dynamic things work. 

First look into the shared object file of your package: 
On the Shell type: otool -L yourpackagename.so
There should be a link to libgfortran.3.dylib
Second, check if libgfortran.a exists: 
On The shell type: locate libgfortran 

Now if it does, try the following:
Open your Makevars and add the line
PKG_LIBS = -L/path/to/your/libgfortran.a 

Then recompile and try to install the binary. 
Also look again into the shared object file with tool -L and check if libgfortran is still in there.

May it helps

Simon
On 05 Nov 2013, at 22:13, Diego M Salvanha <dinarussia at gmail.com> wrote: