[Openmp-dev] (no subject)

Jack Howarth howarth.mailing.lists at gmail.com
Fri May 30 16:34:11 PDT 2014


In case it helps the process, below are the changes to their files for
context…

--- CMakeLists.txt.orig 2014-05-30 19:25:35.000000000 -0400
+++ CMakeLists.txt 2014-05-30 18:11:18.000000000 -0400
@@ -2,11 +2,8 @@

 project(libiomp)

-enable_language(Fortran)
 enable_language(C ASM)

-
-# TODO: if compat set 5, legacy set 4
 set(VERSION 5)
 if(WIN32)
  # TODO: get build time
@@ -33,75 +30,64 @@
 endif()
 set(ARCH_STR "Intel(R) 64")

-
-# show config
-if(WIN32)
- message(STATUS "OS : Windows")
-elseif(UNIX)
- message(STATUS "OS : UNIX")
-elseif(APPLE)
- message(STATUS "OS : mac")
-endif()
-message(STATUS "Mode : ${BUILD_TYPE}")
-message(STATUS "Arch : ${ARCH}")
-
-
+set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_ITT_BUILD")
+set(COMMON_FLAGS "${COMMON_FLAGS} -D NDEBUG")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_ARCH_STR=\"\\\"${ARCH_STR}\\\"\"")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D _GNU_SOURCE")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D _REENTRANT")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_USE_ASSERT")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D BUILD_I8")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D BUILD_TV")
-set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_LIBRARY_FILE=\\\"libiomp5.so\\\"")
+if(APPLE)
+ set(COMMON_FLAGS "${COMMON_FLAGS} -D
KMP_LIBRARY_FILE=\\\"libiomp5.dylib\\\"")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
-current_version 5.0")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
-compatibility_version 5.0")
+else()
+ set(COMMON_FLAGS "${COMMON_FLAGS} -D
KMP_LIBRARY_FILE=\\\"libiomp5.so\\\"")
+endif()
 set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_VERSION_MAJOR=${VERSION}")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D CACHE_LINE=64")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_ADJUST_BLOCKTIME=1")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D BUILD_PARALLEL_ORDERED")
+set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_ASM_INTRINS")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_LOAD_BALANCE")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_CBLKDATA")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D GUIDEDLL_EXPORTS")
 set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_GOMP_COMPAT")
+set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")
+set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")

 if("${OMP_VERSION_NUM}" STREQUAL "40")
- # TODO: update when 4.0 is finalize
- set(OMP_VERSION "201107")
+ set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_50_ENABLED=0")
+ set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_41_ENABLED=0")
  set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_40_ENABLED=1")
  set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_30_ENABLED=1")
-elseif("${OMP_VERSION_NUM}" STREQUAL "30")
- set(OMP_VERSION "201107")
- set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_40_ENABLED=0")
- set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_30_ENABLED=1")
-else()
- set(OMP_VERSION "200505")
- set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_40_ENABLED=0")
- set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_30_ENABLED=0")
 endif()

+set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_ITT_NOTIFY=1")
+set(COMMON_FLAGS "${COMMON_FLAGS} -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_")
+
 set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -fPIC")

 if(${BUILD_TYPE} STREQUAL "Debug")
- set(COMMON_FLAGS "${COMMON_FLAGS} -D NDEBUG -g")
+ set(COMMON_FLAGS "${COMMON_FLAGS} -g")
 endif()

 # Silence some warnings
-set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-comment")
 set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-unused-value")
 set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-switch")
+set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-switch")

 # Disable exception handling.
 set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -fno-exceptions")

-# Improves FP speed
-set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -ffast-math")
-
 # Disable use of EBP as general purpose register.
-if(NOT ${ARCH} STREQUAL "64")
- set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -fno-omit-frame-pointer")
+if(NOT ${ARCH} STREQUAL "32e")
+ set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -m32
-fno-omit-frame-pointer")
 endif()

 set(COMMON_FLAGS "${COMMON_FLAGS} -D _KMP_BUILD_TIME=\"\\\"${BUILD_TIME}
UTC\\\"\"")

