[Openmp-commits] [openmp] r238715 - Apply name change to CMake build system.

Jonathan Peyton jonathan.l.peyton at intel.com
Sun May 31 20:05:13 PDT 2015


Author: jlpeyton
Date: Sun May 31 22:05:13 2015
New Revision: 238715

URL: http://llvm.org/viewvc/llvm-project?rev=238715&view=rev
Log:
Apply name change to CMake build system.

This change has the CMake build system create a dynamic library named
libomp instead of libiomp5.  Also any reference to libiomp is replaced
with libomp.  One can still use the LIBOMP_LIB_NAME variable to enforce
a different name, and everything will still work as expected.  An important
note is that libiomp5 and libgomp symlinks are created at install time when
on Unix systems.  On Windows, copies are created with the legacy names.

Modified:
    openmp/trunk/runtime/Build_With_CMake.txt
    openmp/trunk/runtime/CMakeLists.txt
    openmp/trunk/runtime/cmake/BuildPLRules.cmake
    openmp/trunk/runtime/cmake/CommonFlags.cmake
    openmp/trunk/runtime/cmake/Intel/AsmFlags.cmake
    openmp/trunk/runtime/cmake/Intel/CFlags.cmake
    openmp/trunk/runtime/cmake/MSVC/AsmFlags.cmake
    openmp/trunk/runtime/cmake/MSVC/CFlags.cmake
    openmp/trunk/runtime/cmake/MicroTests.cmake

Modified: openmp/trunk/runtime/Build_With_CMake.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/Build_With_CMake.txt?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/Build_With_CMake.txt (original)
+++ openmp/trunk/runtime/Build_With_CMake.txt Sun May 31 22:05:13 2015
@@ -123,7 +123,7 @@ Library type can be normal, profile, or
 Build type can be Release, Debug, or RelWithDebInfo.
 
 -DLIBOMP_VERSION=5|4
-libiomp5 version can be 5 or 4.
+libomp version can be 5 or 4.
 
 -DLIBOMP_OMP_VERSION=40|30
 OpenMP version can be either 40 or 30.
@@ -159,10 +159,10 @@ These tests can be turned on (default) o
 -DLIBOMP_TEST_EXECSTACK=on|off -- Should the stack be checked for executability?
 -DLIBOMP_TEST_INSTR=on|off     -- Should the Intel(R) MIC Libraries be checked
                             for correct instruction set?
--DLIBOMP_TEST_DEPS=on|off      -- Should libiomp5's dependencies be checked?
+-DLIBOMP_TEST_DEPS=on|off      -- Should libomp's dependencies be checked?
 -DLIBOMP_MICRO_TESTS=off|on          -- Should any of the above tests be done?
 If -DLIBOMP_MICRO_TESTS=on is specified, the user can then call:
-$ make libiomp-micro-tests
+$ make libomp-micro-tests
 which runs the tests.
 
 ============================================
@@ -185,9 +185,9 @@ which runs the tests.
 ===================================
 -DLIBOMP_USE_BUILDPL_RULES=false|true
 Should the build imitate build.pl's build process.
-When this is true, the Unix* Release builds will build libiomp5
+When this is true, the Unix* Release builds will build libomp
 with -O2 and -g flags activated (same as RelWithDebInfo). Then,
-the debug info is stripped out of the library and put into libiomp5.dbg
+the debug info is stripped out of the library and put into libomp.dbg
 This is done for interaction with Intel(R) Parallel Amplifier.
 
 -DLIBOMP_USE_ADAPTIVE_LOCKS=true|false       
@@ -231,7 +231,7 @@ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_C
 
 - Build the library (architecture determined by probing compiler) using the
   Intel(R) C Compiler and the Intel(R) C++ Compiler. Also, create the fortran modules using
-  the Intel(R) Fortran Compiler, enabling the libiomp-micro-tests target and using similar rules that build.pl 
+  the Intel(R) Fortran Compiler, enabling the libomp-micro-tests target and using similar rules that build.pl 
   would use to build the library.
 cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort -DLIBOMP_MICRO_TESTS=on -DLIBOMP_FORTRAN_MODULES=on -DLIBOMP_USE_BUILDPL_RULES=on ..
 

Modified: openmp/trunk/runtime/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/CMakeLists.txt?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/CMakeLists.txt (original)
+++ openmp/trunk/runtime/CMakeLists.txt Sun May 31 22:05:13 2015
@@ -10,7 +10,7 @@
 #
 
 ################
-# CMAKE libiomp5
+# CMAKE libomp
 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 
 #########
@@ -25,7 +25,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SO
 set(LIBOMP_STANDALONE_BUILD FALSE)
 if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" OR 
    "${CMAKE_SOURCE_DIR}/runtime" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
-    project(libiomp C CXX)
+    project(libomp C CXX)
     set(LIBOMP_STANDALONE_BUILD TRUE)
 endif()
 
