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

Issues with packages needing gfortran #66

Open
pratikunterwegs opened this issue Jun 4, 2024 · 8 comments
Open

Issues with packages needing gfortran #66

pratikunterwegs opened this issue Jun 4, 2024 · 8 comments

Comments

@pratikunterwegs
Copy link
Contributor

pratikunterwegs commented Jun 4, 2024

I have a persistent issue with installing packages that require gfortran as they are unable to detect that it is installed. This is part of a wider issue with installing gfortran on MacOS. While I have followed the recommended steps to do this, the problem seems to come up repeatedly, e.g. with {StanHeaders} or {SparseM}. This makes it difficult to restore packages from the renv lockfile, which in turn makes it difficult to contribute analyses to the repo.

Would it be possible to look into this issue, and add a section to the contribution guide that provides a definitive solution, or a list of solutions to try? Alternatively, it might be useful to move the analyses using these packages to a different repo, so that contributors need not have all the packages needed by the repo to contribute a single analysis.

@avallecam
Copy link
Member

avallecam commented Jun 4, 2024

Thanks for reporting. Can we track which packages require this? gfortran is not explicitly listed in the renv.lock. With this, we can target what analyses we should update or move to other repo.

@pratikunterwegs
Copy link
Contributor Author

Thanks, see also this resource for installing gfortran: https://cran.r-project.org/bin/macosx/tools/ which seems to be better recommended.

@avallecam
Copy link
Member

@pratikunterwegs how can we identify which entries or packages depended on gfortran?

@pratikunterwegs
Copy link
Contributor Author

Unsure really, will give it a think.

@Bisaloo
Copy link
Member

Bisaloo commented Jun 4, 2024

Carmen had similar issues in the past and we had a lot of success with the macrtools package: https://github.com/coatless-mac/macrtools/

@pratikunterwegs
Copy link
Contributor Author

Using the recommended gfortran binaries works for me in this context.

@avallecam
Copy link
Member

I thought the error was limiting #59. As suggested, I'll add the resources you shared in the contribution guide. Thanks both!

@avallecam
Copy link
Member

avallecam commented Jun 5, 2024

after updating my R to 4.4.0, and renv::restore() I got error for SparseM due to gfortran.

  • even though I'm Windows user, the help messages redirect me to MacOS-only solutions
  • Tracking the dependency tree, SparseM is within EpiEstim
  • After installing Rtools this was solved.
  • Then, I'll add to the CONTRIBUTING guide to install Rtools for Windows and for MacOS macrtools or gfortran binaries.

Message I got:

- Installing SparseM ...                        FAILED
Error: Error installing package 'SparseM':
===================================

* installing *source* package 'SparseM' ...
** package 'SparseM' successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran      -O2  -mfpmath=sse -msse2 -mstackrealign  -c bckslv.f -o bckslv.o
make: gfortran: No such file or directory
make: *** [C:/PROGRA~1/R/R-44~1.0/etc/x64/Makeconf:313: bckslv.o] Error 127
ERROR: compilation failed for package 'SparseM'
* removing 'C:/Users/AndreeValleCampos/Documents/0projects/howto/renv/staging/1/SparseM'
------------------------------------------------------------------------------ 
R was unable to find the gfortran binary.
gfortran is required for the compilation of FORTRAN source files.
Please check that gfortran is installed and available on the PATH.
Please see https://stackoverflow.com/q/35999874 for more information.

Reason(s):
- "make: gfortran: No such file or directory"
install of package 'SparseM' failed [error code 1]

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

No branches or pull requests

3 participants