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

Desire to build bolt with different install directory for omp.h #104

Open
gregrodgers opened this issue Jun 9, 2022 · 0 comments
Open

Comments

@gregrodgers
Copy link

This simple patch allows the builder of bolt to put omp.h in a different directory. I am working with a more current LLVM omp.h than what bolt builds. With this patch, I can install bolt into the LLVM installation and not clobber omp.h.

git diff
diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt
index 042a5200..8a237805 100644
--- a/runtime/src/CMakeLists.txt
+++ b/runtime/src/CMakeLists.txt
@@ -329,7 +329,9 @@ add_dependencies(bolt-libomp-micro-tests bolt-libomp-test-deps)
 # We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib
 # We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include
 if(${OPENMP_STANDALONE_BUILD})
-  set(LIBOMP_HEADERS_INSTALL_PATH include)
+  if(NOT LIBOMP_HEADERS_INSTALL_PATH)
+      set(LIBOMP_HEADERS_INSTALL_PATH include)
+  endif()
 else()
   string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION})
   set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")

FYI, Below are the cmake options I have in our build_bolt.sh script. The above patch allows me to not clobber omp.h. I also turn off the aliases because I want bolt to be user selectable with -fopenmp=libbolt. I have a simple LLVM patch that I want to push upstream to support -fopenmp-libbolt. This does not push the sources for bolt , it simply allows the option to be used when bolt is built as an external component.

MYCMAKEOPTS="
-DCMAKE_INSTALL_PREFIX=$BOLT_INSTALL_DIR
$AOMP_ORIGIN_RPATH
-DCMAKE_C_COMPILER=$AOMP_CC_COMPILER
-DCMAKE_CXX_COMPILER=$AOMP_CXX_COMPILER
-DOPENMP_TEST_C_COMPILER=$AOMP_CC_COMPILER
-DOPENMP_TEST_CXX_COMPILER=$AOMP_CXX_COMPILER
-DCMAKE_BUILD_TYPE=Release
-DOPENMP_ENABLE_LIBOMPTARGET=OFF
-DLIBOMP_HEADERS_INSTALL_PATH=include/bolt
-DLIBOMP_INSTALL_ALIASES=OFF
-DLIBOMP_USE_ARGOBOTS=on"

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

1 participant