Standalone build examples + testing workflow updates (#15)
* Update examples to support standalone builds * Tweak to ubuntu-focal-external workflow - disable PAPI * ubuntu focal external workflow update - GCC 11 - Test static libgcc + static libstdcxx + strip - ubuntu-toolchain-r/test * Improve build-release.sh - command line args for lto, strip, perfetto-tools, static-libgcc, static-libstdcxx, hidden-visibility, max-threads, parallel * Update VERSION to 1.0.1 * Fixes to LTO build * Updates to ubuntu-focal-external workflow * build-release.sh update - enable static libstdcxx by default * disable python + static libstdcxx * ubuntu-focal-external updates * build-release.sh disable static libstdcxx by default * cmake-format
Esse commit está contido em:
@@ -1,6 +1,6 @@
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-openmp LANGUAGES CXX)
|
||||
|
||||
file(GLOB common_source ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp)
|
||||
add_library(openmp-common OBJECT ${common_source})
|
||||
@@ -11,20 +11,31 @@ add_executable(openmp-cg ${CMAKE_CURRENT_SOURCE_DIR}/CG/cg.cpp
|
||||
add_executable(openmp-lu ${CMAKE_CURRENT_SOURCE_DIR}/LU/lu.cpp
|
||||
$<TARGET_OBJECTS:openmp-common>)
|
||||
|
||||
find_program(CLANGXX_EXECUTABLE NAMES clang++)
|
||||
find_library(
|
||||
LIBOMP_LIBRARY
|
||||
NAMES omp omp5 ${CMAKE_SHARED_LIBRARY_PREFIX}omp${CMAKE_SHARED_LIBRARY_SUFFIX}.5)
|
||||
if(CLANGXX_EXECUTABLE AND LIBOMP_LIBRARY)
|
||||
target_compile_options(openmp-common PUBLIC -W -Wall -fopenmp=libomp)
|
||||
target_compile_options(openmp-cg PRIVATE -W -Wall -fopenmp=libomp)
|
||||
target_link_libraries(openmp-cg PRIVATE ${LIBOMP_LIBRARY})
|
||||
target_compile_options(openmp-lu PRIVATE -W -Wall -fopenmp=libomp)
|
||||
target_link_libraries(openmp-lu PRIVATE ${LIBOMP_LIBRARY})
|
||||
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-common)
|
||||
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-cg)
|
||||
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-lu)
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
find_package(OpenMP REQUIRED)
|
||||
target_link_libraries(openmp-common PUBLIC OpenMP::OpenMP_CXX)
|
||||
else()
|
||||
find_program(CLANGXX_EXECUTABLE NAMES clang++)
|
||||
find_library(
|
||||
LIBOMP_LIBRARY
|
||||
NAMES omp omp5 ${CMAKE_SHARED_LIBRARY_PREFIX}omp${CMAKE_SHARED_LIBRARY_SUFFIX}.5)
|
||||
if(CLANGXX_EXECUTABLE
|
||||
AND LIBOMP_LIBRARY
|
||||
AND COMMAND omnitrace_custom_compilation)
|
||||
target_compile_options(openmp-common PUBLIC -W -Wall -fopenmp=libomp)
|
||||
target_compile_options(openmp-cg PRIVATE -W -Wall -fopenmp=libomp)
|
||||
target_link_libraries(openmp-cg PRIVATE ${LIBOMP_LIBRARY})
|
||||
target_compile_options(openmp-lu PRIVATE -W -Wall -fopenmp=libomp)
|
||||
target_link_libraries(openmp-lu PRIVATE ${LIBOMP_LIBRARY})
|
||||
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-common)
|
||||
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-cg)
|
||||
omnitrace_custom_compilation(COMPILER ${CLANGXX_EXECUTABLE} TARGET openmp-lu)
|
||||
else()
|
||||
find_package(OpenMP REQUIRED)
|
||||
target_link_libraries(openmp-common PUBLIC OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS openmp-cg openmp-lu DESTINATION bin)
|
||||
endif()
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário