Closed jhsiao999 closed 3 years ago
One solution:
Install gfortran: https://cran.r-project.org/bin/macosx/tools/gfortran-4.2.3.pkg
cd to /usr/local/lib/gcc
, find the folder that contains the file libgfortran.dylib
, the path I found is: /usr/local/lib/gcc/5
Open /Library/Frameworks/R.framework/Resources/etc/Makeconf
and replace the path in this line:
FLIBS = -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm
with the path you just found in step 2:
FLIBS = -L/usr/local/lib/gcc/5 -lgfortran -lquadmath -lm
Reopen R/RStudio, test install, it should compile now like a charm:
devtools::install_github('kkdey/maptpx')
See issue #22 for another solution.
The above solution did not work for me on my recent machine. I found an alternative solution, which I am mentioning here for book-keeping in case someone fails to solve this problem using the comment above.
1) Run curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
.
2) Extract : sudo tar fvxj gfortran-4.8.2-darwin13.tar.bz2 -C /
3) Go to the folder where the libgfortran.dylib and libgquadmath.dylib files are. In my case it was
/usr/local/lib
.
4) Open /Library/Frameworks/R.framework/Resources/etc/Makeconf
and replace the path in this line:
FLIBS = -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm
by
FLIBS = -L/usr/local/lib -lgfortran -lquadmath -lm
5) Restart R/RStudio and run devtools::install_github("kkdey/maptpx")
or devtools::install_github("TaddyLab/maptpx")
error:
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 -lquadmath clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [maptpx.so] Error 1 ERROR: compilation failed for package 'maptpx'