0

I am trying to create the shared library (.so) so that I can call it using .External command from R for the lassoshooting package: https://cran.r-project.org/web/packages/lassoshooting/

Basically, I have downloaded the package source from the above website. However, when I go the the correct directory (.../lassoshooting/src) and use the command

R CMD SHLIB -o ccd_r.so ccd_r.c 

I get the following error:

clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o ccd_r.so ccd_r.o -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [ccd_r.so] Error 1

Why is this happening?

Ross
  • 2,130
  • 14
  • 25
  • 2
    Maybe `libgfortran` is not installed? – David Schwartz Nov 12 '15 at 19:02
  • gfortran is installed. is libgfortran any different? thanks. – Syed Rahman Nov 12 '15 at 19:42
  • [How to get clang to link against a library without the “lib” prefix?](http://stackoverflow.com/questions/28219849/how-to-get-clang-to-link-against-a-library-without-the-lib-prefix) – kaylum Nov 12 '15 at 19:53
  • You need to set `FLIBS` to tell R where to find `libgfortran`. See [my answer here](http://stackoverflow.com/questions/29992066/rcpp-warning-directory-not-found-for-option-l-usr-local-cellar-gfortran-4-8) for more details. – Kevin Ushey Nov 17 '15 at 05:35

0 Answers0