Skip to content

[OpenMP] Allow setting OPENMP_INSTALL_LIBDIR #77533

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

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

mstorsjo
Copy link
Member

@mstorsjo mstorsjo commented Jan 9, 2024

The comment indicate that it should be possible, but as long as it wasn't a cache variable, the cmake script overwrote whatever variable the user had set.

The comment indicate that it should be possible, but as long as it
wasn't a cache variable, the cmake script overwrote whatever
variable the user had set.
@mstorsjo mstorsjo added cmake Build system in general and CMake in particular openmp labels Jan 9, 2024
@llvmbot llvmbot added openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime labels Jan 9, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2024

@llvm/pr-subscribers-openmp

Author: Martin Storsjö (mstorsjo)

Changes

The comment indicate that it should be possible, but as long as it wasn't a cache variable, the cmake script overwrote whatever variable the user had set.


Full diff: https://github.com/llvm/llvm-project/pull/77533.diff

1 Files Affected:

  • (modified) openmp/CMakeLists.txt (+4-2)
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index c1c79f8e0ca93c..03068af22629f7 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -29,7 +29,8 @@ if (OPENMP_STANDALONE_BUILD)
   set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
     "Suffix of lib installation directory, e.g. 64 => lib64")
   # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
-  set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
+  set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}" CACHE STRING
+      "Path where built OpenMP libraries should be installed.")
 
   # Group test settings.
   set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -46,7 +47,8 @@ if (OPENMP_STANDALONE_BUILD)
 else()
   set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
   # If building in tree, we honor the same install suffix LLVM uses.
-  set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+  set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING
+      "Path where built OpenMP libraries should be installed.")
 
   if (NOT MSVC)
     set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that we only allowed the suffix to be changed.

@mstorsjo mstorsjo merged commit 14435a2 into llvm:main Jan 10, 2024
@mstorsjo mstorsjo deleted the openmp-install-dir branch January 10, 2024 09:24
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
The comment indicate that it should be possible, but as long as it
wasn't a cache variable, the cmake script overwrote whatever variable
the user had set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime openmp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants