kkdey / CountClust

A R package for Grade of Membership model and Visualization of counts data:
31 stars 11 forks source link

fortran compiler error during installation #32

Closed jhsiao999 closed 3 years ago

jhsiao999 commented 7 years ago

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'

jhsiao999 commented 7 years ago

One solution:

  1. Install gfortran: https://cran.r-project.org/bin/macosx/tools/gfortran-4.2.3.pkg

  2. 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

  3. 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

  4. Reopen R/RStudio, test install, it should compile now like a charm: devtools::install_github('kkdey/maptpx')

jhsiao999 commented 7 years ago

See issue #22 for another solution.

kkdey commented 5 years ago

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")