0

when I do install.packages() in R, I have an error message like this:

as: unrecognized option '--gdwarf-5'
ERROR: compilation failed for package ‘statmod’

and I think the error comes from the fortran compiler. I would like to change this one as default compiler for R. Actually the one used in R 4.3.0 is:

 using Fortran compiler: `‘GNU Fortran (Homebrew GCC 13.1.0) 13.1.0’`

The Ubuntu version I'm using is:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:    18.04
Codename:   bionic
jonny jeep
  • 383
  • 3
  • 12
  • You can probably set the path for your fortran compiler with a custom Makevars setting: https://stackoverflow.com/questions/58794036/what-where-is-the-r-makevars-file – MrFlick Jun 12 '23 at 17:36
  • 1
    Why do you think the error comes from the Fortran compiler rather than the assembler (`as`)? – francescalus Jun 12 '23 at 18:21
  • @francescalus because before installing homebrew an its compiler it was working fine – jonny jeep Jun 12 '23 at 21:23
  • If the Fortran compiler you've installed is targeting an assembler which isn't the assembler being found (which is possibly the case), why would you want to change the Fortran compiler (which you presumably installed for a reason) instead of ensuring that the targeted assembler is used? – francescalus Jun 12 '23 at 21:48
  • ok, so the compiler is using C compiler: ‘gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0’ using Fortran compiler: ‘GNU Fortran (Homebrew GCC 13.1.0) 13.1.0’ – jonny jeep Jun 12 '23 at 21:50
  • You probably really don't want to mix different versions and distributions of components of GCC. Can you try using a consistent GCC toolchain (all homebrew, or all distro)? – francescalus Jun 12 '23 at 21:56
  • yes, the point is I'm not able to set them. Could you help me? – jonny jeep Jun 12 '23 at 21:58

0 Answers0