[Openmp-dev] Initial Intel Cmake Build System Patch

Peyton, Jonathan L jonathan.l.peyton at intel.com
Thu Jul 3 12:40:19 PDT 2014


Jack,
To fix the parallel build issue, here is the patch:


--- old/CMakeLists.txt  2014-07-03 14:30:55.431938000 -0500
+++ new/CMakeLists.txt  2014-07-03 14:29:26.873741000 -0500
@@ -596,6 +596,7 @@ set_target_properties(iomp5 PROPERTIES
     LINKER_LANGUAGE C            # use C Compiler for linking step (Windows should use link.exe directly)
     SKIP_BUILD_RPATH true        # have Mac linker -install_name just be "-install_name libiomp5.dylib"
)
+add_dependencies(lib iomp5)

# Linking command will include libraries in ld_flags_libs
target_link_libraries(iomp5 ${ld_flags_libs})



Hope this helps!

Johnny

From: Jack Howarth [mailto:howarth.mailing.lists at gmail.com]
Sent: Thursday, July 3, 2014 12:25 PM
To: Peyton, Jonathan L
Cc: C. Bergström; openmp-dev at dcs-maillist2.engr.illinois.edu
Subject: Re: [Openmp-dev] Initial Intel Cmake Build System Patch

Jonathan,
     The second_intel-cmake.patch seems to have introduced a race condition when using parallel make on darwin. I now find that…

% cd openmp-3.5.0/runtime
% mkdir build
% cd build
% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Dos=mac -Darch=32 ..
% make -j 2
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Perl: /usr/bin/perl (found version "5.12.3")

------------------- CONFIGURATION --------------------------
Operating System : mac
Architecture     : 32
Build Type       : release
OpenMP Version   : 40
Lib Type         : normal
Stats-Gathering  : OFF
Fortran Modules  : OFF
Build            : development
------------------------------------------------------------