-
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} ${C_CXX_COMMON_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}
${C_CXX_COMMON_FLAGS}")


--- src/CMakeLists.txt.orig 2014-05-30 19:31:39.000000000 -0400+++
src/CMakeLists.txt 2014-05-30 19:31:07.000000000 -0400@@ -5,6 +5,7 @@
  include
  include/${OMP_VERSION_NUM}
  i18n
+ thirdparty/ittnotify
  ${CMAKE_CURRENT_BINARY_DIR}
  )

@@ -19,16 +20,17 @@
  kmp_threadprivate.c
  kmp_taskq.c
  kmp_tasking.c
+ kmp_taskdeps.cpp
  kmp_str.c
  kmp_settings.c
  kmp_sched.cpp
  kmp_runtime.c
  kmp_lock.cpp
+ kmp_itt.c
  kmp_io.c
  kmp_i18n.c
  kmp_gsupport.c
  kmp_global.c
- kmp_ftn_stdcall.c
  kmp_ftn_extra.c
  kmp_ftn_cdecl.c
  kmp_error.c
@@ -36,15 +38,17 @@
  kmp_dispatch.cpp
  kmp_debug.c
  kmp_csupport.c
+ kmp_cancel.cpp
  kmp_atomic.c
  kmp_alloc.c
  kmp_affinity.cpp
+ thirdparty/ittnotify/ittnotify_static.c
 )

 set_source_files_properties(${SRCS} PROPERTIES LANGUAGE CXX)

 set_source_files_properties(${ASM_SRCS} PROPERTIES LANGUAGE CXX)
-set_source_files_properties(${ASM_SRCS} PROPERTIES COMPILE_FLAGS
"-DKMP_GOMP_COMPAT -DKMP_ARCH_X86_64 -x assembler-with-cpp")
+set_source_files_properties(${ASM_SRCS} PROPERTIES COMPILE_FLAGS "-O2")

 # TODO: config parameter
 if(WIN32)
@@ -67,10 +71,17 @@
  OUTPUT omp.h
  COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/../tools/expand-vars.pl --strict
-D Revision=\"\\$$Revision\" -D Date=\"\\$$Date\" -D
KMP_TYPE=\"Performance\" -D KMP_ARCH=\"\\\"${ARCH_STR}\\\"\" -D
KMP_VERSION_MAJOR=${VERSION} -D KMP_VERSION_MINOR=0 -D
KMP_VERSION_BUILD=00000000 -D KMP_BUILD_DATE=\"${BUILD_TIME} UTC\" -D
KMP_TARGET_COMPILER=12 -D KMP_DIAG=0 -D KMP_DEBUG_INFO=0 -D
OMP_VERSION=${OMP_VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/include/${OMP_VERSION_NUM}/omp.h.var omp.h
  )
+if(NOT ${ARCH} STREQUAL "32e")
 add_custom_command(
  OUTPUT z_Linux_asm.o
- COMMAND g++ -c -o z_Linux_asm.o -DKMP_GOMP_COMPAT -DKMP_ARCH_X86_64 -x
assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SRCS}
+ COMMAND clang++ -m32 -c -o z_Linux_asm.o -DKMP_GOMP_COMPAT -DKMP_ARCH_X86
-x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SRCS}
 )
+else()
+add_custom_command(
+ OUTPUT z_Linux_asm.o
+ COMMAND clang++ -c -o z_Linux_asm.o -DKMP_GOMP_COMPAT -DKMP_ARCH_X86_64
-x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SRCS}
+)
+endif()

 add_custom_target(gen_kmp_i18n DEPENDS kmp_i18n_id.inc
kmp_i18n_default.inc omp.h z_Linux_asm.o)




