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

Figuring Out How to Install R on MacOS (from source). #30

Open
r614 opened this issue Oct 18, 2019 · 1 comment
Open

Figuring Out How to Install R on MacOS (from source). #30

r614 opened this issue Oct 18, 2019 · 1 comment

Comments

@r614
Copy link
Collaborator

r614 commented Oct 18, 2019

The R Readme has a write-up on installing R from Source for MacOS and an existing open-source implementation in bash.

However, there's a few problems:

  • This requires XCode Command Line Tools and several compilers. Installation of these dependencies requires sudo access.
  • This problem could be bypassed by assuming the user has these libraries installed.
  • Another solution could be to host a server with several docker images, build the pkg using a cookiecutter image to ensure consistent folder/file paths and download it on the user's laptop for installation.
@r614
Copy link
Collaborator Author

r614 commented Oct 18, 2019

Bash Script for start-to-finish R building on Intel PCs from R-Project
Assumes GNU Foltran and XCode are installed.

PATH=/usr/X11/bin:/usr/local/bin:$PATH
export PATH
LANG=C
export LANG
svn co https://svn.r-project.org/R/trunk R-devel
# you may have to accept a certificate here
cd R-devel
tools/rsync-recommended
cd ..
# got the sources, on to building 64-bit R
mkdir rd64
cd rd64
../R-devel/configure SHELL='/bin/bash' \
r_arch=x86_64 \
CC="gcc -arch x86_64 -std=gnu99" \
CXX="g++ -arch x86_64" \
OBJC="gcc -arch x86_64" \
F77="gfortran -arch x86_64" \
FC="gfortran -arch x86_64" \
--with-system-zlib \
--with-blas='-framework vecLib' --with-lapack && \
make -j4 && \
make check && \
make install
cd ..
# if you want a 32-bit build as well, continue here
mkdir rd32
cd rd32
../R-devel/configure SHELL='/bin/bash' \
r_arch=i386 \
CC="gcc-4.0 -arch i386 -std=gnu99" \
CXX="g++-4.0 -arch i386" \
OBJC="gcc-4.0 -arch i386" \
F77="gfortran-4.0 -arch i386" \
FC="gfortran-4.0 -arch i386" \
--with-system-zlib \
--with-blas='-framework vecLib' --with-lapack && \
make -j4 && \
make check && \
make install
cd ..
# done - you should have 32-bit and 64-bit R
# set r_arch on the command line to start the corresponding R

Also found a FAQ that might be useful.

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

No branches or pull requests

1 participant