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
[ROCm/rocprofiler-systems commit: 8b97c70df8]
This commit is contained in:
zatwierdzone przez
GitHub
rodzic
222877e4f8
commit
d009fc24a6
+46
-6
@@ -7,8 +7,6 @@ on:
|
||||
branches: [ main, develop ]
|
||||
|
||||
env:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
ELFUTILS_DOWNLOAD_VERSION: 0.183
|
||||
OMNITRACE_VERBOSE: 1
|
||||
OMNITRACE_CI: ON
|
||||
|
||||
@@ -19,7 +17,39 @@ jobs:
|
||||
image: jrmadsen/omnitrace-ci:ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
compiler: ['g++-7', 'g++-8', 'g++-9', 'g++-10']
|
||||
compiler: ['g++-7', 'g++-8']
|
||||
lto: ['OFF']
|
||||
strip: ['OFF']
|
||||
python: ['ON']
|
||||
build-type: ['Release']
|
||||
mpi-headers: ['OFF']
|
||||
static-libgcc: ['OFF']
|
||||
static-libstdcxx: ['OFF']
|
||||
include:
|
||||
- compiler: 'g++-9'
|
||||
lto: 'OFF'
|
||||
strip: 'ON'
|
||||
python: 'OFF'
|
||||
build-type: 'Release'
|
||||
mpi-headers: 'ON'
|
||||
static-libgcc: 'ON'
|
||||
static-libstdcxx: 'ON'
|
||||
- compiler: 'g++-10'
|
||||
lto: 'OFF'
|
||||
strip: 'ON'
|
||||
python: 'ON'
|
||||
build-type: 'RelWithDebInfo'
|
||||
mpi-headers: 'ON'
|
||||
static-libgcc: 'ON'
|
||||
static-libstdcxx: 'OFF'
|
||||
- compiler: 'g++-11'
|
||||
lto: 'ON'
|
||||
strip: 'ON'
|
||||
python: 'OFF'
|
||||
build-type: 'Release'
|
||||
mpi-headers: 'ON'
|
||||
static-libgcc: 'ON'
|
||||
static-libstdcxx: 'OFF'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -28,6 +58,10 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
run:
|
||||
apt-get update &&
|
||||
apt-get install -y software-properties-common &&
|
||||
add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
|
||||
apt-get update &&
|
||||
apt-get upgrade -y &&
|
||||
apt-get install -y build-essential m4 autoconf libtool python3-pip libiberty-dev clang libomp-dev ${{ matrix.compiler }} &&
|
||||
python3 -m pip install --upgrade pip &&
|
||||
python3 -m pip install numpy &&
|
||||
@@ -49,18 +83,24 @@ jobs:
|
||||
cmake -B build
|
||||
-DCMAKE_C_COMPILER=$(echo '${{ matrix.compiler }}' | sed 's/+/c/g')
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/omnitrace
|
||||
-DOMNITRACE_BUILD_TESTING=ON
|
||||
-DOMNITRACE_USE_MPI=OFF
|
||||
-DOMNITRACE_USE_HIP=OFF
|
||||
-DOMNITRACE_USE_OMPT=OFF
|
||||
-DOMNITRACE_USE_PYTHON=ON
|
||||
-DOMNITRACE_USE_PAPI=OFF
|
||||
-DOMNITRACE_USE_PYTHON=${{ matrix.python }}
|
||||
-DOMNITRACE_USE_MPI_HEADERS=${{ matrix.mpi-headers }}
|
||||
-DOMNITRACE_STRIP_LIBRARIES=${{ matrix.strip }}
|
||||
-DOMNITRACE_BUILD_LTO=${{ matrix.lto }}
|
||||
-DOMNITRACE_BUILD_STATIC_LIBGCC=${{ matrix.static-libgcc }}
|
||||
-DOMNITRACE_BUILD_STATIC_LIBSTDCXX=${{ matrix.static-libstdcxx }}
|
||||
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
|
||||
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9"
|
||||
|
||||
- name: Build
|
||||
timeout-minutes: 45
|
||||
timeout-minutes: 60
|
||||
run:
|
||||
cmake --build build --target all --parallel 2 -- VERBOSE=1
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.0
|
||||
1.0.1
|
||||
|
||||
@@ -173,10 +173,6 @@ else()
|
||||
target_link_options(omnitrace-lto INTERFACE -flto=thin)
|
||||
endif()
|
||||
|
||||
if(OMNITRACE_BUILD_LTO)
|
||||
target_link_libraries(omnitrace-compile-options INTERFACE omnitrace::omnitrace-lto)
|
||||
endif()
|
||||
|
||||
omnitrace_restore_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
|
||||
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-dyninst-examples LANGUAGES CXX)
|
||||
project(omnitrace-examples LANGUAGES C CXX)
|
||||
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET "default")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_CLANG_TIDY)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build dynamic libraries" ON)
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
add_subdirectory(transpose)
|
||||
add_subdirectory(parallel-overhead)
|
||||
add_subdirectory(code-coverage)
|
||||
add_subdirectory(user-api)
|
||||
add_subdirectory(openmp)
|
||||
add_subdirectory(mpi)
|
||||
add_subdirectory(python)
|
||||
add_subdirectory(lulesh)
|
||||
|
||||
@@ -7,10 +7,9 @@ string(REPLACE " " ";" _FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
add_executable(code-coverage code-coverage.cpp)
|
||||
target_link_libraries(code-coverage Threads::Threads)
|
||||
target_link_libraries(code-coverage PRIVATE Threads::Threads)
|
||||
target_compile_options(code-coverage PRIVATE ${_FLAGS})
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set_target_properties(code-coverage PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS code-coverage DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -44,7 +44,6 @@ add_executable(${PROJECT_NAME} ${sources} ${headers})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/includes)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Kokkos::kokkos lulesh-mpi)
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -16,7 +16,6 @@ endif()
|
||||
|
||||
target_link_libraries(mpi-example PRIVATE MPI::MPI_CXX)
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set_target_properties(mpi-example PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS mpi-example DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -5,15 +5,12 @@ project(omnitrace-parallel-overhead LANGUAGES CXX)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
find_package(Threads REQUIRED)
|
||||
add_executable(parallel-overhead parallel-overhead.cpp)
|
||||
target_link_libraries(parallel-overhead Threads::Threads)
|
||||
target_link_libraries(parallel-overhead PRIVATE Threads::Threads)
|
||||
|
||||
add_executable(parallel-overhead-locks parallel-overhead.cpp)
|
||||
target_link_libraries(parallel-overhead-locks Threads::Threads)
|
||||
target_link_libraries(parallel-overhead-locks PRIVATE Threads::Threads)
|
||||
target_compile_definitions(parallel-overhead-locks PRIVATE USE_LOCKS=1)
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set_target_properties(parallel-overhead PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
set_target_properties(parallel-overhead-locks PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS parallel-overhead parallel-overhead-locks DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-python)
|
||||
|
||||
set(PYTHON_FILES builtin.py external.py source.py)
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(Python3_FOUND)
|
||||
set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
|
||||
foreach(_FILE ${PYTHON_FILES})
|
||||
configure_file(${PROJECT_SOURCE_DIR}/${_FILE} ${PROJECT_BINARY_DIR}/${_FILE}
|
||||
@ONLY)
|
||||
install(PROGRAMS ${PROJECT_BINARY_DIR}/${_FILE} DESTINATION bin)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
@@ -10,6 +10,13 @@ if(NOT HIPCC_EXECUTABLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC
|
||||
AND HIPCC_EXECUTABLE
|
||||
AND NOT COMMAND omnitrace_custom_compilation)
|
||||
message(AUTHOR_WARNING "transpose target could not be built")
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(TRANSPOSE_USE_MPI "Enable MPI support in transpose exe" ${TIMEMORY_USE_MPI})
|
||||
|
||||
if(TRANSPOSE_USE_MPI)
|
||||
@@ -29,12 +36,11 @@ if(TRANSPOSE_USE_MPI)
|
||||
target_link_libraries(transpose PRIVATE MPI::MPI_C)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set_target_properties(transpose PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC AND HIPCC_EXECUTABLE)
|
||||
# defined in MacroUtilities.cmake
|
||||
omnitrace_custom_compilation(COMPILER ${HIPCC_EXECUTABLE} TARGET transpose)
|
||||
endif()
|
||||
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC AND HIPCC_EXECUTABLE)
|
||||
# defined in MacroUtilities.cmake
|
||||
omnitrace_custom_compilation(COMPILER ${HIPCC_EXECUTABLE} TARGET transpose)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS transpose DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -4,10 +4,12 @@ project(omnitrace-user-api LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
find_package(Threads REQUIRED)
|
||||
if(NOT TARGET omnitrace::omnitrace-user-library)
|
||||
find_package(omnitrace REQUIRED COMPONENTS user)
|
||||
endif()
|
||||
add_executable(user-api user-api.cpp)
|
||||
target_link_libraries(user-api PRIVATE Threads::Threads omnitrace::omnitrace-user-library)
|
||||
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set_target_properties(user-api PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL "omnitrace")
|
||||
install(TARGETS user-api DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -7,11 +7,21 @@
|
||||
: ${NJOBS:=12}
|
||||
: ${DISTRO:=""}
|
||||
: ${LTO:="OFF"}
|
||||
: ${STRIP:="ON"}
|
||||
: ${LIBGCC:="ON"}
|
||||
: ${LIBSTDCXX:="OFF"}
|
||||
: ${MAX_THREADS:=2048}
|
||||
: ${PERFETTO_TOOLS:="ON"}
|
||||
: ${HIDDEN_VIZ:="ON"}
|
||||
: ${PYTHON_VERSIONS:="6 7 8 9 10"}
|
||||
: ${GENERATORS:="STGZ DEB RPM"}
|
||||
: ${MPI_IMPL:="openmpi"}
|
||||
: ${CLEAN:=0}
|
||||
: ${FRESH:=0}
|
||||
: ${WITH_CORE:=0}
|
||||
: ${WITH_MPI:=0}
|
||||
: ${WITH_ROCM:=0}
|
||||
: ${WITH_ROCM_MPI:=0}
|
||||
|
||||
if [ -z "${DISTRO}" ]; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
@@ -21,12 +31,136 @@ if [ -z "${DISTRO}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
tolower()
|
||||
{
|
||||
echo "$@" | awk -F '\|~\|' '{print tolower($1)}';
|
||||
}
|
||||
|
||||
toupper()
|
||||
{
|
||||
echo "$@" | awk -F '\|~\|' '{print toupper($1)}';
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
print_option() { printf " --%-10s %-24s %s\n" "${1}" "${2}" "${3}"; }
|
||||
echo "Options:"
|
||||
python_info="(Use '+nopython' to build w/o python, use '+python' to python build with python)"
|
||||
print_option core "[+nopython] [+python]" "Core ${python_info}"
|
||||
print_option mpi "[+nopython] [+python]" "MPI ${python_info}"
|
||||
print_option rocm "[+nopython] [+python]" "ROCm ${python_info}"
|
||||
print_option rocm-mpi "[+nopython] [+python]" "ROCm + MPI ${python_info}"
|
||||
print_option mpi-impl "[openmpi|mpich]" "MPI implementation"
|
||||
|
||||
echo ""
|
||||
print_default_option() { printf " --%-20s %-14s %s (default: %s)\n" "${1}" "${2}" "${3}" "$(tolower ${4})"; }
|
||||
print_default_option lto "[on|off]" "Enable LTO" "${LTO}"
|
||||
print_default_option strip "[on|off]" "Strip libraries" "${STRIP}"
|
||||
print_default_option perfetto-tools "[on|off]" "Install perfetto tools" "${PERFETTO_TOOLS}"
|
||||
print_default_option static-libgcc "[on|off]" "Build with static libgcc" "${LIBGCC}"
|
||||
print_default_option static-libstdcxx "[on|off]" "Build with static libstdc++" "${LIBSTDCXX}"
|
||||
print_default_option hidden-visibility "[on|off]" "Build with hidden visibility" "${HIDDEN_VIZ}"
|
||||
print_default_option max-threads "N" "Max number of threads supported" "${MAX_THREADS}"
|
||||
print_default_option parallel "N" "Number of parallel build jobs" "${NJOBS}"
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
ARG=${1}
|
||||
shift
|
||||
VAL=0
|
||||
|
||||
case "${ARG}" in
|
||||
--clean)
|
||||
CLEAN=1
|
||||
continue
|
||||
;;
|
||||
--fresh)
|
||||
FRESH=1
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
if [ "$1" = "+nopython" ]; then
|
||||
VAL=$(( ${VAL} + 1 ))
|
||||
shift
|
||||
elif [ "$1" = "+python" ]; then
|
||||
VAL=$(( ${VAL} + 2 ))
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case "${ARG}" in
|
||||
? | -h | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--core)
|
||||
WITH_CORE=${VAL}
|
||||
;;
|
||||
--mpi)
|
||||
WITH_MPI=${VAL}
|
||||
;;
|
||||
--rocm)
|
||||
WITH_ROCM=${VAL}
|
||||
;;
|
||||
--rocm-mpi)
|
||||
WITH_ROCM_MPI=${VAL}
|
||||
;;
|
||||
--mpi-impl)
|
||||
MPI_IMPL=${1}
|
||||
shift
|
||||
;;
|
||||
--lto)
|
||||
LTO=$(toupper ${1})
|
||||
shift
|
||||
;;
|
||||
--static-libgcc)
|
||||
LIBGCC=$(toupper ${1})
|
||||
shift
|
||||
;;
|
||||
--static-libstdcxx)
|
||||
LIBSTDCXX=$(toupper ${1})
|
||||
shift
|
||||
;;
|
||||
--strip)
|
||||
STRIP=$(toupper ${1})
|
||||
shift
|
||||
;;
|
||||
--hidden-visibility)
|
||||
HIDDEN_VIZ=$(toupper ${1})
|
||||
shift
|
||||
;;
|
||||
--perfetto-tools)
|
||||
PERFETTO_TOOLS=$(toupper ${1})
|
||||
shift
|
||||
;;
|
||||
--max-threads)
|
||||
MAX_THREADS=${1}
|
||||
shift
|
||||
;;
|
||||
--parallel)
|
||||
NJOBS=${1}
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo -e "Error! Unknown option : ${ARG}"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
NPROC=$(nproc)
|
||||
if [ ${NJOBS} -gt ${NPROC} ]; then NJOBS=${NPROC}; fi
|
||||
|
||||
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DCPACK_GENERATOR=STGZ"
|
||||
OMNITRACE_GENERAL_ARGS="-DOMNITRACE_CPACK_SYSTEM_NAME=${DISTRO} -DOMNITRACE_ROCM_VERSION=${ROCM_VERSION} -DOMNITRACE_MAX_THREADS=2048 -DOMNITRACE_STRIP_LIBRARIES=OFF -DOMNITRACE_INSTALL_PERFETTO_TOOLS=ON"
|
||||
OMNITRACE_BUILD_ARGS="-DOMNITRACE_BUILD_TESTING=OFF -DOMNITRACE_BUILD_EXAMPLES=OFF -DOMNITRACE_BUILD_PAPI=ON -DOMNITRACE_BUILD_LTO=${LTO} -DOMNITRACE_BUILD_HIDDEN_VISIBILITY=OFF"
|
||||
OMNITRACE_GENERAL_ARGS="-DOMNITRACE_CPACK_SYSTEM_NAME=${DISTRO} -DOMNITRACE_ROCM_VERSION=${ROCM_VERSION} -DOMNITRACE_MAX_THREADS=${MAX_THREADS} -DOMNITRACE_STRIP_LIBRARIES=${STRIP} -DOMNITRACE_INSTALL_PERFETTO_TOOLS=${PERFETTO_TOOLS}"
|
||||
OMNITRACE_BUILD_ARGS="-DOMNITRACE_BUILD_TESTING=OFF -DOMNITRACE_BUILD_EXAMPLES=OFF -DOMNITRACE_BUILD_PAPI=ON -DOMNITRACE_BUILD_LTO=${LTO} -DOMNITRACE_BUILD_HIDDEN_VISIBILITY=${HIDDEN_VIZ} -DOMNITRACE_BUILD_STATIC_LIBGCC=${LIBGCC} -DOMNITRACE_BUILD_STATIC_LIBSTDCXX=${LIBSTDCXX}"
|
||||
OMNITRACE_USE_ARGS="-DOMNITRACE_USE_MPI_HEADERS=ON -DOMNITRACE_USE_OMPT=ON -DOMNITRACE_USE_PAPI=ON"
|
||||
TIMEMORY_ARGS="-DTIMEMORY_USE_LIBUNWIND=ON -DTIMEMORY_BUILD_LIBUNWIND=ON -DTIMEMORY_BUILD_PORTABLE=ON"
|
||||
DYNINST_ARGS="-DOMNITRACE_BUILD_DYNINST=ON -DDYNINST_USE_OpenMP=ON $(echo -DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON)"
|
||||
@@ -61,11 +195,6 @@ copy-installer()
|
||||
fi
|
||||
}
|
||||
|
||||
tolower()
|
||||
{
|
||||
echo "$@" | awk -F '\|~\|' '{print tolower($1)}';
|
||||
}
|
||||
|
||||
build-and-package-base()
|
||||
{
|
||||
local DIR=${1}
|
||||
@@ -149,86 +278,6 @@ build-and-package()
|
||||
fi
|
||||
}
|
||||
|
||||
: ${WITH_CORE:=0}
|
||||
: ${WITH_MPI:=0}
|
||||
: ${WITH_ROCM:=0}
|
||||
: ${WITH_ROCM_MPI:=0}
|
||||
|
||||
usage()
|
||||
{
|
||||
print_option() { printf " --%-10s %-24s %s\n" "${1}" "${2}" "${3}"; }
|
||||
echo "Options:"
|
||||
python_info="(Use '-python' to build w/o python, use '+python' to python build with python)"
|
||||
print_option core "[+nopython] [+python]" "Core ${python_info}"
|
||||
print_option mpi "[+nopython] [+python]" "MPI ${python_info}"
|
||||
print_option rocm "[+nopython] [+python]" "ROCm ${python_info}"
|
||||
print_option rocm-mpi "[+nopython] [+python]" "ROCm + MPI ${python_info}"
|
||||
print_option mpi-impl "[openmpi|mpich]" "MPI implementation"
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
ARG=${1}
|
||||
shift
|
||||
VAL=0
|
||||
|
||||
case "${ARG}" in
|
||||
--clean)
|
||||
CLEAN=1
|
||||
continue
|
||||
;;
|
||||
--fresh)
|
||||
FRESH=1
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
if [ "$1" = "-python" ]; then
|
||||
VAL=$(( ${VAL} + 1 ))
|
||||
shift
|
||||
elif [ "$1" = "+python" ]; then
|
||||
VAL=$(( ${VAL} + 2 ))
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case "${ARG}" in
|
||||
? | -h | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--core)
|
||||
WITH_CORE=${VAL}
|
||||
;;
|
||||
--mpi)
|
||||
WITH_MPI=${VAL}
|
||||
;;
|
||||
--rocm)
|
||||
WITH_ROCM=${VAL}
|
||||
;;
|
||||
--rocm-mpi)
|
||||
WITH_ROCM_MPI=${VAL}
|
||||
;;
|
||||
--mpi-impl)
|
||||
MPI_IMPL=${1}
|
||||
shift
|
||||
;;
|
||||
--clean)
|
||||
CLEAN=1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo -e "Error! Unknown option : ${ARG}"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -d /opt/conda/bin ]; then
|
||||
export PATH=${PATH}:/opt/conda/bin
|
||||
source activate
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#
|
||||
# ------------------------------------------------------------------------------#
|
||||
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
|
||||
|
||||
add_executable(omnitrace-exe ${_EXCLUDE})
|
||||
|
||||
target_sources(
|
||||
|
||||
@@ -32,6 +32,7 @@ target_link_libraries(
|
||||
$<BUILD_INTERFACE:omnitrace::omnitrace-hip>
|
||||
$<BUILD_INTERFACE:omnitrace::omnitrace-roctracer>
|
||||
$<BUILD_INTERFACE:omnitrace::omnitrace-rocm-smi>
|
||||
$<BUILD_INTERFACE:$<IF:$<BOOL:${OMNITRACE_BUILD_LTO}>,omnitrace::omnitrace-lto,>>
|
||||
$<BUILD_INTERFACE:$<IF:$<BOOL:${OMNITRACE_BUILD_STATIC_LIBGCC}>,omnitrace::omnitrace-static-libgcc,>>
|
||||
$<BUILD_INTERFACE:$<IF:$<BOOL:${OMNITRACE_BUILD_STATIC_LIBSTDCXX}>,omnitrace::omnitrace-static-libstdcxx,>>
|
||||
$<BUILD_INTERFACE:$<IF:$<BOOL:${OMNITRACE_USE_SANITIZER}>,omnitrace::omnitrace-sanitizer,>>
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
#
|
||||
# ########################################################################################
|
||||
|
||||
if(OMNITRACE_BUILD_STATIC_LIBSTDCXX)
|
||||
omnitrace_message(FATAL_ERROR
|
||||
"static libstdc++ is not compatible with python bindings")
|
||||
endif()
|
||||
|
||||
# if set, will screw up loading library
|
||||
unset(CMAKE_DEBUG_POSTFIX)
|
||||
set(CMAKE_CXX_CLANG_TIDY)
|
||||
@@ -76,14 +81,17 @@ set(pybind_libs pybind11::module)
|
||||
add_library(libpyomnitrace-interface INTERFACE)
|
||||
target_link_libraries(
|
||||
libpyomnitrace-interface
|
||||
INTERFACE pybind11::module
|
||||
timemory::timemory-headers
|
||||
omnitrace::omnitrace-headers
|
||||
omnitrace::omnitrace-compile-options
|
||||
omnitrace::omnitrace-lto
|
||||
omnitrace::omnitrace-dl-library
|
||||
omnitrace::omnitrace-python
|
||||
omnitrace::omnitrace-python-compile-options)
|
||||
INTERFACE
|
||||
pybind11::module
|
||||
timemory::timemory-headers
|
||||
omnitrace::omnitrace-headers
|
||||
omnitrace::omnitrace-compile-options
|
||||
omnitrace::omnitrace-lto
|
||||
omnitrace::omnitrace-dl-library
|
||||
omnitrace::omnitrace-python
|
||||
omnitrace::omnitrace-python-compile-options
|
||||
$<BUILD_INTERFACE:$<IF:$<BOOL:${OMNITRACE_BUILD_STATIC_LIBGCC}>,omnitrace::omnitrace-static-libgcc,>>
|
||||
)
|
||||
|
||||
omnitrace_target_compile_definitions(libpyomnitrace-interface
|
||||
INTERFACE OMNITRACE_PYBIND11_SOURCE)
|
||||
|
||||
@@ -154,7 +154,7 @@ PYBIND11_MODULE(libpyomnitrace, omni)
|
||||
_is_finalized = true;
|
||||
omnitrace_finalize();
|
||||
},
|
||||
"Initialize omnitrace");
|
||||
"Finalize omnitrace");
|
||||
|
||||
py::doc("omnitrace profiler for python");
|
||||
pyprofile::generate(omni);
|
||||
|
||||
Reference in New Issue
Block a user