@@ -66,7 +66,7 @@ set(mic_arch_possible_values knf knc)
 # ----------------------------
 # Right now, this build system considers os=lin to mean "Unix-like that is not MAC"
 # Apple goes first because CMake considers Mac to be a Unix based 
-# operating system, while libiomp5 considers it a special case
+# operating system, while libomp considers it a special case
 if(${APPLE})
     set(temp_os mac)
 elseif(${UNIX})
@@ -87,7 +87,7 @@ set(LIBOMP_ARCH ${detected_arch} CACHE S
 set(LIBOMP_LIB_TYPE normal CACHE STRING
     "Performance,Profiling,Stubs library (normal/profile/stubs)")
 set(LIBOMP_VERSION 5 CACHE STRING 
-    "Produce libguide (version 4) or libiomp5 (version 5)")
+    "Produce libguide (version 4) or libomp (version 5)")
 set(LIBOMP_OMP_VERSION 41 CACHE STRING 
     "The OpenMP version (41/40/30)")
 set(LIBOMP_MIC_ARCH knc CACHE STRING 
@@ -149,7 +149,7 @@ set(LIBOMP_LIBFLAGS "" CACHE STRING
 set(LIBOMP_FFLAGS "" CACHE STRING 
     "Appended user specified Fortran compiler flags.  These are only used if LIBOMP_FORTRAN_MODULES==true.")
 
-# Should the libiomp5 library and generated headers be copied into the original source exports/ directory
+# Should the libomp library and generated headers be copied into the original source exports/ directory
 # Turning this to false aids parallel builds to not interfere with each other.
 set(LIBOMP_COPY_EXPORTS true CACHE STRING
     "Should exports be copied into source exports/ directory?")
@@ -288,7 +288,7 @@ set(LIBOMP_COMPILER_QUAD_TYPE "" CACHE S
     "*INCOMPLETE* The quad precision data type (e.g., for gcc, __float128)")
 
 # - Should the orignal build rules for builds be used? (cmake/OriginalBuildRules.cmake).  This setting is off by default.
-# - This always compiles with -g.  And if it is a release build, the debug info is stripped out via objcopy and put into libiomp5.dbg.
+# - This always compiles with -g.  And if it is a release build, the debug info is stripped out via objcopy and put into libomp.dbg.
 set(LIBOMP_USE_BUILDPL_RULES false CACHE BOOL
     "Should the build follow build.pl rules/recipes?")
 
@@ -382,8 +382,7 @@ set(src_dir "${CMAKE_CURRENT_SOURCE_DIR}
 set(tools_dir "${CMAKE_CURRENT_SOURCE_DIR}/tools") 
 set(export_dir "${CMAKE_CURRENT_SOURCE_DIR}/exports") 
 set(export_ptf_dir "${export_dir}/${platform}${suffix}")
-set(export_cmn_dir1 "${export_dir}/common${suffix}/include") 
-set(export_cmn_dir2 "${export_dir}/common${suffix}/include_compat") 
+set(export_cmn_dir "${export_dir}/common${suffix}/include") 
 set(export_inc_dir "${export_ptf_dir}/include") 
 set(export_mod_dir "${export_ptf_dir}/include_compat")
 _export_lib_dir(${platform} export_lib_dir)  # set exports directory (relative to build_dir) e.g., ../exports/lin_32e/lib/
@@ -397,48 +396,43 @@ set(inc_dir "${src_dir}/include/${LIBOMP
 
 ############################
 # Setting final library name
-set(lib_item "libiomp")
+set(lib_item "libomp")
 if(${PROFILE_LIBRARY})
     set(lib_item "${lib_item}prof")
 endif()
 if(${STUBS_LIBRARY})
     set(lib_item "${lib_item}stubs")
 endif()
-set(lib_item "${lib_item}${LIBOMP_VERSION}")
 if(${WINDOWS})
     set(lib_item "${lib_item}md")
 endif()
 set(LIBOMP_LIB_NAME "${lib_item}" CACHE STRING "OMP library name")
 set(lib_ext "${dll}")
 # ${lib_file} is real library name:
-# libiomp5.so    for Linux
-# libiomp5.dylib for Mac
-# libiomp5md.dll for Windows
+# libomp.so    for Linux
+# libomp.dylib for Mac
+# libompmd.dll   for Windows
 set(lib_file "${LIBOMP_LIB_NAME}${lib_ext}")
 
 ########################################
 # Setting export file names
 if(${WINDOWS})
-    set(imp_file "${lib_item}${lib}") # this is exported (libiomp5md.lib)
+    set(imp_file "${lib_item}${lib}") # this is exported (libomp.lib)
     set(def_file "${lib_item}.def") # this is not exported
-    set(rc_file  "${lib_item}.rc")  # this is not exported
     if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR 
         "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" OR 
         ${LIBOMP_USE_BUILDPL_RULES})
-        set(pdb_file "${lib_file}.pdb") # this is exported if it exists (libiomp5md.dll.pdb)
+        set(pdb_file "${lib_file}.pdb") # this is exported if it exists (libompmd.dll.pdb)
     endif()
 endif()
 set(export_lib_files "${lib_file}" "${imp_file}" "${pdb_file}") 
-set(export_inc_files "iomp_lib.h")
 set(export_mod_files "omp_lib.mod" "omp_lib_kinds.mod")
-set(export_cmn_files1 "omp.h" "omp_lib.h" "omp_lib.f" "omp_lib.f90")
-set(export_cmn_files2 "iomp.h")
+set(export_cmn_files "omp.h" "omp_lib.h" "omp_lib.f" "omp_lib.f90")
 
 if(${LIBOMP_OMPT_SUPPORT})
-    set(export_cmn_files1 ${export_cmn_files1} "ompt.h")
+    set(export_cmn_files ${export_cmn_files} "ompt.h")
 endif()
 
-set(export_cmn_files "${export_cmn_files1}" "${export_cmn_files2}")
 if("${export_lib_fat_dir}")
     set(export_lib_fat_files "${lib_file}" "${imp_file}")
 endif()
@@ -593,8 +587,7 @@ debug_say_var(imp_src_files)
 
 ####################
 # --- Create all ---
-add_custom_target(lib ALL DEPENDS iomp5)
-add_custom_target(inc ALL DEPENDS ${export_inc_files})
+add_custom_target(lib ALL DEPENDS omp)
 if(${LIBOMP_FORTRAN_MODULES})
     add_custom_target(mod ALL DEPENDS ${export_mod_files})
 endif()
@@ -607,24 +600,17 @@ add_custom_target(clean-common COMMAND $
 # --- Put headers in convenient locations post build ---
 if(${LIBOMP_COPY_EXPORTS})
     add_custom_command(TARGET common POST_BUILD 
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${export_cmn_dir1}
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${export_cmn_dir2}
-        COMMAND ${CMAKE_COMMAND} -E copy omp.h ${export_cmn_dir1}
-        COMMAND ${CMAKE_COMMAND} -E copy omp_lib.h ${export_cmn_dir1}
-        COMMAND ${CMAKE_COMMAND} -E copy omp_lib.f ${export_cmn_dir1}
-        COMMAND ${CMAKE_COMMAND} -E copy omp_lib.f90 ${export_cmn_dir1}
-        COMMAND ${CMAKE_COMMAND} -E copy iomp.h ${export_cmn_dir2}
+        COMMAND ${CMAKE_COMMAND} -E make_directory ${export_cmn_dir}
+        COMMAND ${CMAKE_COMMAND} -E copy omp.h ${export_cmn_dir}
+        COMMAND ${CMAKE_COMMAND} -E copy omp_lib.h ${export_cmn_dir}
+        COMMAND ${CMAKE_COMMAND} -E copy omp_lib.f ${export_cmn_dir}
+        COMMAND ${CMAKE_COMMAND} -E copy omp_lib.f90 ${export_cmn_dir}
     )
     if(${LIBOMP_OMPT_SUPPORT})
         add_custom_command(TARGET common POST_BUILD
-            COMMAND ${CMAKE_COMMAND} -E make_directory ${export_cmn_dir1}
-            COMMAND ${CMAKE_COMMAND} -E copy ompt.h ${export_cmn_dir1}
+            COMMAND ${CMAKE_COMMAND} -E copy ompt.h ${export_cmn_dir}
         )
     endif()
-    add_custom_command(TARGET inc POST_BUILD
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${export_inc_dir}
-        COMMAND ${CMAKE_COMMAND} -E copy iomp_lib.h ${export_inc_dir}
-    )
     if(${LIBOMP_FORTRAN_MODULES})
         add_custom_command(TARGET mod POST_BUILD
             COMMAND ${CMAKE_COMMAND} -E make_directory ${export_mod_dir}
@@ -644,8 +630,8 @@ add_custom_target(needed-headers DEPENDS
 
 # For Windows, there is a definitions file (.def) and resource file (.res) created using generate-def.pl and rc.exe respectively.
 if(${WINDOWS})
-    add_custom_target(needed-windows-files DEPENDS ${build_dir}/${def_file} ${build_dir}/${rc_file})
-    list(APPEND lib_src_files ${build_dir}/${rc_file})
+    add_custom_target(needed-windows-files DEPENDS ${build_dir}/${def_file} ${build_dir}/libomp.rc)
+    list(APPEND lib_src_files ${build_dir}/libomp.rc)
 endif()
 
 # Remove any cmake-automatic linking of libraries by linker, This is so linux 
@@ -657,40 +643,40 @@ if(${LIBOMP_USE_PREDEFINED_LINKER_FLAGS}
 endif()
 
 # --- ${lib_file} rule ---
-add_library(iomp5 SHARED ${lib_src_files})
-set_target_properties(iomp5 PROPERTIES 
+add_library(omp SHARED ${lib_src_files})
+set_target_properties(omp PROPERTIES 
     PREFIX "" SUFFIX ""        # Take control 
     OUTPUT_NAME "${lib_file}"  # of output name
     LINK_FLAGS  "${LD_FLAGS}"
     LINKER_LANGUAGE C          # use C Compiler for linking step
-    SKIP_BUILD_RPATH true      # have Mac linker -install_name just be "-install_name libiomp5.dylib"
+    SKIP_BUILD_RPATH true      # have Mac linker -install_name just be "-install_name libomp.dylib"
 )
 
-# --- Copy libiomp into exports directory post build ---
+# --- Copy libomp into exports directory post build ---
 if(${WINDOWS})
-    get_target_property(LIBOMP_OUTPUT_DIRECTORY iomp5 RUNTIME_OUTPUT_DIRECTORY)
+    get_target_property(LIBOMP_OUTPUT_DIRECTORY omp RUNTIME_OUTPUT_DIRECTORY)
 else()
-    get_target_property(LIBOMP_OUTPUT_DIRECTORY iomp5 LIBRARY_OUTPUT_DIRECTORY)
+    get_target_property(LIBOMP_OUTPUT_DIRECTORY omp LIBRARY_OUTPUT_DIRECTORY)
 endif()
 if(NOT LIBOMP_OUTPUT_DIRECTORY)
     set(LIBOMP_OUTPUT_DIRECTORY ${build_dir})
 endif()
 
 if(${LIBOMP_COPY_EXPORTS})
-    add_custom_command(TARGET iomp5 POST_BUILD
+    add_custom_command(TARGET omp POST_BUILD
         COMMAND ${CMAKE_COMMAND} -E make_directory ${export_lib_dir}
         COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMP_OUTPUT_DIRECTORY}/${lib_file} ${export_lib_dir}
     )
 endif()
 
 # Linking command will include libraries in LD_LIB_FLAGS
-target_link_libraries(iomp5 ${LD_LIB_FLAGS} ${CMAKE_DL_LIBS})
+target_link_libraries(omp ${LD_LIB_FLAGS} ${CMAKE_DL_LIBS})
 
 # Create *.inc and omp.h before compiling any sources
-add_dependencies(iomp5 needed-headers)
+add_dependencies(omp needed-headers)
 if(${WINDOWS})
 # Create .def and .rc file before compiling any sources
-    add_dependencies(iomp5 needed-windows-files)
+    add_dependencies(omp needed-windows-files)
 endif()
 
 # Set the compiler flags for each type of source
@@ -747,23 +733,23 @@ if(${WINDOWS})
     # It is then "re-linked" to include kmp_import.c which prevents linking of both Visual Studio OpenMP and newly built OpenMP
     if(NOT "${imp_file}" STREQUAL "")
         set(generated_import_file ${lib_file}${lib})
-        add_library(iomp5imp STATIC ${generated_import_file} ${imp_src_files})
+        add_library(ompimp STATIC ${generated_import_file} ${imp_src_files})
         set_source_files_properties(${generated_import_file} PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
-        set_target_properties(iomp5imp PROPERTIES
+        set_target_properties(ompimp PROPERTIES
             PREFIX "" SUFFIX ""
             OUTPUT_NAME "${imp_file}"
             STATIC_LIBRARY_FLAGS "${AR_FLAGS}"
             LINKER_LANGUAGE C
             SKIP_BUILD_RPATH true
         )
-        add_custom_command(TARGET iomp5imp PRE_BUILD COMMAND ${CMAKE_COMMAND} -E remove -f ${imp_file})
-        add_dependencies(iomp5imp iomp5)
-        get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY iomp5imp ARCHIVE_OUTPUT_DIRECTORY)
+        add_custom_command(TARGET ompimp PRE_BUILD COMMAND ${CMAKE_COMMAND} -E remove -f ${imp_file})
+        add_dependencies(ompimp omp)
+        get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY ompimp ARCHIVE_OUTPUT_DIRECTORY)
         if(NOT LIBOMPIMP_OUTPUT_DIRECTORY)
             set(LIBOMPIMP_OUTPUT_DIRECTORY ${build_dir})
         endif()
         if(${LIBOMP_COPY_EXPORTS})
-            add_custom_command(TARGET iomp5imp POST_BUILD 
+            add_custom_command(TARGET ompimp POST_BUILD 
                 COMMAND ${CMAKE_COMMAND} -E make_directory ${export_lib_dir}
                 COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMPIMP_OUTPUT_DIRECTORY}/${imp_file} ${export_lib_dir}
             )
@@ -780,14 +766,6 @@ if(${WINDOWS})
         )
     endif()
 
-    # --- Create $(rc_file) ---
-    if(NOT "${rc_file}" STREQUAL "")
-        add_custom_command(
-            OUTPUT  ${rc_file}
-            COMMAND ${CMAKE_COMMAND} -E copy libiomp.rc ${rc_file}
-            DEPENDS libiomp.rc
-        )
-    endif()
 endif()
 
 ######################################################
@@ -810,21 +788,21 @@ add_custom_command(
 # - Only perform if ${tests} == true (specify when invoking: cmake -Dtests=on ...)
 if(${LIBOMP_MICRO_TESTS})
     include(MicroTests)
-    add_custom_target(libiomp-micro-tests)
+    add_custom_target(libomp-micro-tests)
     if(NOT ${MIC} AND ${LIBOMP_TEST_TOUCH})
-        add_dependencies(libiomp-micro-tests libiomp-test-touch)
+        add_dependencies(libomp-micro-tests libomp-test-touch)
     endif()
     if(${LINUX} AND ${LIBOMP_TEST_RELO})
-        add_dependencies(libiomp-micro-tests libiomp-test-relo)
+        add_dependencies(libomp-micro-tests libomp-test-relo)
     endif()
     if(${LINUX} AND ${LIBOMP_TEST_EXECSTACK})
-        add_dependencies(libiomp-micro-tests libiomp-test-execstack)
+        add_dependencies(libomp-micro-tests libomp-test-execstack)
     endif()
     if(${MIC} AND ${LIBOMP_TEST_INSTR})
-        add_dependencies(libiomp-micro-tests libiomp-test-instr)
+        add_dependencies(libomp-micro-tests libomp-test-instr)
     endif()
     if(${LIBOMP_TEST_DEPS}) 
-        add_dependencies(libiomp-micro-tests libiomp-test-deps)
+        add_dependencies(libomp-micro-tests libomp-test-deps)
     endif()
 endif()
 
@@ -863,7 +841,8 @@ endif()
 # - 'file' is generated using expand-vars.pl and 'file'.var
 # - Any .h .f .f90 .rc files should be created with this recipe
 macro(expand_vars_recipe file_dir filename)
-    get_source_file_property(extra_ev_flags ${filename} COMPILE_DEFINITIONS)
+    set(extra_ev_flags)
+    get_source_file_property(extra_ev_flags ${filename} EV_COMPILE_DEFINITIONS)
     if("${extra_ev_flags}" MATCHES "NOTFOUND")
         set(extra_ev_flags)
     else()
@@ -878,24 +857,16 @@ macro(expand_vars_recipe file_dir filena
     endif()
 endmacro()
 string_to_list("${ev_flags}" ev_flags)
-# omp_lib.h  : ev-flags += -D KMP_INT_PTR_KIND="int_ptr_kind()"
-set_source_files_properties(omp_lib.h PROPERTIES COMPILE_DEFINITIONS "-D KMP_INT_PTR_KIND=\"int_ptr_kind()\"") 
-# iomp_lib.h : ev-flags += -D KMP_INT_PTR_KIND=$(if $(filter 32,$(arch)),4,8)
-if(${IA32}) # 32 bit archs
-    set_source_files_properties(iomp_lib.h PROPERTIES COMPILE_DEFINITIONS "-D KMP_INT_PTR_KIND=4") 
-else()
-    set_source_files_properties(iomp_lib.h PROPERTIES COMPILE_DEFINITIONS "-D KMP_INT_PTR_KIND=8") 
-endif()
-# libiomp.rc : ev-flags += -D KMP_FILE=$(lib_file)
-set_source_files_properties(libiomp.rc PROPERTIES COMPILE_DEFINITIONS "-D KMP_FILE=${lib_file}") 
+# iomp_lib.h  : ev-flags += -D KMP_INT_PTR_KIND="int_ptr_kind()"
+set_source_files_properties(omp_lib.h PROPERTIES EV_COMPILE_DEFINITIONS "-D KMP_INT_PTR_KIND=\"int_ptr_kind()\"") 
+# libomp.rc : ev-flags += -D KMP_FILE=$(lib_file)
+set_source_files_properties(libomp.rc PROPERTIES EV_COMPILE_DEFINITIONS "-D KMP_FILE=${lib_file}") 
 expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} omp.h)
 expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} ompt.h)
 expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} omp_lib.h)
 expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} omp_lib.f)
 expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} omp_lib.f90)
-expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} iomp.h)
-expand_vars_recipe(${src_dir}/include/${LIBOMP_OMP_VERSION} iomp_lib.h)
-expand_vars_recipe(${src_dir} libiomp.rc)
+expand_vars_recipe(${src_dir} libomp.rc)
 
 ####################################################################
 # Print configuration after all variables are set.
@@ -930,7 +901,7 @@ endif()
 
 ####################################################################
 # Install rules
-# We want to install libiomp5 in DESTDIR/CMAKE_INSTALL_PREFIX/lib
+# We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib
 # We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include
 if(${LIBOMP_STANDALONE_BUILD})
     set(LIBOMP_HEADERS_INSTALL_PATH include)
@@ -939,17 +910,30 @@ else()
     set(LIBOMP_HEADERS_INSTALL_PATH lib${LIBOMP_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 endif()
 if(${WINDOWS})
-    install(TARGETS iomp5 RUNTIME DESTINATION bin)
+    install(TARGETS omp RUNTIME DESTINATION bin)
     if(NOT "${imp_file}" STREQUAL "")
-        install(TARGETS iomp5imp ARCHIVE DESTINATION lib${LIBOMP_LIBDIR_SUFFIX})
+        install(TARGETS ompimp ARCHIVE DESTINATION lib${LIBOMP_LIBDIR_SUFFIX})
     endif()
-else()
-    install(TARGETS iomp5 LIBRARY DESTINATION lib${LIBOMP_LIBDIR_SUFFIX}) 
+    # Create aliases (regular copies) of the library for backwards compatibility
+    set(LIBOMP_ALIASES "libiomp5md")
+    foreach(alias IN LISTS LIBOMP_ALIASES)
+        install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${lib_file}\" \"${alias}${dll}\"
+            WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
+        install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${imp_file}\" \"${alias}${lib}\"
+            WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
+    endforeach()
+else()
+    install(TARGETS omp LIBRARY DESTINATION lib${LIBOMP_LIBDIR_SUFFIX}) 
+    # Create aliases (symlinks) of the library for backwards compatibility
+    set(LIBOMP_ALIASES "libgomp;libiomp5")
+    foreach(alias IN LISTS LIBOMP_ALIASES)
+        install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${lib_file}\" \"${alias}${dll}\"
+            WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
+    endforeach()
 endif()
 install(
     FILES 
     ${build_dir}/omp.h 
-    ${build_dir}/iomp.h 
     DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
 )
 if(${LIBOMP_OMPT_SUPPORT})

Modified: openmp/trunk/runtime/cmake/BuildPLRules.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/BuildPLRules.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/BuildPLRules.cmake (original)
+++ openmp/trunk/runtime/cmake/BuildPLRules.cmake Sun May 31 22:05:13 2015
@@ -11,31 +11,31 @@
 
 ###############################################################################
 # This file contains additional build rules that correspond to build.pl's rules.
-# Building libiomp5.dbg is linux only, Windows will build libiomp5md.dll.pdb
+# Building libomp.dbg is linux only, Windows will build libompmd.dll.pdb
 # This file is only active if ${LIBOMP_USE_BUILDPL_RULES} is true.
 #
 #                        ######### BUILD DEPENDENCIES ##########
 #
-#        exports/.../libiomp5.so                        exports/.../libiomp5.dbg
+#        exports/.../libomp.so                        exports/.../libomp.dbg
 #        [copy]  |                                                 | [copy]
 #                |                                                 |
-#           ./libiomp5.so                                     ./libiomp5.dbg
+#           ./libomp.so                                     ./libomp.dbg
 #    [copy]    /  OR  \____________ [copy]                         | [copy]
 #             /                    \                               |
-#    ./unstripped/libiomp5.so   ./stripped/libiomp5.so   ./unstripped/libiomp5.dbg
+#    ./unstripped/libomp.so   ./stripped/libomp.so   ./unstripped/libomp.dbg
 #           /                                \                /
 #          / [linking]                        \[strip]       /[strip and store]
 #         /                                    \            /
-#     ${objs} (maybe compiled with -g)     ./unstripped/libiomp5.so (library with debug info in it)
+#     ${objs} (maybe compiled with -g)     ./unstripped/libomp.so (library with debug info in it)
 #                                                    |
 #                                                    | [linking]
 #                                                    |
 #                                                 ${objs} (always compiled with -g)
 #
-# For icc Linux builds, we always include debugging information via -g and create libiomp5.dbg 
+# For icc Linux builds, we always include debugging information via -g and create libomp.dbg 
 # so that Intel(R) Parallel Amplifier can use the .dbg file.
-# For icc Windows builds, we always include debugging information via -Zi and create libiomp5.pdb
-# in a fashion similar to libiomp5.dbg
+# For icc Windows builds, we always include debugging information via -Zi and create libomp.pdb
+# in a fashion similar to libomp.dbg
 # For icc Mac builds, we don't bother with the debug info.
 
 # We build library in unstripped directory
@@ -77,7 +77,7 @@ if(NOT "${dbg_file}" STREQUAL "")
     add_custom_command(
         OUTPUT  ${build_dir}/unstripped/${dbg_file}
         COMMAND ${CMAKE_OBJCOPY} --only-keep-debug ${build_dir}/unstripped/${lib_file} ${build_dir}/unstripped/${dbg_file} 
-        DEPENDS iomp5
+        DEPENDS omp
     )
     
 else()
@@ -89,21 +89,21 @@ endif()
 
 # Windows specific command to move around debug info files post-build
 if(NOT "${pdb_file}" STREQUAL "" AND ${RELEASE_BUILD})
-    add_custom_command(TARGET iomp5 POST_BUILD
+    add_custom_command(TARGET omp POST_BUILD
         COMMAND ${CMAKE_COMMAND} -E rename ${pdb_file} ${pdb_file}.nonstripped
         COMMAND ${CMAKE_COMMAND} -E rename ${pdb_file}.stripped ${pdb_file}
     )
 endif()
 
-# Have icc build libiomp5 in unstripped directory
-set_target_properties(iomp5 PROPERTIES 
+# Have icc build libomp in unstripped directory
+set_target_properties(omp PROPERTIES 
     LIBRARY_OUTPUT_DIRECTORY "${build_dir}/unstripped" 
     RUNTIME_OUTPUT_DIRECTORY "${build_dir}/unstripped"
     ARCHIVE_OUTPUT_DIRECTORY "${build_dir}"
 )
 
 # Always use RelWithDebInfo flags for Release builds when using the build.pl's build rules (use -g -O2 instead of just -O3)
-# The debug info is then stripped out at the end of the build and put into libiomp5.dbg for Linux
+# The debug info is then stripped out at the end of the build and put into libomp.dbg for Linux
 if(${RELEASE_BUILD} AND NOT ${MAC})
     set(CMAKE_C_FLAGS_RELEASE   ${CMAKE_C_FLAGS_RELWITHDEBINFO}  )
     set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})

Modified: openmp/trunk/runtime/cmake/CommonFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/CommonFlags.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/CommonFlags.cmake (original)
+++ openmp/trunk/runtime/cmake/CommonFlags.cmake Sun May 31 22:05:13 2015
@@ -113,7 +113,7 @@ function(append_linker_flags_common inpu
             # For now, always include --version-script flag on Unix systems.
             append_linker_flags("-Wl,--version-script=${src_dir}/exports_so.txt") # Use exports_so.txt as version script to create versioned symbols for ELF libraries
             append_linker_flags("-Wl,-z,noexecstack") #  Marks the object as not requiring executable stack.
-            append_linker_flags("-Wl,--as-needed")    #  Only adds library dependencies as they are needed. (if libiomp5 actually uses a function from the library, then add it)
+            append_linker_flags("-Wl,--as-needed")    #  Only adds library dependencies as they are needed. (if libomp actually uses a function from the library, then add it)
             if(NOT ${STUBS_LIBRARY})
                 append_linker_flags("-Wl,--warn-shared-textrel") #  Warn if the linker adds a DT_TEXTREL to a shared object.
                 append_linker_flags("-Wl,-fini=__kmp_internal_end_fini") # When creating an ELF executable or shared object, call NAME when the 

Modified: openmp/trunk/runtime/cmake/Intel/AsmFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/Intel/AsmFlags.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/Intel/AsmFlags.cmake (original)
+++ openmp/trunk/runtime/cmake/Intel/AsmFlags.cmake Sun May 31 22:05:13 2015
@@ -30,7 +30,7 @@ function(append_assembler_specific_asm_f
         elseif(${INTEL64})
             append_asm_flags("-D _M_AMD64")
         endif()
-        # CMake prefers the /MD flags when compiling Windows sources, but libiomp5 needs to use /MT instead
+        # CMake prefers the /MD flags when compiling Windows sources, but libomp needs to use /MT instead
         # So we replace these /MD instances with /MT within the CMAKE_*_FLAGS variables and put that out to the CACHE.
         # replace_md_with_mt() is in HelperFunctions.cmake
         replace_md_with_mt(CMAKE_ASM_MASM_FLAGS)

Modified: openmp/trunk/runtime/cmake/Intel/CFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/Intel/CFlags.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/Intel/CFlags.cmake (original)
+++ openmp/trunk/runtime/cmake/Intel/CFlags.cmake Sun May 31 22:05:13 2015
@@ -74,7 +74,7 @@ function(append_compiler_specific_c_and_
             endif()
         endif()
     endif()
-    # CMake prefers the /MD flags when compiling Windows sources, but libiomp5 needs to use /MT instead
+    # CMake prefers the /MD flags when compiling Windows sources, but libomp needs to use /MT instead
     # So we replace these /MD instances with /MT within the CMAKE_*_FLAGS variables and put that out to the CACHE.
     # replace_md_with_mt() is in HelperFunctions.cmake
     if(${WINDOWS})

Modified: openmp/trunk/runtime/cmake/MSVC/AsmFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/MSVC/AsmFlags.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/MSVC/AsmFlags.cmake (original)
+++ openmp/trunk/runtime/cmake/MSVC/AsmFlags.cmake Sun May 31 22:05:13 2015
@@ -26,7 +26,7 @@ function(append_assembler_specific_asm_f
     elseif(${INTEL64})
         append_asm_flags("-D _M_AMD64")
     endif()
-    # CMake prefers the /MD flags when compiling Windows sources, but libiomp5 needs to use /MT instead
+    # CMake prefers the /MD flags when compiling Windows sources, but libomp needs to use /MT instead
     # So we replace these /MD instances with /MT within the CMAKE_*_FLAGS variables and put that out to the CACHE.
     # replace_md_with_mt() is in HelperFunctions.cmake
     replace_md_with_mt(CMAKE_ASM_MASM_FLAGS)

Modified: openmp/trunk/runtime/cmake/MSVC/CFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/MSVC/CFlags.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/MSVC/CFlags.cmake (original)
+++ openmp/trunk/runtime/cmake/MSVC/CFlags.cmake Sun May 31 22:05:13 2015
@@ -28,7 +28,7 @@ function(append_compiler_specific_c_and_
         append_c_and_cxx_flags("-arch:ia32") # Tells the compiler which features it may target (ia32)
         append_c_and_cxx_flags("-Oy-") # equivalent to -fno-omit-frame-pointer
     endif()
-    # CMake prefers the /MD flags when compiling Windows sources, but libiomp5 needs to use /MT instead
+    # CMake prefers the /MD flags when compiling Windows sources, but libomp needs to use /MT instead
     # So we replace these /MD instances with /MT within the CMAKE_*_FLAGS variables and put that out to the CACHE.
     # replace_md_with_mt() is in HelperFunctions.cmake
     replace_md_with_mt(CMAKE_C_FLAGS)

Modified: openmp/trunk/runtime/cmake/MicroTests.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/MicroTests.cmake?rev=238715&r1=238714&r2=238715&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/MicroTests.cmake (original)
+++ openmp/trunk/runtime/cmake/MicroTests.cmake Sun May 31 22:05:13 2015
@@ -15,13 +15,13 @@
 # the library just created in ${build_dir}/, there are currently
 # five micro-tests: 
 # (1) test-touch 
-#    - Compile and run a small program using newly created libiomp5 library
+#    - Compile and run a small program using newly created libomp library
 #    - Fails if test-touch.c does not compile or if test-touch.c does not run after compilation
 #    - Program dependencies: gcc or g++, grep, bourne shell
 #    - Available for all Linux,Mac,Windows builds.  Not available on Intel(R) MIC Architecture builds.
 # (2) test-relo
 #    - Tests dynamic libraries for position-dependent code (can not have any position dependent code)
-#    - Fails if TEXTREL is in output of readelf -d libiomp5.so command
+#    - Fails if TEXTREL is in output of readelf -d libomp.so command
 #    - Program dependencies: readelf, grep, bourne shell
 #    - Available for Linux, Intel(R) MIC Architecture dynamic library builds. Not available otherwise.
 # (3) test-execstack 
@@ -35,7 +35,7 @@
 #    - Program dependencies: perl, objdump 
 #    - Available for Intel(R) MIC Architecture builds. Not available otherwise.
 # (5) test-deps      
-#    - Tests newly created libiomp5 for library dependencies
+#    - Tests newly created libomp for library dependencies
 #    - Fails if sees a dependence not listed in td_exp variable below
 #    - Program dependencies: perl, (linux)readelf, (mac)otool[64], (windows)link.exe
 #    - Available for Linux,Mac,Windows, Intel(R) MIC Architecture dynamic builds and Windows static builds. Not available otherwise.
@@ -58,7 +58,7 @@ set(regular_test_touch_items "${test_tou
 add_suffix("/.success"  regular_test_touch_items)
 # test-touch : ${test_touch_items}/.success
 set(ldeps "${regular_test_touch_items}")
-add_custom_target(libiomp-test-touch DEPENDS ${ldeps})
+add_custom_target(libomp-test-touch DEPENDS ${ldeps})
 
 if(${WINDOWS})
     # pick test-touch compiler
@@ -138,7 +138,7 @@ else()
 endif()
 
 # test-relo 
-add_custom_target(libiomp-test-relo DEPENDS test-relo/.success)
+add_custom_target(libomp-test-relo DEPENDS test-relo/.success)
 add_custom_command(
     OUTPUT  test-relo/.success
     COMMAND ${CMAKE_COMMAND} -E make_directory ${build_dir}/test-relo
@@ -149,7 +149,7 @@ add_custom_command(
 )
 
 # test-execstack
-add_custom_target(libiomp-test-execstack DEPENDS test-execstack/.success)
+add_custom_target(libomp-test-execstack DEPENDS test-execstack/.success)
 add_custom_command(
     OUTPUT  test-execstack/.success
     COMMAND ${CMAKE_COMMAND} -E make_directory ${build_dir}/test-execstack
@@ -159,7 +159,7 @@ add_custom_command(
 )
 
 # test-instr
-add_custom_target(libiomp-test-instr DEPENDS test-instr/.success)
+add_custom_target(libomp-test-instr DEPENDS test-instr/.success)
 add_custom_command(
     OUTPUT  test-instr/.success
     COMMAND ${CMAKE_COMMAND} -E make_directory ${build_dir}/test-instr
@@ -169,7 +169,7 @@ add_custom_command(
 )
 
 # test-deps
-add_custom_target(libiomp-test-deps DEPENDS test-deps/.success)
+add_custom_target(libomp-test-deps DEPENDS test-deps/.success)
 set(td_exp)
 if(${FREEBSD})
     set(td_exp libc.so.7 libthr.so.3 libunwind.so.5)





More information about the Openmp-commits mailing list