This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Set cmake policies CMP0074 and CMP0075 to NEW
AbandonedPublic

Authored by protze.joachim on Jun 18 2020, 1:36 AM.

Details

Summary

Building with cmake 3.16, I get the following warning:

CMake Warning (dev) at /usr/share/cmake-3.16/Modules/CheckIncludeFiles.cmake:120 (message):
  Policy CMP0075 is not set: Include file check macros honor
  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  CMAKE_REQUIRED_LIBRARIES is set to:

    m

  For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
  /home/jprotze/OMPD/llvm-project/openmp/runtime/cmake/config-ix.cmake:223 (check_include_files)
  /home/jprotze/OMPD/llvm-project/openmp/runtime/CMakeLists.txt:223 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

The cmake_minimum_required command in the OpenMP directory overwrites the policy setting of llvm. Also, we want to support stand-alone builds, so we should set the policy.

lldb introduced the same patch in : https://reviews.llvm.org/D58279

Diff Detail

Event Timeline

protze.joachim created this revision.Jun 18 2020, 1:36 AM
ye-luo added a subscriber: ye-luo.Jun 18 2020, 6:12 AM

A side question. Currently requirement is 2.8 but LLVM requires 3.4.3 and LLVM 12 will require 3.13.4. Should we align with LLVM?

OpenMP can be built stand-alone. Some HPC centers have quite old OS on their systems, therefore we only bumped cmake requirement if really necessary.

ye-luo added a comment.EditedJun 18 2020, 8:32 AM

OpenMP can be built stand-alone. Some HPC centers have quite old OS on their systems, therefore we only bumped cmake requirement if really necessary.

"We only bumped cmake requirement if really necessary." I agree to this to some extend.
"Some HPC centers have quite old OS on their systems, therefore we only bumped cmake requirement if really necessary." I don't agree with this.
HPC centers got constant requests for new cmake from cmake users and they always provide quite new cmake (within 2 years). They never relies on system cmake.
If there is only the old system cmake, building cmake is fairly easy. If sb is not able to build cmake, that person probably doesn't have the need of building libomp standalone.

Comes to the need. CMake had many rounds of change for handling CUDA since 2.8 and I don't believe current 2.8 is still valid.
I also think re-trigger cmake when make is caused by some legacy way of *.cu handling in CMake.

LLVM cmake requirement is very conservative. Most people builds openmp with llvm and the cmake version is getting validated.
It is bad someone comes and say openmp cannot be built and we find it was caused by an old cmake between 2.8 and LLVM required version.

protze.joachim retitled this revision from [OpenMP] Set cmake policy CMP0075 to NEW to [OpenMP] Set cmake policies CMP0074 and CMP0075 to NEW.

On a different system, I also get warnings for CMP0074.
The two policies were introduced with cmake 3.12. As long as we don't bump the required cmake version to at least 3.12, we need to set the policies.

protze.joachim abandoned this revision.Jul 24 2020, 1:58 PM

The cmake version was bumped to 3.14

The cmake version was bumped to 3.14

Shall we bump ​cmake_minimum_required here as well?

protze.joachim added a comment.EditedJul 24 2020, 2:31 PM

afa1afd4108d changed the minimum required version in all subdirectories, including openmp

edit: the bump was to 3.13.4