llnl / llnl/blt

Language-based generator expressions

Open
#205 5 comments 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

@mclarsen came across a problem with the openmp generator expressions that were introduced in #190.

In his BLT-based code (ascent), the main library was built with Fortran support (``ENABLE_FORTRAN=ON``) and openmp support (``ENABLE_OPENMP=ON``). He then has a ``C++`` example application that uses the installed version of this library.

The example application pulls in the cmake install file for the library, which has Fortran generator expressions in its link flags, leading to a (non-terminal, but annoying) cmake error:

```cmake
CMake Error at CMakeLists.txt:82 (target_link_libraries):
Error evaluating generator expression:
$
$ Unknown language.
```

Here is a sanitized version of the offending lines in the generated cmake install file from the library:
```cmake
set_target_properties(ascent PROPERTIES
INTERFACE_COMPILE_OPTIONS ";\$<\$>:-fopenmp>;\$<\$:-fopenmp>"
INTERFACE_INCLUDE_DIRECTORIES ""
INTERFACE_LINK_LIBRARIES ""
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ""
)
```

Note: It seems that this warning has been removed from newer versions of cmake (i.e. versions greater than 3.12 -- see https://gitlab.kitware.com/cmake/cmake/merge_requests/2031).

Thoughts: @rblake-llnl (or others)

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 reviewing the OpenMP generator expressions introduced in issue #190 and the generated CMake install file shown here. Reproduce the C++ consumer case with ENABLE_FORTRAN=ON and ENABLE_OPENMP=ON across the referenced CMake versions, then establish whether completion means removing the unknown-language error or documenting that newer CMake versions already avoid it.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, fortran
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.