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

Issues with downloading the package #3

Closed
gabyd opened this issue Aug 17, 2018 · 3 comments
Closed

Issues with downloading the package #3

gabyd opened this issue Aug 17, 2018 · 3 comments

Comments

@gabyd
Copy link

gabyd commented Aug 17, 2018

Having an issue with downloading the bartik-weight package.

Have tried the homebrew solutions here velocyto-team/velocyto.R#2 but have had no luck.
I don't know much about this, but from my cursory glance, it might be an issue with Mac OS (which is what I'm running this on)?
Pasting the error message below.

screen shot 2018-08-17 at 11 35 45 am

@paulgp
Copy link
Owner

paulgp commented Aug 17, 2018

@jjchern , any insights?

@jjchern
Copy link
Contributor

jjchern commented Aug 17, 2018

@gabyd You're right, it's an issue with Mac OS. The flag -fopenmp tries to activate OpenMP when compiling the C++ code in the R package, but Apple's default compiler clang is still not supporting OpenMP.

For example, the clang version in my laptop is currently clang-902.0.39.1, where 902.0.39.1 is Apple's way of naming version, and it may or may not translate to clang 5.0:

~ $ /usr/bin/clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.1)

The official R project suggests updating the compiler tools:

Important note: R 3.5.0 El Capitan binaries are using Clang 6.0.0 and GNU Fortran 6.1 to provide OpenMP parallelization support and C++17 standard features. If you want to compile R packages from sources, please download GNU Fortran binary from the official GNU Fortran Binaries page - in particular OS X 10.11 gfortran 6.1. Alternatively, we are providing a copy here as well as Clang 6.0.0 binaries for OS X 10.11 and higher - see below for the download links. You can also try to use clang from Xcode, but it will be missing required features so your mileage may vary and it is not recommended.

You can go to the following link and find the recommended clang and gfortran: https://cloud.r-project.org/index.html

Then, you can

  1. download and install the two files in your mac (as of writing, the versions are gfortran-6.1.pkg and clang-6.0.0.pkg), and
  2. after installation, follow the instruction for clang:

This package will install clang 6.0.0 for OS X 10.11 (El Capitan) or higher with OpenMP support in /usr/local/clang6
In order to use this compiler you have to add /usr/local/clang6/bin to the PATH environment variable such as

> export PATH=/usr/local/clang6/bin:$PATH

That is, run the following command

export PATH=/usr/local/clang6/bin:$PATH

in your bash shell to update the PATH variable.

After these two steps, you can check the version of the clang again, and it should be like the following:

~ $ clang --version
clang version 6.0.0 (tags/RELEASE_600/final)

These new macOS toolchains will enable you to compile other R packages that use Rcpp. And you should be able to install the bartik.weight package now:

devtools::install_github("paulgp/bartik-weight/R-code/pkg")

References

@paulgp
Copy link
Owner

paulgp commented Aug 18, 2018

Great, please try this out @gabyd.

@paulgp paulgp closed this as completed Aug 18, 2018
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

3 participants