On Fri, May 30, 2014 at 7:18 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
> > From: "Jack Howarth" <howarth.mailing.lists at gmail.com>
> > To: "Hal Finkel" <hfinkel at anl.gov>
> > Cc: openmp-dev at dcs-maillist2.engr.illinois.edu, "C. Bergström" <
> cbergstrom at pathscale.com>
> > Sent: Friday, May 30, 2014 6:10:22 PM
> > Subject: Re: [Openmp-dev] (no subject)
> >
> >
> > Hal,
> > Even if that is problematic, starting over is fairly
> > straight-forward. Their CMakelists.txt is simply a directly
> > repetition of the commands emitted from the build as done by
> > build.pl . So if they are difficult about it, just take a printout
> > of the output for the current build with 'make compiler=clang" and
> > code the Cmakelist.txt from that. If you look carefully, you will
> > see that they are replicating this down to the exact order of the
> > parameters on the compiler calls. It is very difficult to see how
> > that could be intellectual property in any fashion since replicating
> > the output of the build.pl currently in llvm.org 's openmp results
> > in the same ordering. Note that their files are only a crude
> > starting point and nowhere near what we will need for llvm.
>
> Yes, I understand. An C. has generally been forthcoming about this kind of
> thing. However, I'm not about to make an IP call here, and we have a
> policy. If he does not grant explicit permission soon, I recommend that you
> start over.
>
>  -Hal
>
> > Jack
> >
> >
> >
> > On Fri, May 30, 2014 at 6:40 PM, Hal Finkel < hfinkel at anl.gov >
> > wrote:
> >
> >
> > Jack,
> >
> > Before you go too far with this, do we have Pathscale's explicit
> > contribution of their build files? (I've cc'd C. Bergstrom so that
> > he can comment directly).
> >
> > Thanks,
> > Hal
> >
> >
> >
> > ----- Original Message -----
> > > From: "Jack Howarth" < howarth.mailing.lists at gmail.com >
> > > To: openmp-dev at dcs-maillist2.engr.illinois.edu
> > > Sent: Friday, May 30, 2014 5:28:33 PM
> > > Subject: [Openmp-dev] (no subject)
> > >
> > >
> > >
> > > Attached is a first pass at modifying the cmakefiles from
> > > https://github.com/pathscale/openmprtl/blob/master/itt/libomp_oss
> > > to
> > > build openmp. I noticed that the existing build.pl doesn't actually
> > > build a fat shared library on darwin. The attached changes can does
> > > this in an indirect fashion with…
> > >
> > >
> > > % cd runtime
> > > % mkdir build_32
> > > % cd build_32
> > > % cmake -DARCH="32" ..
> > > % make VERBOSE=1
> > > % cd ..
> > > % mkdir build_32e
> > > % cmake -DARCH="32e" ..
> > > % make VERBOSE=1
> > > % cd ..
> > > % lipo ./build_32/src/libiomp5.dylib ./build_32e/src/libiomp5.dylib
> > > -create -o libiomp5.dylib
> > > % file libiomp5.dylib
> > >
> > > libiomp5.dylib: Mach-O universal binary with 2 architectures
> > > libiomp5.dylib (for architecture x86_64): Mach-O 64-bit dynamically
> > > linked shared library x86_64
> > > libiomp5.dylib (for architecture i386): Mach-O dynamically linked
> > > shared library i386
> > >
> > >
> > > Normally we could do this in cmake by passing '-arch i386 -arch
> > > x86_64' but use of assembly code in the build gums that up.
> > > _______________________________________________
> > > Openmp-dev mailing list
> > > Openmp-dev at dcs-maillist2.engr.illinois.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev
> > >
> >
> > --
> > Hal Finkel
> > Assistant Computational Scientist
> > Leadership Computing Facility
> > Argonne National Laboratory
> >
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20140530/2e0637b8/attachment.html>


More information about the Openmp-dev mailing list