Ask Your Question
1

What are the steps for building R from sources on macOS?

asked 2022-10-21 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-04-29 08:00:00 +0000

lakamha gravatar image
  1. Install Xcode and Command Line Tools: Open the Terminal app and run the command xcode-select --install. Follow the on-screen instructions to install Command Line Tools.

  2. Install Homebrew: Open the Terminal app and run the command /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)". Follow the on-screen instructions to install Homebrew.

  3. Install required dependencies: Run the command brew install gcc gfortran readline pcre cairo udunits in the Terminal app.

  4. Download the R source code: Go to the R project website (https://cran.r-project.org/sources.html) and choose the version of R that you want to download. Download the source code (.tar.gz file) to your desired directory.

  5. Extract the R source code: Open the Terminal app, go to the directory where you downloaded the R source code, and run the command tar xvzf R-x.y.z.tar.gz, where x.y.z is the version number.

  6. Configure R: Navigate to the extracted R source code directory in the Terminal app and run the command ./configure --with-readline=no --with-cairo=yes --with-libpng=yes. This will configure R with the necessary dependencies.

  7. Compile R: Run the command make in the Terminal app to compile R. This may take several minutes to complete.

  8. Install R: Once the compilation is complete, run the command sudo make install in the Terminal app to install R on your system.

  9. Verify installation: To verify that R was installed correctly, open the Terminal app and run the command R to launch the R console. You should see the R prompt (>) appear in the Terminal app.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-10-21 11:00:00 +0000

Seen: 14 times

Last updated: Apr 29 '21