Skip to content

gfortran FLIBS search path hard coded and pointed to the wrong directory on recent installs #207

Open
@danielloader

Description

Reproduction steps:

  • MacOS 14.2
  • M1 Pro 32GB
  • R 4.1.3
brew tap r-lib/rig && brew install --cask rig
rig install 4.1
rig default 4.1-arm64
rig system add-pak
rig sysreqs add gfortran
R -e 'install.packages("actuar")'

This yields:

...
ld: warning: -single_module is obsolete
ld: warning: -multiply_defined is obsolete
ld: warning: search path '/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.2.0/11.0.0' not found
ld: library 'emutls_w' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [actuar.so] Error 1
ERROR: compilation failed for package ‘actuar’
* removing ‘/Users/daniel.loader/Library/R/arm64/4.1/library/actuar’

The downloaded source packages are in
        ‘/private/var/folders/lc/vp81kbqj7551cb12tfb3wqqm0000gn/T/RtmpYRZziz/downloaded_packages’
Warning message:
In install.packages("actuar") :
  installation of package ‘actuar’ had non-zero exit status
$ R CMD config FLIBS
-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.2.0/11.0.0 -L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lm

Setting ~/.R/Makevars to the following fixes it:

FLIBS =  -L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1 -L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lm

So my question is, where is the disconnect here and where is the FLIBS variable being set by rig when it installs R 4.1.3?

While I'm okay with having my own overrides in my home directory, however it's not a good onboarding experience for new devs in future for them to have to look in /opt/R/arm64/gfortran and try and work out the directory versions, and then override them as it's likely to change in future.

Is this something rig can resolve so the default install steps work without needing a custom Makevars file?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions