You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that R is trying to compile the package using gfortran, but its looking at the wrong directory. I use a mac and my gcc is from the brew formula gcc which contains gfortan. I fixed this by downloading the gfortran as specified here https://gcc.gnu.org/wiki/GFortranBinaries.
install.packages("samr")
--- Please select a CRAN mirror for use in this session ---
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘samr’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘samr’
trying URL 'https://cloud.r-project.org/src/contrib/samr_2.0.tar.gz'
Content type 'application/x-gzip' length 36702 bytes (35 KB)
==================================================
downloaded 35 KB
* installing *source* package ‘samr’ ...
** libs
gfortran -fPIC -g -O2 -c rankcol.f -o rankcol.o
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 samr.so rankcol.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [samr.so] Error 1
ERROR: compilation failed for package ‘samr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/samr’
The downloaded source packages are in
‘/private/var/folders/v_/n5nqr5812074ct0zkldqhg500000gn/T/RtmpBn8P5n/downloaded_packages’
Warning message:
In install.packages("samr") :
installation of package ‘samr’ had non-zero exit status
The text was updated successfully, but these errors were encountered:
Hmm.. thanks for sharing. I'm not sure why in my computer it works without install gfortran. I just checked running this GUI in R version 3.4.0 and it works!
I had the same problem Louis
I had a macOS High Sierra and R 3.5.0
I found the following tutorial to solve it:
thttps://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks--lgfortran-and--lquadmath-error/
Briefly, in gcc@8 from Homebrew the gfortran version is the number 5.
So to compile SAMR I need to install gfortran6.1.0: http://coudert.name/software/gfortran-6.1-ElCapitan.dmg
After installation, I could run samr without any problem
Hope this is still useful for you
Best
I think that R is trying to compile the package using gfortran, but its looking at the wrong directory. I use a mac and my gcc is from the brew formula gcc which contains gfortan. I fixed this by downloading the gfortran as specified here https://gcc.gnu.org/wiki/GFortranBinaries.
The text was updated successfully, but these errors were encountered: