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

openmp wasn't detected on mac with installed llvm and libomp #543

Open
yqy6611 opened this issue Sep 10, 2024 · 3 comments
Open

openmp wasn't detected on mac with installed llvm and libomp #543

yqy6611 opened this issue Sep 10, 2024 · 3 comments
Assignees

Comments

@yqy6611
Copy link

yqy6611 commented Sep 10, 2024

Describe the bug

I have installed llvm and libomp successfully and set configure arguments, yet openmp still couldn't be detected.

Code for Reproduction

install.packages('abess', type = 'source')

Desktop (please complete the following information):

  • OS: macOS sonoma
  • R Version: 4.4.1
  • Package Version: 0.4.9

Screenshots

  • installing source package ‘abess’ ...
    ** package ‘abess’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether the compiler supports GNU C++... yes
    checking whether /opt/homebrew/opt/llvm/bin/clang++ accepts -g... yes
    checking for /opt/homebrew/opt/llvm/bin/clang++ option to enable C++11 features... none needed
    checking how to run the C++ preprocessor... /opt/homebrew/opt/llvm/bin/clang++ -E
    checking for gcc... /opt/homebrew/opt/llvm/bin/clang
    checking whether the compiler supports GNU C... yes
    checking whether /opt/homebrew/opt/llvm/bin/clang accepts -g... yes
    checking for /opt/homebrew/opt/llvm/bin/clang option to enable C11 features... none needed
    checking how to run the C preprocessor... /opt/homebrew/opt/llvm/bin/clang -E
    Spectra library exists.
    Complier code exists in src/ directory. Install R package according to the complier code.
    checking whether OpenMP will work in a package... no
    OpenMP is unavailable on this Mac OSX system. Training speed may be suboptimal.
    To use all CPU cores for training jobs, you should install OpenMP by running

           brew install libomp
    

configure: creating ./config.status
config.status: creating src/Makevars

@yqy6611
Copy link
Author

yqy6611 commented Sep 10, 2024

Attached is my ~/.R/Makevars:

CC=/opt/homebrew/opt/llvm/bin/clang
CXX=/opt/homebrew/opt/llvm/bin/clang++
CFLAGS += -Xclang -fopenmp
LDFLAGS += -L/opt/homebrew/opt/libomp/lib -lomp
CPPFLAGS += -I/opt/homebrew/opt/libomp/include

@Mamba413
Copy link
Collaborator

@yqy6611 Thanks for the report. It may take some time to fix this issue. However, we’ve found that abess can run quickly without using OpenMP, so you should still be able to use abess as usual for most tasks.

@yqy6611
Copy link
Author

yqy6611 commented Sep 10, 2024

@Mamba413 Well noted.

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