katzfuss-group / GPvecchia

Fast Gaussian-process inference using Vecchia approximations
19 stars 6 forks source link

installation on macOS #60

Closed marcinjurek closed 5 years ago

marcinjurek commented 5 years ago

I'm working with Houjie, our summer intern and he struggles to install the package on his mac computer. His problems seem to have to do with openMP. I don't use macOS and I don't have access to it. However I know @dzilber has a mac. Maybe you could help Houjie figure out what to do? @katzfuss have you dealt with that before too?

Specifically, the error is: clang: error: unsupported option '-fopenmp' and I found several blog posts talking about it which makes me think it is some actual issue (but none of them has helped so far)

Also, we might need to extend the instructions in the README file to account for that case.

dzilber commented 5 years ago

These types of issues are usually related to gcc. I made the following text file for myself when I ran into these problems. Correct the version numbers as needed.

Mac_OpenMP
What to do to get code to complile on OSX Sierra.  

In terminal:  
1.  brew install gcc --without-multilib
2.  brew link --overwrite gcc
3.  mkdir ~/.R
4.  touch Makevars
5.  vi Makevars
    (create lines below to link R compiler to new gcc compilers)
        CXX=/usr/local/Cellar/gcc/7.3.0/bin/g++-7
        CC=/usr/local/Cellar/gcc/7.3.0/bin/gcc-7
    (hit esc then type :wq to write and save)

6 Restart R, should  be able to compile now.  If not, you may need the next command
7a.  xcode-select --install.  # to install command line developer tools
7b.  Manual: go to developer.apple.com and download Command Line Tools for Xcode
marcinjurek commented 5 years ago

Thanks a lot Daniel! We'll try that and see how it helps! Do you think some of it should go to the installation instructions?

dzilber commented 5 years ago

I think of it as a problem with the user's computer rather than the GPVecchia package, but people might appreciate the help. We should try to get a compiled version on to CRAN though and avoid this issue.

marcinjurek commented 5 years ago

looks like the problem has to do with using gcc>7.2 with omp. https://stackoverflow.com/questions/47081274/openmp-error-w-13-not-specified-in-enclosing-parallel

marcinjurek commented 5 years ago

so everything works under g++/gcc version 8.3. Version 9.1 has only been released in early May. I think we can easily wait with supporting g++ v.9