Index: runtime/CMakeLists.txt =================================================================== --- runtime/CMakeLists.txt +++ runtime/CMakeLists.txt @@ -23,6 +23,10 @@ set(LIBOMP_STANDALONE_BUILD TRUE) endif() +# Set libomp version +set(LIBOMP_VERSION_MAJOR 5) +set(LIBOMP_VERSION_MINOR 0) + # These include files are in the cmake/ subdirectory include(LibompUtils) include(LibompGetArchitecture) @@ -82,11 +86,17 @@ set(LIBOMP_LIB_TYPE normal CACHE STRING "Performance,Profiling,Stubs library (normal/profile/stubs)") libomp_check_variable(LIBOMP_LIB_TYPE normal profile stubs) -set(LIBOMP_VERSION 5 CACHE STRING - "Produce libguide (version 4) or libomp (version 5)") set(LIBOMP_OMP_VERSION 41 CACHE STRING "The OpenMP version (41/40/30)") libomp_check_variable(LIBOMP_OMP_VERSION 41 40 30) +# Set the OpenMP Year and Month assiociated with version +if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40) + set(LIBOMP_OMP_YEAR_MONTH 201307) +elseif(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30) + set(LIBOMP_OMP_YEAR_MONTH 201107) +else() + set(LIBOMP_OMP_YEAR_MONTH 200505) +endif() set(LIBOMP_MIC_ARCH knc CACHE STRING "Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) (knf/knc). Ignored if not Intel(R) MIC Architecture build.") if("${LIBOMP_ARCH}" STREQUAL "mic") @@ -126,10 +136,12 @@ "Should exports be copied into source exports/ directory?") # Get the build number from kmp_version.c -libomp_get_build_number("${CMAKE_CURRENT_SOURCE_DIR}" LIBOMP_BUILD_NUMBER) +libomp_get_build_number("${CMAKE_CURRENT_SOURCE_DIR}" LIBOMP_VERSION_BUILD) +math(EXPR LIBOMP_VERSION_BUILD_YEAR "${LIBOMP_VERSION_BUILD}/10000") +math(EXPR LIBOMP_VERSION_BUILD_MONTH_DAY "${LIBOMP_VERSION_BUILD}%10000") # Currently don't record any timestamps -set(LIBOMP_DATE "No_Timestamp") +set(LIBOMP_BUILD_DATE "No_Timestamp") # Architecture set(IA32 FALSE) @@ -294,10 +306,10 @@ libomp_say("Lib Type -- ${LIBOMP_LIB_TYPE}") libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES}") # will say development if all zeros - if(${LIBOMP_BUILD_NUMBER} STREQUAL 00000000) + if(${LIBOMP_VERSION_BUILD} STREQUAL 00000000) set(LIBOMP_BUILD Development) else() - set(LIBOMP_BUILD ${LIBOMP_BUILD_NUMBER}) + set(LIBOMP_BUILD ${LIBOMP_VERSION_BUILD}) endif() libomp_say("Build -- ${LIBOMP_BUILD}") libomp_say("Use Stats-gathering -- ${LIBOMP_STATS}") Index: runtime/cmake/LibompDefinitions.cmake =================================================================== --- runtime/cmake/LibompDefinitions.cmake +++ runtime/cmake/LibompDefinitions.cmake @@ -11,28 +11,6 @@ function(libomp_get_definitions_flags cppflags) set(cppflags_local) - libomp_append(cppflags_local "-D USE_ITT_BUILD") - # yes... you need 5 backslashes... - libomp_append(cppflags_local "-D KMP_ARCH_STR=\"\\\\\"${LIBOMP_LEGAL_ARCH}\\\\\"\"") - libomp_append(cppflags_local "-D BUILD_I8") - libomp_append(cppflags_local "-D KMP_LIBRARY_FILE=\\\\\"${LIBOMP_LIB_FILE}\\\\\"") - libomp_append(cppflags_local "-D KMP_VERSION_MAJOR=${LIBOMP_VERSION}") - libomp_append(cppflags_local "-D KMP_NESTED_HOT_TEAMS") - - # customize to 128 bytes for ppc64 - if(${PPC64}) - libomp_append(cppflags_local "-D CACHE_LINE=128") - else() - libomp_append(cppflags_local "-D CACHE_LINE=64") - endif() - - libomp_append(cppflags_local "-D KMP_ADJUST_BLOCKTIME=1") - libomp_append(cppflags_local "-D BUILD_PARALLEL_ORDERED") - libomp_append(cppflags_local "-D KMP_ASM_INTRINS") - libomp_append(cppflags_local "-D USE_ITT_NOTIFY" IF_TRUE_1_0 LIBOMP_USE_ITT_NOTIFY) - libomp_append(cppflags_local "-D INTEL_NO_ITTNOTIFY_API" IF_FALSE LIBOMP_USE_ITT_NOTIFY) - libomp_append(cppflags_local "-D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_") - libomp_append(cppflags_local "-D KMP_USE_VERSION_SYMBOLS" IF_TRUE LIBOMP_USE_VERSION_SYMBOLS) if(WIN32) libomp_append(cppflags_local "-D _CRT_SECURE_NO_WARNINGS") @@ -40,60 +18,14 @@ libomp_append(cppflags_local "-D _WINDOWS") libomp_append(cppflags_local "-D _WINNT") libomp_append(cppflags_local "-D _WIN32_WINNT=0x0501") - libomp_append(cppflags_local "-D KMP_WIN_CDECL") libomp_append(cppflags_local "-D _USRDLL") libomp_append(cppflags_local "-D _ITERATOR_DEBUG_LEVEL=0" IF_TRUE DEBUG_BUILD) + libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD) else() libomp_append(cppflags_local "-D _GNU_SOURCE") libomp_append(cppflags_local "-D _REENTRANT") - libomp_append(cppflags_local "-D BUILD_TV") - libomp_append(cppflags_local "-D USE_CBLKDATA") - libomp_append(cppflags_local "-D KMP_GOMP_COMPAT") - endif() - - libomp_append(cppflags_local "-D USE_LOAD_BALANCE" IF_FALSE MIC) - if(NOT WIN32 AND NOT APPLE) - libomp_append(cppflags_local "-D KMP_TDATA_GTID") endif() - libomp_append(cppflags_local "-D KMP_USE_ASSERT" IF_TRUE LIBOMP_ENABLE_ASSERTIONS) - libomp_append(cppflags_local "-D KMP_DYNAMIC_LIB") - libomp_append(cppflags_local "-D KMP_STUB" IF_TRUE STUBS_LIBRARY) - if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD}) - libomp_append(cppflags_local "-D KMP_DEBUG") - endif() - libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD) - libomp_append(cppflags_local "-D BUILD_DEBUG" IF_TRUE DEBUG_BUILD) - libomp_append(cppflags_local "-D KMP_STATS_ENABLED" IF_TRUE_1_0 LIBOMP_STATS) - libomp_append(cppflags_local "-D USE_DEBUGGER" IF_TRUE_1_0 LIBOMP_USE_DEBUGGER) - libomp_append(cppflags_local "-D OMPT_SUPPORT" IF_TRUE_1_0 LIBOMP_OMPT_SUPPORT) - libomp_append(cppflags_local "-D OMPT_BLAME" IF_TRUE_1_0 LIBOMP_OMPT_BLAME) - libomp_append(cppflags_local "-D OMPT_TRACE" IF_TRUE_1_0 LIBOMP_OMPT_TRACE) - - # OpenMP version flags - set(libomp_have_omp_50 0) - set(libomp_have_omp_41 0) - set(libomp_have_omp_40 0) - set(libomp_have_omp_30 0) - if(${LIBOMP_OMP_VERSION} EQUAL 50 OR ${LIBOMP_OMP_VERSION} GREATER 50) - set(libomp_have_omp_50 1) - endif() - if(${LIBOMP_OMP_VERSION} EQUAL 41 OR ${LIBOMP_OMP_VERSION} GREATER 41) - set(libomp_have_omp_41 1) - endif() - if(${LIBOMP_OMP_VERSION} EQUAL 40 OR ${LIBOMP_OMP_VERSION} GREATER 40) - set(libomp_have_omp_40 1) - endif() - if(${LIBOMP_OMP_VERSION} EQUAL 30 OR ${LIBOMP_OMP_VERSION} GREATER 30) - set(libomp_have_omp_30 1) - endif() - libomp_append(cppflags_local "-D OMP_50_ENABLED=${libomp_have_omp_50}") - libomp_append(cppflags_local "-D OMP_41_ENABLED=${libomp_have_omp_41}") - libomp_append(cppflags_local "-D OMP_40_ENABLED=${libomp_have_omp_40}") - libomp_append(cppflags_local "-D OMP_30_ENABLED=${libomp_have_omp_30}") - libomp_append(cppflags_local "-D KMP_USE_ADAPTIVE_LOCKS" IF_TRUE_1_0 LIBOMP_USE_ADAPTIVE_LOCKS) - libomp_append(cppflags_local "-D KMP_DEBUG_ADAPTIVE_LOCKS=0") - libomp_append(cppflags_local "-D KMP_USE_INTERNODE_ALIGNMENT" IF_TRUE_1_0 LIBOMP_USE_INTERNODE_ALIGNMENT) # CMake doesn't include CPPFLAGS from environment, but we will. set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE) endfunction() Index: runtime/cmake/LibompHandleFlags.cmake =================================================================== --- runtime/cmake/LibompHandleFlags.cmake +++ runtime/cmake/LibompHandleFlags.cmake @@ -119,9 +119,9 @@ set(ldflags_local) libomp_append(ldflags_local "${CMAKE_LINK_DEF_FILE_FLAG}${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_LIB_NAME}.def" IF_DEFINED CMAKE_LINK_DEF_FILE_FLAG) - libomp_append(ldflags_local "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${LIBOMP_VERSION}.0" + libomp_append(ldflags_local "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR}" IF_DEFINED CMAKE_C_OSX_CURRENT_VERSION_FLAG) - libomp_append(ldflags_local "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBOMP_VERSION}.0" + libomp_append(ldflags_local "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR}" IF_DEFINED CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG) libomp_append(ldflags_local -Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG) libomp_append(ldflags_local -Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG) @@ -170,32 +170,6 @@ set(${fflags} ${fflags_local} PARENT_SCOPE) endfunction() -# Perl expand-vars.pl flags -function(libomp_get_evflags evflags) - set(evflags_local) - libomp_append(evflags_local "-D KMP_TYPE=\"${LIBOMP_LEGAL_TYPE}\"") - libomp_append(evflags_local "-D KMP_ARCH=\"${LIBOMP_LEGAL_ARCH}\"") - libomp_append(evflags_local "-D KMP_VERSION_MAJOR=${LIBOMP_VERSION}") - libomp_append(evflags_local "-D KMP_VERSION_MINOR=0") - libomp_append(evflags_local "-D KMP_VERSION_BUILD=${LIBOMP_BUILD_NUMBER}") - libomp_append(evflags_local "-D KMP_BUILD_DATE=\"${LIBOMP_DATE}\"") - if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD}) - libomp_append(evflags_local "-D KMP_DIAG=1") - libomp_append(evflags_local "-D KMP_DEBUG_INFO=1") - else() - libomp_append(evflags_local "-D KMP_DIAG=0") - libomp_append(evflags_local "-D KMP_DEBUG_INFO=0") - endif() - if(${LIBOMP_OMP_VERSION} EQUAL 40 OR ${LIBOMP_OMP_VERSION} GREATER 40) - libomp_append(evflags_local "-D OMP_VERSION=201307") - elseif(${LIBOMP_OMP_VERSION} EQUAL 30 OR ${LIBOMP_OMP_VERSION} GREATER 30) - libomp_append(evflags_local "-D OMP_VERSION=201107") - else() - libomp_append(evflags_local "-D OMP_VERSION=200505") - endif() - set(${evflags} ${evflags_local} PARENT_SCOPE) -endfunction() - # Perl generate-defs.pl flags (For Windows only) function(libomp_get_gdflags gdflags) set(gdflags_local) Index: runtime/src/CMakeLists.txt =================================================================== --- runtime/src/CMakeLists.txt +++ runtime/src/CMakeLists.txt @@ -9,36 +9,12 @@ #//===----------------------------------------------------------------------===// # -# Using expand-vars.pl to generate files -# - 'file' is generated using expand-vars.pl and 'file'.var -# - Any .var file should use this recipe -# TODO: Use CMake's configure_file() instead -macro(libomp_expand_vars_recipe file_dir filename) - get_source_file_property(libomp_extra_evflags ${filename} EV_COMPILE_DEFINITIONS) - if("${libomp_extra_evflags}" MATCHES "NOTFOUND") - set(libomp_extra_evflags) - else() - libomp_string_to_list("${libomp_extra_evflags}" libomp_extra_evflags) - endif() - if(NOT "${filename}" STREQUAL "") - add_custom_command( - OUTPUT ${filename} - COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/expand-vars.pl - --strict ${LIBOMP_EVFLAGS} ${libomp_extra_evflags} ${file_dir}/${filename}.var ${filename} - DEPENDS ${file_dir}/${filename}.var kmp_version.c ${LIBOMP_TOOLS_DIR}/expand-vars.pl - ) - endif() -endmacro() -libomp_get_evflags(LIBOMP_EVFLAGS) -libomp_string_to_list("${LIBOMP_EVFLAGS}" LIBOMP_EVFLAGS) -set_source_files_properties(omp_lib.h PROPERTIES EV_COMPILE_DEFINITIONS "-D KMP_INT_PTR_KIND=\"int_ptr_kind()\"") -set_source_files_properties(libomp.rc PROPERTIES EV_COMPILE_DEFINITIONS "-D KMP_FILE=${LIBOMP_LIB_FILE}" GENERATED TRUE) -libomp_expand_vars_recipe(${LIBOMP_INC_DIR} omp.h) -libomp_expand_vars_recipe(${LIBOMP_INC_DIR} ompt.h) -libomp_expand_vars_recipe(${LIBOMP_INC_DIR} omp_lib.h) -libomp_expand_vars_recipe(${LIBOMP_INC_DIR} omp_lib.f) -libomp_expand_vars_recipe(${LIBOMP_INC_DIR} omp_lib.f90) -libomp_expand_vars_recipe(${LIBOMP_SRC_DIR} libomp.rc) +# Configure omp.h, kmp_config.h and ompt.h if necessary +configure_file(${LIBOMP_INC_DIR}/omp.h.var omp.h @ONLY) +configure_file(kmp_config.h.cmake kmp_config.h @ONLY) +if(${LIBOMP_OMPT_SUPPORT}) + configure_file(${LIBOMP_INC_DIR}/ompt.h.var ompt.h @ONLY) +endif() # Generate message catalog files: kmp_i18n_id.inc and kmp_i18n_default.inc add_custom_command( @@ -169,25 +145,24 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS) target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS}) -# Create *.inc and omp.h before compiling any sources -# objects depend on : .inc files and omp.h (and ompt.h if LIBOMP_OMPT_SUPPORT is on) -# This way the *.inc and omp.h are generated before any compilations take place -set(LIBOMP_NEEDED_HEADERS kmp_i18n_id.inc kmp_i18n_default.inc omp.h) -libomp_append(LIBOMP_NEEDED_HEADERS ompt.h LIBOMP_OMPT_SUPPORT) -add_custom_target(libomp-needed-headers DEPENDS ${LIBOMP_NEEDED_HEADERS}) +# Create *.inc before compiling any sources +# objects depend on : .inc files +add_custom_target(libomp-needed-headers DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc) add_dependencies(omp libomp-needed-headers) # Windows specific build rules if(WIN32) + configure_file(libomp.rc.var libomp.rc @ONLY) + # Create .def and .rc file before compiling any sources - add_custom_target(libomp-needed-windows-files DEPENDS ${LIBOMP_LIB_NAME}.def libomp.rc) + add_custom_target(libomp-needed-windows-files DEPENDS ${LIBOMP_LIB_NAME}.def) add_dependencies(omp libomp-needed-windows-files) - # z_Windows_NT-586_asm.asm (masm file) send it i386 or x86_64 architecture definition flag - if(${IA32}) - set_source_files_properties(z_Windows_NT-586_asm.asm PROPERTIES COMPILE_DEFINITIONS "_M_IA32") - elseif(${INTEL64}) - set_source_files_properties(z_Windows_NT-586_asm.asm PROPERTIES COMPILE_DEFINITIONS "_M_AMD64") - endif() + # z_Windows_NT-586_asm.asm requires definitions to be sent via command line + # It only needs the architecutre macro and OMPT_SUPPORT=0|1 + libomp_append(LIBOMP_MASM_DEFINITIONS "_M_IA32" IF_TRUE IA32) + libomp_append(LIBOMP_MASM_DEFINITIONS "_M_AMD64" IF_TRUE INTEL64) + libomp_append(LIBOMP_MASM_DEFINITIONS "OMPT_SUPPORT" IF_TRUE_1_0 LIBOMP_OMPT_SUPPORT) + set_source_files_properties(z_Windows_NT-586_asm.asm PROPERTIES COMPILE_DEFINITIONS "${LIBOMP_MASM_DEFINITIONS}") set_source_files_properties(thirdparty/ittnotify/ittnotify_static.c PROPERTIES COMPILE_DEFINITIONS "UNICODE") # Create Windows import library @@ -197,7 +172,7 @@ set(LIBOMP_IMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LIBOMP_GENERATED_IMP_LIB_FILENAME ${LIBOMP_LIB_FILE}${CMAKE_STATIC_LIBRARY_SUFFIX}) set_target_properties(omp PROPERTIES - VERSION ${LIBOMP_VERSION}.0 # uses /version flag + VERSION ${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR} # uses /version flag IMPORT_PREFIX "" IMPORT_SUFFIX "" # control generated import library name when building omp ARCHIVE_OUTPUT_NAME ${LIBOMP_GENERATED_IMP_LIB_FILENAME} ) @@ -232,6 +207,9 @@ # Building the Fortran module files # One compilation step creates both omp_lib.mod and omp_lib_kinds.mod if(${LIBOMP_FORTRAN_MODULES}) + configure_file(${LIBOMP_INC_DIR}/omp_lib.h.var omp_lib.h @ONLY) + configure_file(${LIBOMP_INC_DIR}/omp_lib.f.var omp_lib.f @ONLY) + configure_file(${LIBOMP_INC_DIR}/omp_lib.f90.var omp_lib.f90 @ONLY) add_custom_target(libomp-mod ALL DEPENDS omp_lib.mod omp_lib_kinds.mod) libomp_get_fflags(LIBOMP_CONFIGURED_FFLAGS) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) Index: runtime/src/include/30/omp.h.var =================================================================== --- runtime/src/include/30/omp.h.var +++ runtime/src/include/30/omp.h.var @@ -16,10 +16,10 @@ #ifndef __OMP_H # define __OMP_H -# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR -# define KMP_VERSION_MINOR $KMP_VERSION_MINOR -# define KMP_VERSION_BUILD $KMP_VERSION_BUILD -# define KMP_BUILD_DATE "$KMP_BUILD_DATE" +# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@ +# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@ +# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@ +# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@" # ifdef __cplusplus extern "C" { Index: runtime/src/include/30/omp_lib.h.var =================================================================== --- runtime/src/include/30/omp_lib.h.var +++ runtime/src/include/30/omp_lib.h.var @@ -33,12 +33,12 @@ integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3 integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4 - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ character(*) kmp_build_date - parameter( kmp_build_date = '$KMP_BUILD_DATE' ) - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION + parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' ) + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ interface Index: runtime/src/include/30/omp_lib.f.var =================================================================== --- runtime/src/include/30/omp_lib.f.var +++ runtime/src/include/30/omp_lib.f.var @@ -36,11 +36,11 @@ use omp_lib_kinds - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD - character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE' - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ + character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@' + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/30/omp_lib.f90.var =================================================================== --- runtime/src/include/30/omp_lib.f90.var +++ runtime/src/include/30/omp_lib.f90.var @@ -32,12 +32,12 @@ use omp_lib_kinds - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ character(*) kmp_build_date - parameter( kmp_build_date = '$KMP_BUILD_DATE' ) + parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' ) integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/40/omp.h.var =================================================================== --- runtime/src/include/40/omp.h.var +++ runtime/src/include/40/omp.h.var @@ -16,10 +16,10 @@ #ifndef __OMP_H # define __OMP_H -# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR -# define KMP_VERSION_MINOR $KMP_VERSION_MINOR -# define KMP_VERSION_BUILD $KMP_VERSION_BUILD -# define KMP_BUILD_DATE "$KMP_BUILD_DATE" +# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@ +# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@ +# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@ +# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@" # ifdef __cplusplus extern "C" { Index: runtime/src/include/40/omp_lib.h.var =================================================================== --- runtime/src/include/40/omp_lib.h.var +++ runtime/src/include/40/omp_lib.h.var @@ -30,12 +30,12 @@ integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind() integer, parameter :: kmp_lock_hint_kind = omp_integer_kind - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ character(*) kmp_build_date - parameter( kmp_build_date = '$KMP_BUILD_DATE' ) + parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' ) integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/40/omp_lib.f.var =================================================================== --- runtime/src/include/40/omp_lib.f.var +++ runtime/src/include/40/omp_lib.f.var @@ -39,11 +39,11 @@ use omp_lib_kinds - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD - character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE' - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ + character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@' + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/40/omp_lib.f90.var =================================================================== --- runtime/src/include/40/omp_lib.f90.var +++ runtime/src/include/40/omp_lib.f90.var @@ -35,12 +35,12 @@ use omp_lib_kinds - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ character(*) kmp_build_date - parameter( kmp_build_date = '$KMP_BUILD_DATE' ) + parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' ) integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/41/omp.h.var =================================================================== --- runtime/src/include/41/omp.h.var +++ runtime/src/include/41/omp.h.var @@ -16,10 +16,10 @@ #ifndef __OMP_H # define __OMP_H -# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR -# define KMP_VERSION_MINOR $KMP_VERSION_MINOR -# define KMP_VERSION_BUILD $KMP_VERSION_BUILD -# define KMP_BUILD_DATE "$KMP_BUILD_DATE" +# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@ +# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@ +# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@ +# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@" # ifdef __cplusplus extern "C" { Index: runtime/src/include/41/omp_lib.h.var =================================================================== --- runtime/src/include/41/omp_lib.h.var +++ runtime/src/include/41/omp_lib.h.var @@ -30,12 +30,12 @@ integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind() integer, parameter :: kmp_lock_hint_kind = omp_integer_kind - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ character(*) kmp_build_date - parameter( kmp_build_date = '$KMP_BUILD_DATE' ) + parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' ) integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/41/omp_lib.f.var =================================================================== --- runtime/src/include/41/omp_lib.f.var +++ runtime/src/include/41/omp_lib.f.var @@ -39,11 +39,11 @@ use omp_lib_kinds - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD - character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE' - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ + character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@' + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/include/41/omp_lib.f90.var =================================================================== --- runtime/src/include/41/omp_lib.f90.var +++ runtime/src/include/41/omp_lib.f90.var @@ -35,12 +35,12 @@ use omp_lib_kinds - integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION - integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR - integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR - integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD + integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@ + integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@ + integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@ character(*) kmp_build_date - parameter( kmp_build_date = '$KMP_BUILD_DATE' ) + parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' ) integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 Index: runtime/src/kmp.h =================================================================== --- runtime/src/kmp.h +++ runtime/src/kmp.h @@ -17,6 +17,8 @@ #ifndef KMP_H #define KMP_H +#include "kmp_config.h" + /* #define BUILD_PARALLEL_ORDERED 1 */ /* This fix replaces gettimeofday with clock_gettime for better scalability on Index: runtime/src/kmp_config.h.cmake =================================================================== --- /dev/null +++ runtime/src/kmp_config.h.cmake @@ -0,0 +1,92 @@ +/* + * kmp_config.h -- Feature macros + */ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.txt for details. +// +//===----------------------------------------------------------------------===// +#ifndef KMP_CONFIG_H +#define KMP_CONFIG_H + +#include "kmp_platform.h" + +// cmakedefine01 MACRO will define MACRO as either 0 or 1 +// cmakedefine MACRO 1 will define MACRO as 1 or leave undefined +#cmakedefine01 DEBUG_BUILD +#cmakedefine01 RELWITHDEBINFO_BUILD +#cmakedefine01 LIBOMP_USE_ITT_NOTIFY +#define USE_ITT_NOTIFY LIBOMP_USE_ITT_NOTIFY +#if ! LIBOMP_USE_ITT_NOTIFY +# define INTEL_NO_ITTNOTIFY_API +#endif +#cmakedefine01 LIBOMP_USE_VERSION_SYMBOLS +#if LIBOMP_USE_VERSION_SYMBOLS +# define KMP_USE_VERSION_SYMBOLS +#endif +#cmakedefine01 LIBOMP_STATS +#define KMP_STATS_ENABLED LIBOMP_STATS +#cmakedefine01 LIBOMP_USE_DEBUGGER +#define USE_DEBUGGER LIBOMP_USE_DEBUGGER +#cmakedefine01 LIBOMP_OMPT_SUPPORT +#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT +#cmakedefine01 LIBOMP_OMPT_BLAME +#define OMPT_BLAME LIBOMP_OMPT_BLAME +#cmakedefine01 LIBOMP_OMPT_TRACE +#define OMPT_TRACE LIBOMP_OMPT_TRACE +#cmakedefine01 LIBOMP_USE_ADAPTIVE_LOCKS +#define KMP_USE_ADAPTIVE_LOCKS LIBOMP_USE_ADAPTIVE_LOCKS +#define KMP_DEBUG_ADAPTIVE_LOCKS 0 +#cmakedefine01 LIBOMP_USE_INTERNODE_ALIGNMENT +#define KMP_USE_INTERNODE_ALIGNMENT LIBOMP_USE_INTERNODE_ALIGNMENT +#cmakedefine01 LIBOMP_ENABLE_ASSERTIONS +#define KMP_USE_ASSERT LIBOMP_ENABLE_ASSERTIONS +#cmakedefine01 STUBS_LIBRARY +#define KMP_ARCH_STR "@LIBOMP_LEGAL_ARCH@" +#define KMP_LIBRARY_FILE "@LIBOMP_LIB_FILE@" +#define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@ +#define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@ +#define LIBOMP_OMP_VERSION @LIBOMP_OMP_VERSION@ +#define OMP_50_ENABLED (LIBOMP_OMP_VERSION >= 50) +#define OMP_41_ENABLED (LIBOMP_OMP_VERSION >= 41) +#define OMP_40_ENABLED (LIBOMP_OMP_VERSION >= 40) +#define OMP_30_ENABLED (LIBOMP_OMP_VERSION >= 30) + +// Configured cache line based on architecture +#if KMP_ARCH_PPC64 +# define CACHE_LINE 128 +#else +# define CACHE_LINE 64 +#endif + +#define KMP_DYNAMIC_LIB 1 +#define KMP_NESTED_HOT_TEAMS 1 +#define KMP_ADJUST_BLOCKTIME 1 +#define BUILD_PARALLEL_ORDERED 1 +#define KMP_ASM_INTRINS 1 +#define USE_ITT_BUILD 1 +#define INTEL_ITTNOTIFY_PREFIX __kmp_itt_ +#if ! KMP_MIC +# define USE_LOAD_BALANCE 1 +#endif +#if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN) +# define KMP_TDATA_GTID 1 +#endif +#if STUBS_LIBRARY +# define KMP_STUB 1 +#endif +#if DEBUG_BUILD || RELWITHDEBINFO_BUILD +# define KMP_DEBUG 1 +#endif + +#if KMP_OS_WINDOWS +# define KMP_WIN_CDECL +#else +# define BUILD_TV +# define KMP_GOMP_COMPAT +#endif + +#endif // KMP_CONFIG_H Index: runtime/src/kmp_itt.c =================================================================== --- runtime/src/kmp_itt.c +++ runtime/src/kmp_itt.c @@ -1,3 +1,5 @@ +#include "kmp_config.h" + #if USE_ITT_BUILD /* * kmp_itt.c -- ITT Notify interface. Index: runtime/src/kmp_os.h =================================================================== --- runtime/src/kmp_os.h +++ runtime/src/kmp_os.h @@ -16,6 +16,7 @@ #ifndef KMP_OS_H #define KMP_OS_H +#include "kmp_config.h" #include #define KMP_FTN_PLAIN 1 @@ -62,8 +63,6 @@ # error Unknown compiler #endif -#include "kmp_platform.h" - #if (KMP_OS_LINUX || KMP_OS_WINDOWS) && !KMP_OS_CNK && !KMP_ARCH_PPC64 # define KMP_AFFINITY_SUPPORTED 1 # if KMP_OS_WINDOWS && KMP_ARCH_X86_64 Index: runtime/src/libomp.rc.var =================================================================== --- runtime/src/libomp.rc.var +++ runtime/src/libomp.rc.var @@ -12,6 +12,7 @@ // #include "winres.h" +#include "kmp_config.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // English (U.S.) resources #pragma code_page(1252) @@ -19,16 +20,16 @@ VS_VERSION_INFO VERSIONINFO // Parts of FILEVERSION and PRODUCTVERSION are 16-bit fields, entire build date yyyymmdd // does not fit into one version part, so we need to split it into yyyy and mmdd: - FILEVERSION $KMP_VERSION_MAJOR,$KMP_VERSION_MINOR,${{ our $KMP_VERSION_BUILD; int( $KMP_VERSION_BUILD / 10000 ) . "," . ( $KMP_VERSION_BUILD % 10000 ) }} - PRODUCTVERSION $KMP_VERSION_MAJOR,$KMP_VERSION_MINOR,${{ our $KMP_VERSION_BUILD; int( $KMP_VERSION_BUILD / 10000 ) . "," . ( $KMP_VERSION_BUILD % 10000 ) }} + FILEVERSION @LIBOMP_VERSION_MAJOR@,@LIBOMP_VERSION_MINOR@,@LIBOMP_VERSION_BUILD_YEAR@,@LIBOMP_VERSION_BUILD_MONTH_DAY@ + PRODUCTVERSION @LIBOMP_VERSION_MAJOR@,@LIBOMP_VERSION_MINOR@,@LIBOMP_VERSION_BUILD_YEAR@,@LIBOMP_VERSION_BUILD_MONTH_DAY@ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 - #if $KMP_DIAG || $KMP_DEBUG_INFO +#if KMP_DEBUG | VS_FF_DEBUG - #endif - #if $KMP_VERSION_BUILD == 0 +#endif +#if @LIBOMP_VERSION_BUILD@ == 0 | VS_FF_PRIVATEBUILD | VS_FF_PRERELEASE - #endif +#endif FILEOS VOS_NT_WINDOWS32 // Windows* Server* 2003, XP*, 2000, or NT* FILETYPE VFT_DLL BEGIN @@ -38,31 +39,30 @@ BEGIN // FileDescription and LegalCopyright should be short. - VALUE "FileDescription", "LLVM* OpenMP* Runtime Library${{ our $MESSAGE_CATALOG; $MESSAGE_CATALOG ? " Message Catalog" : "" }}\0" + VALUE "FileDescription", "LLVM* OpenMP* Runtime Library\0" // Following values may be relatively long. - VALUE "CompanyName", "Intel Corporation\0" + VALUE "CompanyName", "LLVM\0" // VALUE "LegalTrademarks", "\0" // Not used for now. VALUE "ProductName", "LLVM* OpenMP* Runtime Library\0" - VALUE "ProductVersion", "$KMP_VERSION_MAJOR.$KMP_VERSION_MINOR\0" - VALUE "FileVersion", "$KMP_VERSION_BUILD\0" - VALUE "InternalName", "$KMP_FILE\0" - VALUE "OriginalFilename", "$KMP_FILE\0" + VALUE "ProductVersion", "@LIBOMP_VERSION_MAJOR@.@LIBOMP_VERSION_MINOR@\0" + VALUE "FileVersion", "@LIBOMP_VERSION_BUILD@\0" + VALUE "InternalName", "@LIBOMP_LIB_FILE@\0" + VALUE "OriginalFilename", "@LIBOMP_LIB_FILE@\0" VALUE "Comments", - "LLVM* OpenMP* ${{ our ( $MESSAGE_CATALOG, $KMP_TYPE ); $MESSAGE_CATALOG ? "Runtime Library Message Catalog" : "$KMP_TYPE Library" }} " - "version $KMP_VERSION_MAJOR.$KMP_VERSION_MINOR.$KMP_VERSION_BUILD " - "for $KMP_ARCH architecture built on $KMP_BUILD_DATE.\0" - #if $KMP_VERSION_BUILD == 0 + "LLVM* OpenMP* @LIBOMP_LEGAL_TYPE@ Library " + "version @LIBOMP_VERSION_MAJOR@.@LIBOMP_VERSION_MINOR@.@LIBOMP_VERSION_BUILD@ " + "for @LIBOMP_LEGAL_ARCH@ architecture built on @LIBOMP_BUILD_DATE@.\0" +#if @LIBOMP_VERSION_BUILD@ == 0 VALUE "PrivateBuild", - "This is a development build for internal testing purposes only. " - "Do not distribute it outside of Intel.\0" - #endif + "This is a development build.\0" +#endif // VALUE "SpecialBuild", "\0" // Not used for now. END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", ${{ our ( $MESSAGE_CATALOG, $LANGUAGE ); $MESSAGE_CATALOG ? $LANGUAGE : 1033 }}, 1200 + VALUE "Translation", 1033, 1200 // 1033 -- U.S. English, 1200 -- Unicode END END Index: runtime/src/ompt-general.c =================================================================== --- runtime/src/ompt-general.c +++ runtime/src/ompt-general.c @@ -15,6 +15,7 @@ * ompt include files ****************************************************************************/ +#include "kmp_config.h" #include "ompt-internal.h" #include "ompt-specific.c" Index: runtime/src/thirdparty/ittnotify/ittnotify_static.c =================================================================== --- runtime/src/thirdparty/ittnotify/ittnotify_static.c +++ runtime/src/thirdparty/ittnotify/ittnotify_static.c @@ -8,6 +8,7 @@ // //===----------------------------------------------------------------------===// +#include "kmp_config.h" #include "ittnotify_config.h" #if ITT_PLATFORM==ITT_PLATFORM_WIN Index: runtime/src/z_Linux_asm.s =================================================================== --- runtime/src/z_Linux_asm.s +++ runtime/src/z_Linux_asm.s @@ -16,7 +16,7 @@ // macros // ----------------------------------------------------------------------- -#include "kmp_platform.h" +#include "kmp_config.h" #if KMP_ARCH_X86 || KMP_ARCH_X86_64