-- The ASM compiler identification is Clang
-- Found assembler: /usr/bin/clang
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/howarth/llvm-svn/openmp-3.5.0/runtime/build
[Jacks-MacBook-Pro:openmp-3.5.0/runtime/build] howarth% make -j 2
Scanning dependencies of target inc
Scanning dependencies of target needed-headers
[  2%] [  4%] Generating ../exports/mac_32/include_compat/.dir
Generating kmp_i18n_id.inc
[  6%] Generating iomp_lib.h
[  8%] Generating ../exports/mac_32/include_compat/iomp_lib.h
[  8%] Built target inc
[ 10%] Generating kmp_i18n_default.inc
[ 12%] Generating omp.h
Scanning dependencies of target lib
[ 14%] Generating ../exports/mac_32/lib.thin/.dir
[ 14%] Built target needed-headers
make[2]: *** No rule to make target `unstripped/libiomp5.dylib', needed by `libiomp5.dylib'.  Stop.
make[2]: *** Waiting for unfinished jobs....
Scanning dependencies of target iomp5
[ 17%] Generating .dir
make[1]: *** [CMakeFiles/lib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 19%] [ 21%] Building C object CMakeFiles/iomp5.dir/src/kmp_ftn_cdecl.c.o
Building C object CMakeFiles/iomp5.dir/src/kmp_ftn_extra.c.o
[ 23%] [ 25%] Building C object CMakeFiles/iomp5.dir/src/kmp_version.c.o
Building C object CMakeFiles/iomp5.dir/src/kmp_alloc.c.o
[ 27%] Building C object CMakeFiles/iomp5.dir/src/kmp_atomic.c.o
[ 29%] Building C object CMakeFiles/iomp5.dir/src/kmp_csupport.c.o
[ 31%] Building C object CMakeFiles/iomp5.dir/src/kmp_debug.c.o
[ 34%] Building C object CMakeFiles/iomp5.dir/src/kmp_itt.c.o
[ 36%] Building C object CMakeFiles/iomp5.dir/src/kmp_environment.c.o
[ 38%] Building C object CMakeFiles/iomp5.dir/src/kmp_error.c.o
[ 40%] Building C object CMakeFiles/iomp5.dir/src/kmp_global.c.o
[ 42%] Building C object CMakeFiles/iomp5.dir/src/kmp_i18n.c.o
[ 44%] Building C object CMakeFiles/iomp5.dir/src/kmp_io.c.o
[ 46%] Building C object CMakeFiles/iomp5.dir/src/kmp_runtime.c.o
[ 48%] Building C object CMakeFiles/iomp5.dir/src/kmp_settings.c.o
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:3456:29: warning: using the result of an assignment as a condition without
      parentheses [-Wparentheses]
            } while ( value = semicolon ? semicolon + 1 : NULL );/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_runtime.c:4433:89: warning: for loop has empty body [-Wempty-body]
    for( gtid=(initial_thread ? 0 : 1) ; TCR_PTR(__kmp_threads[gtid]) != NULL ; gtid++ );
                                                                                        ^
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_runtime.c:4433:89: note: put the semicolon on a separate line to silence this warning

                      ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:3456:29: note: place parentheses around the assignment to silence this warning
            } while ( value = semicolon ? semicolon + 1 : NULL );
                            ^
                      (                                       )
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:3456:29: note: use '==' to turn this assignment into an equality comparison
            } while ( value = semicolon ? semicolon + 1 : NULL );
                            ^
                            ==
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:4018:53: warning: '&&' within '||' [-Wlogical-op-parentheses]
        if ( ( ( *next < '0' ) || ( *next > '9' ) ) && ( *next !=',') || ( total > 2 ) ) {
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ ~~
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:4018:53: note: place parentheses around the '&&' expression to silence this
      warning
        if ( ( ( *next < '0' ) || ( *next > '9' ) ) && ( *next !=',') || ( total > 2 ) ) {
                                                    ^
             (                                                       )
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:5167:13: warning: '&&' within '||' [-Wlogical-op-parentheses]
            &&
            ^~
/Users/howarth/llvm-svn/openmp-3.5.0/runtime/src/kmp_settings.c:5167:13: note: place parentheses around the '&&' expression to silence this
      warning
            &&
            ^
3 warnings generated.
[ 51%] Building C object CMakeFiles/iomp5.dir/src/kmp_str.c.o
1 warning generated.
[ 53%] Building C object CMakeFiles/iomp5.dir/src/kmp_tasking.c.o
[ 55%] Building C object CMakeFiles/iomp5.dir/src/kmp_taskq.c.o
[ 57%] [ 59%] Building C object CMakeFiles/iomp5.dir/src/kmp_utility.c.o
Building C object CMakeFiles/iomp5.dir/src/kmp_threadprivate.c.o
[ 61%] Building C object CMakeFiles/iomp5.dir/src/thirdparty/ittnotify/ittnotify_static.c.o
[ 63%] Building C object CMakeFiles/iomp5.dir/src/z_Linux_util.c.o
[ 65%] Building C object CMakeFiles/iomp5.dir/src/kmp_gsupport.c.o
[ 68%] Building CXX object CMakeFiles/iomp5.dir/src/kmp_affinity.cpp.o
[ 70%] Building CXX object CMakeFiles/iomp5.dir/src/kmp_dispatch.cpp.o
[ 72%] Building CXX object CMakeFiles/iomp5.dir/src/kmp_lock.cpp.o
[ 74%] Building CXX object CMakeFiles/iomp5.dir/src/kmp_sched.cpp.o
[ 76%] Building CXX object CMakeFiles/iomp5.dir/src/kmp_taskdeps.cpp.o
[ 78%] Building CXX object CMakeFiles/iomp5.dir/src/kmp_cancel.cpp.o
[ 80%] Building ASM object CMakeFiles/iomp5.dir/src/z_Linux_asm.s.o
Linking C shared library unstripped/libiomp5.dylib
[ 80%] Built target iomp5
make: *** [all] Error 2

On the plus side, when using 'make -j 1', the recipe for fat binaries no longer requires 'rm -fr *' in between the 32 and 32e builds.
                  Jack

On Mon, Jun 30, 2014 at 11:49 AM, Peyton, Jonathan L <jonathan.l.peyton at intel.com<mailto:jonathan.l.peyton at intel.com>> wrote:
Hello C. Bergström,

Here is an initial look at the revised cmake system.  I'm still trying to get some Windows parts settled down and more "CMakey".
The differences from the last one:
1) Does not record a configure timestamp so only cmake v2.8.0 and up is required
2) Uses add_library() command for creating library
3) All compiler specific flags are in cmake/${CMAKE_C_COMPILER_ID}Flags.cmake
     If a particular compiler does not have a corresponding compile flags file, then a warning is issued during configuration that only common flags are going to be used (cmake/CommonFlags.cmake)
4) I moved the micro-tests to a separate file (cmake/MicroTests.cmake) remember these can be turned off via -Dtests=off when calling cmake.
5) Windows builds require MASM compiler so specify -DCMAKE_ASM_MASM_COMPILER=... for this assembler rather than -DCMAKE_ASM_COMPILER=...

[ within the top level directory that contains: runtime/ , offload/ , testsuite/ , www/ ]
To remove the old patch, type:
patch -p0 -RE < initial_intel_cmake.patch

[ within the top level directory that contains: runtime/ , offload/ , testsuite/ , www/ ]
To add new patch, type:
patch -p0 < second_intel_cmake.patch

Johnny

-----Original Message-----
From: "C. Bergström" [mailto:cbergstrom at pathscale.com<mailto:cbergstrom at pathscale.com>]
Sent: Monday, June 30, 2014 6:50 AM
To: Peyton, Jonathan L
Cc: Cownie, James H; openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:openmp-dev at dcs-maillist2.engr.illinois.edu>
Subject: Re: [Openmp-dev] Initial Intel Cmake Build System Patch
On 06/12/14 01:16 AM, Peyton, Jonathan L wrote:
> C. Bergström,
>
> I am working on this now.  I will create:
> common_flags.cmake  ,  icc.cmake  ,  gcc.cmake  ,  clang.cmake
>
> I hope to have this done in the next few days.
Hi Johnny,

It's been a couple weeks and I just wanted to ping this thread. Was Intel planning some work on cmake or should (PathScale) or others feel safe to invest time in it?

Thanks

_______________________________________________
Openmp-dev mailing list
Openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:Openmp-dev at dcs-maillist2.engr.illinois.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20140703/7e2be177/attachment.html>


More information about the Openmp-dev mailing list