Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samr download formula #27

Open
LouisGil opened this issue Jun 20, 2017 · 2 comments
Open

samr download formula #27

LouisGil opened this issue Jun 20, 2017 · 2 comments

Comments

@LouisGil
Copy link

LouisGil commented Jun 20, 2017

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
@MikeJSeo
Copy link
Owner

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!

@PabloDomizi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants