adding pandas and pytest to rquirements.txt (#748)
* adding pandas and pytest to rquirements.txt * setting up requrements.txt * Update requirements - formatting packages - remove packages not directly used by rocprofiler-sdk * Update cmake formatting, linting, and options - if BUILD_CI -> force BUILD_DEVELOPER and BUILD_WERROR - support python installed clang-format and python installed clang-tidy * Update build.sh - split into install-deps.sh and install-apt-deps.sh * Improve code coverage --------- Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
@@ -437,3 +437,9 @@ To run the built samples, `cd` into the `<build directory>` mentioned in the bui
|
||||
```bash
|
||||
ctest -V
|
||||
```
|
||||
|
||||
**Note:** Running few of these tests will require pandas and pytest to be installed first.
|
||||
|
||||
```bash
|
||||
/usr/local/bin/python -m pip install -r requirements.txt
|
||||
```
|
||||
|
||||
@@ -20,11 +20,6 @@ target_link_libraries(
|
||||
rocprofiler::rocprofiler-build-flags rocprofiler::rocprofiler-memcheck
|
||||
rocprofiler::rocprofiler-common-library)
|
||||
|
||||
if(ROCPROFILER_BUILD_CODECOV)
|
||||
target_compile_definitions(rocprofiler-sdk-tool PRIVATE ROCPROFILER_CODECOV=1)
|
||||
target_link_libraries(rocprofiler-sdk-tool PRIVATE gcov)
|
||||
endif()
|
||||
|
||||
set_target_properties(
|
||||
rocprofiler-sdk-tool
|
||||
PROPERTIES LIBRARY_OUTPUT_DIRECTORY
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#if defined(ROCPROFILER_CODECOV) && ROCPROFILER_CODECOV > 0
|
||||
#if defined(CODECOV) && CODECOV > 0
|
||||
extern "C" {
|
||||
extern void
|
||||
__gcov_dump(void);
|
||||
@@ -1731,7 +1731,7 @@ generate_output(buffer_type_t buffer_type)
|
||||
} // namespace
|
||||
|
||||
void
|
||||
tool_fini(void* tool_data)
|
||||
tool_fini(void* /*tool_data*/)
|
||||
{
|
||||
client_identifier = nullptr;
|
||||
client_finalizer = nullptr;
|
||||
@@ -1802,8 +1802,7 @@ tool_fini(void* tool_data)
|
||||
destructors = nullptr;
|
||||
}
|
||||
|
||||
(void) (tool_data);
|
||||
#if defined(ROCPROFILER_CODECOV) && ROCPROFILER_CODECOV > 0
|
||||
#if defined(CODECOV) && CODECOV > 0
|
||||
__gcov_dump();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -73,6 +73,11 @@ extern "C" {
|
||||
|
||||
extern rocprofiler_tool_configure_result_t*
|
||||
rocprofiler_configure(uint32_t, const char*, uint32_t, rocprofiler_client_id_t*);
|
||||
|
||||
#if defined(CODECOV) && CODECOV > 0
|
||||
extern void
|
||||
__gcov_dump(void);
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace rocprofiler
|
||||
@@ -569,6 +574,10 @@ initialize()
|
||||
void
|
||||
finalize()
|
||||
{
|
||||
#if defined(CODECOV) && CODECOV > 0
|
||||
if(get_fini_status() > 0) __gcov_dump();
|
||||
#endif
|
||||
|
||||
if(get_fini_status() != 0)
|
||||
{
|
||||
ROCP_INFO << "ignoring finalization request (value=" << get_fini_status() << ")";
|
||||
@@ -599,6 +608,10 @@ finalize()
|
||||
internal_threading::finalize();
|
||||
set_fini_status(1);
|
||||
});
|
||||
|
||||
#if defined(CODECOV) && CODECOV > 0
|
||||
__gcov_dump();
|
||||
#endif
|
||||
}
|
||||
} // namespace registration
|
||||
} // namespace rocprofiler
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake clang-tidy-15 g++-11 g++-12 python3-pip libdw-dev
|
||||
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-17 10
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12
|
||||
#python3 -m pip install -r requirements.txt
|
||||
python3 -m pip install pytest pandas pyyaml
|
||||
python3 -m pip install 'cmake>=3.22.0'
|
||||
SCRIPT_PATH=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
|
||||
ROCPROFILER_SDK_PATH="$(cd ${SCRIPT_PATH}/../.. && pwd)"
|
||||
|
||||
ROCPROFILER_SDK_PATH="$(pwd)/$(dirname ${BASH_SOURCE[0]})/../.."
|
||||
|
||||
cd ${ROCPROFILER_SDK_PATH}
|
||||
${SCRIPT_PATH}/install-deps.sh
|
||||
|
||||
echo -e "Redirecting to location: $ROCPROFILER_SDK_PATH"
|
||||
cd ${ROCPROFILER_SDK_PATH}
|
||||
|
||||
cmake -B build -DROCPROFILER_BUILD_CI=ON -DROCPROFILER_BUILD_TESTS=ON -DROCPROFILER_BUILD_SAMPLES=ON -DROCPROFILER_ENABLE_CLANG_TIDY=ON $*
|
||||
echo -e "Configuring rocprofiler-sdk: ${ROCPROFILER_SDK_PATH}/build"
|
||||
cmake -B build -DROCPROFILER_BUILD_{CI,TESTS,SAMPLES}=ON -DROCPROFILER_ENABLE_CLANG_TIDY=ON "${@}"
|
||||
|
||||
echo -e "Building rocprofiler-sdk: ${ROCPROFILER_SDK_PATH}/build"
|
||||
cmake --build build --target all --parallel $(nproc)
|
||||
#cd --
|
||||
|
||||
Executable
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
apt-get update
|
||||
apt-get install -y cmake clang-tidy-15 g++-11 g++-12 python3-pip libdw-dev
|
||||
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-17 10
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12
|
||||
Executable
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
ROCPROFILER_SDK_PATH=$(cd $(dirname ${BASH_SOURCE[0]})/../.. && pwd)
|
||||
|
||||
# echo "ROCPROFILER_SDK_PATH: ${ROCPROFILER_SDK_PATH}"
|
||||
|
||||
echo -e "Installing dependencies from: ${ROCPROFILER_SDK_PATH}/requirements.txt"
|
||||
python3 -m pip install --user -r ${ROCPROFILER_SDK_PATH}/requirements.txt
|
||||
مرجع در شماره جدید
Block a user