stocnet/goldfish

Unable to load on MacOS with new chip

Closed this issue · 3 comments

I am on a new mac laptop trying to load goldfish on RStudio.

  1. I downloaded the .tgz macOS file from github
  2. In RStudio, I went to install from package archive file
  3. I selected the downloaded .tgz file
  4. It downloaded
  5. I used the code library(goldfish) to try and load the package
  6. I received the error message below:
Error: package or namespace load failed for ‘goldfish’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/goldfish/libs/goldfish.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/goldfish/libs/goldfish.so, 6): Library not loaded: /usr/local/gfortran/lib/libgfortran.5.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/goldfish/libs/goldfish.so
  Reason: image not found

Expected behavior
I expected the package to load. Prof. Hollway indicated that this is an issue with my computer processing chip.

Desktop (please complete the following information):

  • OS: MacOS Big Sur v. 11.2.2
  • Chip: Apple M1
  • R Version 4.1.1 High Sierra Build
  • RStudio Version 2021.09.0
  • Goldfish Version 1.5.1

Additional context
Add any other context about the problem here.

@auzaheta, is this just a case of adding another address to look for gfortran on Mac systems with the new M1 processor, or do the binaries need to be built differently, e.g. by CRAN or is there a Github workflow that we can use to produce such a binary?

@cpuga4, could you check the path where gfortran is installed? From the terminal, you can run the following lines to find the paths:

which gfortran

gfortran -print-file-name=libgfortran.dylib | xargs dirname

You might want to take a look at this blog entry explaining the transition to the new Mac architecture.

Other M1 users reported that installing gcc with homebrew doesn't automatically install gfortran. You can install gfortran from here if you don't have it.

Otherwise, let me know. I can post the content of a makevars file that will allow installing goldfish using remotes.

@cpuga4, I'll close this and refer to the links in the previous comment when macOS instructions are updated.

Feel free to follow with comments on this topic on issue #62