[Openmp-dev] CMake overhaul

Peyton, Jonathan L jonathan.l.peyton at intel.com
Mon Jun 22 14:26:16 PDT 2015


Hello everyone,

I have been working on overhauling the CMake build system for the LLVM OpenMP Runtime library.  Instead of sending 1000 small updates, I decided to do a complete refactoring/reorganizing/renaming/you-name-it-I-did-it.  **All the interface variables are still the same (LIBOMP_OS, LIBOMP_ARCH, etc.)**.  So there was no change there.  Here are the major changes:
1) Renaming internal variables/macros/functions - everything has libomp_ or LIBOMP_ prefixed to it unless maybe if it is a local variable/parameter inside a function/macro.
2) config-ix.cmake added - compiler flag checks, linker flag checks, some feature checks, threading-model check.  This means cmake/${CMAKE_C_COMPILER_ID}/*Flags.cmake directories/files are deleted.
3) All files inside cmake/ subdirectory are renamed to Libompxyz.cmake
4) I cut off most of the vestigial parts that were a part of the translation of build.pl system.  There are still a few that remain like LibompExports.cmake (copying things to exports/ subdirectory) and LibompMicroTests.cmake (small tests to run on the just created library.  This is invoked with make libomp-micro-tests), but these can easily be cut off because they are in their own files and surrounded by an if() guard in the CMakeLists.txt file.
5) Added LLVM-architecture detection if we are part of an LLVM build.
6) If you want, you can use LIBOMP_ARCH=i386 or LIBOMP_ARCH=x86_64 instead of LIBOMP_ARCH=32 or LIBOMP_ARCH=32e (although 32 and 32e still exist)
7) Unused functions/macros have been cut away.

This is easier to review if you just patch and take a look at files runtime/CMakeLists.txt, runtime/src/CMakeLists.txt, cmake/Libomp*.cmake:
$ patch -p1 -E < CMake_overhaul_v1.patch
[-E removes empty files created by the patch]

I've tested this out on x86 Linux, Mac, MIC, Windows and it works, but I can't test it on other architectures.

Leave feedback, recommendations.

-- Johnny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20150622/64f64f20/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMake_overhaul_v1.patch
Type: application/octet-stream
Size: 196926 bytes
Desc: CMake_overhaul_v1.patch
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20150622/64f64f20/attachment.obj>


More information about the Openmp-dev mailing list