Newest CMake build system patch

New features:

  1. Option to use build by specifying –DUSE_BUILDPL_RULES=true|false , default is false. When true, on Linux and Windows, builds will be compiled with debug info and optimization turned on (-g –O2) and then after the build is finished the debug info is stripped out into a separate file (libiomp5.dbg).

  2. Use CMAKE_BUILD_TYPE=Release/Debug/RelWithDebInfo, default is Release (except on Visual Studio it is Debug. I don’t know why). CMake will automatically control debug and –O flags this way. Got rid of build_type option.

  3. Got rid of .dir build recipe and instead use file(make_directory …)

  4. Very basic Visual Studio support. Can be compiled with Unix Makefiles or NMake Makefiles on Windows.

  5. Got rid of all compiler flags, so no more if(${CLANG}) or anything like that.

  6. There are tool chain files for popular compilers within the cmake/ directory. For example, there is cmake/GNU/AsmFlags.cmake cmake/GNU/CFlags.cmake and cmake/GNU/FortranFlags.cmake.

These can be expanded by seeing how CMake defines ${CMAKE_C_COMPILER_ID} for a particular compiler and then adding a directory within cmake/ called ${CMAKE_C_COMPILER_ID} and then creating AsmFlags.cmake and CFlags.cmake. If these files don’t exist for a particular compiler, a warning is given to the user.

  1. Option to either use or disregard predefined linker flags by specifying –DUSE_PREDEFINED_LINKER_FLAGS=true|false, default is true. When true, the linker flags inside CommonFlags.cmake are used. When false, they are ignored and the default CMake linker flags are used.

  2. Option to either use or disregard adaptive locks (TSX-based x86 locks) by specifying –DUSE_ADAPTIVE_LOCKS=true|false, default is true for IA-32 and Intel® 64 architectures, false otherwise.

  3. Options to APPEND user specific flags via:


-DUSER_CXX_FLAGS=<C++ Compiler flags>





Some of these details are in Build_With_CMake.txt.

To remove previous patches:

patch –p0 –RE < initial_intel_cmake.patch

patch –p0 –RE < second_intel_cmake.patch

To apply this patch:

patch –p0 < third_intel_cmake.patch

I am hoping this is going to get pushed to trunk. Then we can make smaller changes to it.

Questions? Comments?

– Johnny

third_intel_cmake.patch (131 KB)

We believe that this patch is strong enough for pushing to trunk. It has been tested using Ninja and GNU makefiles on all platforms, as well as NMake makefiles on windows.

Unless there are strong objections, we hope to commit sometime early next week.

To remove previous patches:

patch –p0 –RE < initial_intel_cmake.patch

patch –p0 –RE < second_intel_cmake.patch

patch –p0 –RE < third_intel_cmake.patch

To apply this patch:

patch –p0 < fourth_intel_cmake.patch

– Johnny

fourth_intel_cmake.patch (131 KB)