llnl / llnl/blt

Serac: Problem with OpenMP + CUDA

Open
#589 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
296
Forks
66
Avg merge
1h 3m
Merged PRs (30d)
1

Description

In serac, we're running into compilation issues on OpenMP targets when CUDA is enabled. The actual error is:

```
g++: error: unrecognized command line option ‘-fopenmp=libomp’
```

It looks like this flag is coming from https://github.com/LLNL/blt/blob/develop/cmake/thirdparty/SetupOpenMP.cmake which tries to manually manage compilation flags of targets that use OpenMP.

In my experience, CMake's built-in OpenMP target works pretty well (and it does not have these issues), so I think it would be beneficial to try using that directly instead of duplicating the effort in BLT.

An example CMake project that uses CUDA + OpenMP together is available here:

https://github.com/samuelpmishLLNL/openmp_cuda_example_project

it shows how to optionally enable CUDA language support, how to install the library, and how to use it as a subdirectory from another library as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading cmake/thirdparty/SetupOpenMP.cmake and reproducing the CUDA plus OpenMP configuration shown in the linked openmp_cuda_example_project. Compare BLT's flag handling with CMake's built-in OpenMP target. Done means OpenMP targets configure and compile with CUDA enabled without the unsupported -fopenmp=libomp error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.