[Openmp-dev] cmake build integration
Hahnfeld, Jonas
Hahnfeld at itc.rwth-aachen.de
Thu Apr 30 03:56:25 PDT 2015
Hi,
Sorry for the trouble.
ompt.h should only be generated when it is enabled. The attached (incremental) patch fixes this and applies the changed style for OMPT output as well.
Regards,
Jonas
From: openmp-dev-bounces at cs.uiuc.edu [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Jack Howarth
Sent: Thursday, April 30, 2015 12:19 PM
To: Peyton, Jonathan L
Cc: openmp-dev at cs.uiuc.edu
Subject: Re: [Openmp-dev] cmake build integration
Jonathan,
Thanks in advance. FYI, the context of the patch was disturbed by OMPT commits. The attached version adjusts your previous patch for those changes.
Jack
On Wed, Apr 29, 2015 at 11:16 AM, Peyton, Jonathan L <jonathan.l.peyton at intel.com<mailto:jonathan.l.peyton at intel.com>> wrote:
Yes, I think I can get that to work.
-- Johnny
From: Jack Howarth [mailto:howarth.mailing.lists at gmail.com<mailto:howarth.mailing.lists at gmail.com>]
Sent: Tuesday, April 28, 2015 9:26 PM
To: Peyton, Jonathan L
Cc: openmp-dev at cs.uiuc.edu<mailto:openmp-dev at cs.uiuc.edu>
Subject: Re: [Openmp-dev] cmake build integration
Jonathan,
The preliminary version of the cmake support worked perfectly here on darwin with one caveat. The libiomp5.dylib built was only x86_64 and not a fat binary with both x86_64 and i386 code. Could you add a -DCMAKE_LIBIOMP5_FAT option or something similar to allow the build to be toggled to produce a fat binary for libiomp5.dylib on darwin? Thanks in advance.
Jack
On Tue, Apr 28, 2015 at 7:11 PM, Peyton, Jonathan L <jonathan.l.peyton at intel.com<mailto:jonathan.l.peyton at intel.com>> wrote:
I forgot to address modifications to projects/CMakeLists.txt. When it comes time, this is a one line change to this file that isn’t necessary for testing this patch because the projects/CMakeLists.txt file scans for any directory with a CMakeLists.txt in it and tries to build it. It would look something like this:
--- a/projects/CMakeLists.txt
+++ b/projects/CMakeLists.txt
@@ -6,6 +6,7 @@ foreach(entry ${entries})
if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)
if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND
+ (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx))
add_subdirectory(${entry})
endif()
@@ -20,6 +21,9 @@ if(${LLVM_BUILD_RUNTIME})
if(NOT MSVC)
add_llvm_external_project(libcxx)
endif()
+ if(NOT MSVC)
+ add_llvm_external_project(openmp)
+ endif()
if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT)
add_llvm_external_project(compiler-rt)
endif()
-- Johnny
From: openmp-dev-bounces at cs.uiuc.edu<mailto:openmp-dev-bounces at cs.uiuc.edu> [mailto:openmp-dev-bounces at cs.uiuc.edu<mailto:openmp-dev-bounces at cs.uiuc.edu>] On Behalf Of Peyton, Jonathan L
Sent: Tuesday, April 28, 2015 6:05 PM
To: Jack Howarth; openmp-dev at cs.uiuc.edu<mailto:openmp-dev at cs.uiuc.edu>
Subject: Re: [Openmp-dev] cmake build integration
Yes, I currently have a preliminary version for this functionality. It includes:
1) very basic top level CMakeLists.txt file which only calls add_subdirectory(runtime)
2) correct install target, which will install in $DESTDIR/$CMAKE_INSTALL_PREFIX/lib{LLVM_LIBDIR_SUFFIX} for the libray, $DESTDIR/$CMAKE_INSTALL_PREFIX/lib{LLVM_LIBDIR_SUFFIX}/clang/{CLANG_VERSION}/include for omp.h and iomp.h
3) I also have it recognize when it is a standalone build, so it knows when to ignore LLVM_ based variables, etc.
I have attached the whole thing as one patch here if you want to try it out or take a look at it.
Keep in mind that a lot of the changes are to the cmake/MicroTests.cmake file which is a refactoring job but not critical for
LLVM integration.
To try this out:
1) checkout LLVM
2) checkout clang into llvm/tools
3) checkout compiler-rt into llvm/projects
4) checkout openmp into llvm/projects
5) apply the patch to the llvm/projects/openmp
6) cd llvm/
7) mkdir build && cd build
8) cmake -DCMAKE_INSTALL_PREFIX=install –DCMAKE_C_COMPILER=…
9) make
10) make install
The final libiomp5.so should be in CMAKE_INSTALL_PREFIX/lib
And omp.h and iomp.h should be in CMAKE_INSTALL_PREFIX/lib/clang/3.x.x/include
I haven’t bothered putting the Fortran headers and modules in any install target yet but that can be done if necessary.
-- Johnny
From: openmp-dev-bounces at cs.uiuc.edu<mailto:openmp-dev-bounces at cs.uiuc.edu> [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Jack Howarth
Sent: Tuesday, April 28, 2015 5:08 PM
To: openmp-dev at cs.uiuc.edu<mailto:openmp-dev at cs.uiuc.edu>
Subject: [Openmp-dev] cmake build integration
Is anyone working on modifications to the projects/CMakeLists.txt in llvm and the missing top-level CMakeLists.txt file for openmp? The openmp merge seems to be making rapid progress towards passing the OpenMP3.1_Validation test suite with the recent and proposed commits so it might be about time to start implementing the missing support for building openmp within the llvm cmake build infrastructure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20150430/ee4c5f2b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_integration_ompt.patch
Type: application/octet-stream
Size: 2154 bytes
Desc: cmake_integration_ompt.patch
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20150430/ee4c5f2b/attachment.obj>
More information about the Openmp-dev
mailing list