diff options
Diffstat (limited to 'openmp/runtime')
| -rw-r--r-- | openmp/runtime/Build_With_CMake.txt | 12 | ||||
| -rw-r--r-- | openmp/runtime/CMakeLists.txt | 158 | ||||
| -rw-r--r-- | openmp/runtime/cmake/BuildPLRules.cmake | 26 | ||||
| -rw-r--r-- | openmp/runtime/cmake/CommonFlags.cmake | 2 | ||||
| -rw-r--r-- | openmp/runtime/cmake/Intel/AsmFlags.cmake | 2 | ||||
| -rw-r--r-- | openmp/runtime/cmake/Intel/CFlags.cmake | 2 | ||||
| -rw-r--r-- | openmp/runtime/cmake/MSVC/AsmFlags.cmake | 2 | ||||
| -rw-r--r-- | openmp/runtime/cmake/MSVC/CFlags.cmake | 2 | ||||
| -rw-r--r-- | openmp/runtime/cmake/MicroTests.cmake | 16 |
9 files changed, 103 insertions, 119 deletions
diff --git a/openmp/runtime/Build_With_CMake.txt b/openmp/runtime/Build_With_CMake.txt index c22d3ea7bf4..af378d9274c 100644 --- a/openmp/runtime/Build_With_CMake.txt +++ b/openmp/runtime/Build_With_CMake.txt @@ -123,7 +123,7 @@ Library type can be normal, profile, or stubs. 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) or off with the following options: -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_CXX_COMPILER=clang++ -DLIBOMP_OS=mac -DLI - 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 .. diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt index 8767f3b354c..c4cb34ed7f6 100644 --- a/openmp/runtime/CMakeLists.txt +++ b/openmp/runtime/CMakeLists.txt @@ -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_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) 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 STRING 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 STRING "*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}/src") 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_OMP_VERSION}") ############################ # 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 ${CMAKE_COMMAND} -E remove -f ${export_cm # --- 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 ${build_dir}/kmp_i18n_id.inc ${build_di # 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 filename) 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() + # 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 iomp5 LIBRARY DESTINATION lib${LIBOMP_LIBDIR_SUFFIX}) + 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}) diff --git a/openmp/runtime/cmake/BuildPLRules.cmake b/openmp/runtime/cmake/BuildPLRules.cmake index d8d772ce5b1..6565c5c700b 100644 --- a/openmp/runtime/cmake/BuildPLRules.cmake +++ b/openmp/runtime/cmake/BuildPLRules.cmake @@ -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}) diff --git a/openmp/runtime/cmake/CommonFlags.cmake b/openmp/runtime/cmake/CommonFlags.cmake index 51e2eb977b0..6ac98b8c797 100644 --- a/openmp/runtime/cmake/CommonFlags.cmake +++ b/openmp/runtime/cmake/CommonFlags.cmake @@ -113,7 +113,7 @@ function(append_linker_flags_common input_ld_flags input_ld_flags_libs) # 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 diff --git a/openmp/runtime/cmake/Intel/AsmFlags.cmake b/openmp/runtime/cmake/Intel/AsmFlags.cmake index 1ef39a7b432..a11e2dd43d8 100644 --- a/openmp/runtime/cmake/Intel/AsmFlags.cmake +++ b/openmp/runtime/cmake/Intel/AsmFlags.cmake @@ -30,7 +30,7 @@ function(append_assembler_specific_asm_flags input_asm_flags) 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) diff --git a/openmp/runtime/cmake/Intel/CFlags.cmake b/openmp/runtime/cmake/Intel/CFlags.cmake index 1c38279cfc0..310d4add18f 100644 --- a/openmp/runtime/cmake/Intel/CFlags.cmake +++ b/openmp/runtime/cmake/Intel/CFlags.cmake @@ -74,7 +74,7 @@ function(append_compiler_specific_c_and_cxx_flags input_c_flags input_cxx_flags) 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}) diff --git a/openmp/runtime/cmake/MSVC/AsmFlags.cmake b/openmp/runtime/cmake/MSVC/AsmFlags.cmake index 685762de17e..de679383deb 100644 --- a/openmp/runtime/cmake/MSVC/AsmFlags.cmake +++ b/openmp/runtime/cmake/MSVC/AsmFlags.cmake @@ -26,7 +26,7 @@ function(append_assembler_specific_asm_flags input_asm_flags) 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) diff --git a/openmp/runtime/cmake/MSVC/CFlags.cmake b/openmp/runtime/cmake/MSVC/CFlags.cmake index a7239c785e7..e233cac1553 100644 --- a/openmp/runtime/cmake/MSVC/CFlags.cmake +++ b/openmp/runtime/cmake/MSVC/CFlags.cmake @@ -28,7 +28,7 @@ function(append_compiler_specific_c_and_cxx_flags input_c_flags input_cxx_flags) 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) diff --git a/openmp/runtime/cmake/MicroTests.cmake b/openmp/runtime/cmake/MicroTests.cmake index 7689c93fca1..c4f512ef883 100644 --- a/openmp/runtime/cmake/MicroTests.cmake +++ b/openmp/runtime/cmake/MicroTests.cmake @@ -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_touch_items}") 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) |

