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

Installation fails on macOS 13.2.1 with missing gfortran #4

Open
pieterprovoost opened this issue Apr 19, 2023 · 2 comments
Open

Installation fails on macOS 13.2.1 with missing gfortran #4

pieterprovoost opened this issue Apr 19, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@pieterprovoost
Copy link

Installation fails on macOS 13.2.1 with the following error due to an incorrect gfortran path:

> devtools::install_github("EMODnet/Btrait", depend=TRUE, build_vignettes=TRUE)
Downloading GitHub repo EMODnet/Btrait@HEAD

── R CMD build ────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/gb/7ff56y1n0k5dg23rzcfylh7r0000gn/T/RtmpUTC7dC/remotes14cc1698aef6a/EMODnet-Btrait-a15f10e/DESCRIPTION’ ...
─  preparing ‘Btrait’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  installing the package to build vignettes
         -----------------------------------
─  installing *source* package ‘Btrait’ ...
   ** using staged installation
   ** libs
   clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -Wall -pedantic -fdiagnostics-color=always -c BtraitMethods.c -o BtraitMethods.o
   /opt/R/arm64/bin/gfortran -mtune=native -fno-optimize-sibling-calls  -fPIC  -Wall -g -O2  -c  extendTrait.f95 -o extendTrait.o
   make: /opt/R/arm64/bin/gfortran: No such file or directory
   make: *** [extendTrait.o] Error 1
   ERROR: compilation failed for package ‘Btrait’
─  removing ‘/private/var/folders/gb/7ff56y1n0k5dg23rzcfylh7r0000gn/T/RtmpDIUEoC/Rinst1550130eec8f1/Btrait’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'Btrait' from GitHub:
  ! System command 'R' failed

The solution for my system, which has gfortran as part of the homebrew gcc installation (brew install gcc), was to create a file ~/.R/Makevars with the following content:

FC = /opt/homebrew/Cellar/gcc/12.2.0/bin/gfortran
F77 = /opt/homebrew/Cellar/gcc/12.2.0/bin/gfortran
FLIBS = -L/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/12
@bart-v bart-v added the bug Something isn't working label May 31, 2023
@salvafern
Copy link
Collaborator

I don't really know how to solve this tbh - I don't work neither in mac nor with fortran. @karlines do you have any idea?

@salvafern salvafern removed their assignment Jun 1, 2023
@pieterprovoost
Copy link
Author

There may be better options, but updating the documentation on dependencies would probably do for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants