Skip to content

Commit

Permalink
Merge branch 'main' into pkg_config_dyad
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden authored Dec 2, 2022
2 parents a58f7d8 + a4c5a28 commit efc320c
Show file tree
Hide file tree
Showing 26 changed files with 777 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Build Env
run: |
sudo apt-get update
sudo apt install clang llvm-dev libjansson-dev libssl-dev bison flex make cmake
sudo apt install clang llvm-dev libjansson-dev libssl-dev bison flex make cmake mpich
clang++ --version
- name: Compile check
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
python -m pip install --upgrade pip pytest setuptools
cd src/python
python setup.py install
python -m pip install -r requirements.txt
python -m pip list
- name: Run Python Smoke Tests
Expand Down
1 change: 1 addition & 0 deletions scripts/check-c-code-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ astyle --errors-to-stdout \
--max-code-length=80 \
--break-after-logical \
--indent-switches \
--add-brackets \
${FILES}

#
23 changes: 22 additions & 1 deletion src/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.12)

project(PerfFlowAspect VERSION "0.1.0")

Expand Down Expand Up @@ -57,6 +57,27 @@ add_subdirectory(runtime)
add_subdirectory(weaver)
add_subdirectory(test)

add_library(perfflowaspect INTERFACE)
target_link_libraries(perfflowaspect INTERFACE perfflow_runtime perfflow_parser WeavePassPlugin)
install(TARGETS perfflowaspect
EXPORT perfflow_export
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

add_subdirectory(config)

message(STATUS "Config Dir: ${PERFFLOWASPECT_INSTALL_CONFIG_DIR}")

if (NOT DEFINED PERFFLOWASPECT_INSTALL_CONFIG_DIR)
set(PERFFLOWASPECT_INSTALL_CONFIG_DIR "share")
endif()

install(EXPORT perfflow_export
FILE perfflowaspect_targets.cmake
NAMESPACE perfflowaspect::
DESTINATION ${CMAKE_INSTALL_PREFIX}/${PERFFLOWASPECT_INSTALL_CONFIG_DIR}
)

message(STATUS "PerfFlowAspect version: \"${PROJECT_VERSION}\"")
2 changes: 1 addition & 1 deletion src/c/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ configure_package_config_file(
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/perfflowaspect-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/perfflowaspect-config-version.cmake
perfflowaspect_setup_targets.cmake
DESTINATION ${PERFFLOWASPECT_INSTALL_CMAKE_MODULE_DIR})

# Create pkg-config .pc file
set(PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/${PERFFLOWASPECT_INSTALL_LIB_DIR})

set(PKG_CONFIG_LIBS "-L\${libdir} -lperfflow_runtime -L\${libdir} -lperfflow_parser -lssl -lcrypto")

configure_file(
Expand Down
7 changes: 6 additions & 1 deletion src/c/config/perfflowaspect-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ if (NOT PERFFLOWASPECT_CONFIG_LOADED)
set(PERFFLOWASPECT_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(PERFFLOWASPECT_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@")

include(CMakeFindDependencyMacro)

find_dependency(OpenSSL REQUIRED)

# Library targets imported from file
include(${PERFFLOWASPECT_INSTALL_PREFIX}/share/perfflowaspect_setup_targets.cmake)
# include(${PERFFLOWASPECT_INSTALL_PREFIX}/share/perfflowaspect_setup_targets.cmake)
include(${PERFFLOWASPECT_INSTALL_PREFIX}/share/perfflowaspect_targets.cmake)

set(PERFFLOWASPECT_CONFIG_LOADED TRUE)
endif()
16 changes: 0 additions & 16 deletions src/c/config/perfflowaspect_setup_targets.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion src/c/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target_include_directories(perfflow_parser_static PRIVATE ${CMAKE_CURRENT_BINARY
target_include_directories(perfflow_parser PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

install(TARGETS perfflow_parser
EXPORT perfflow_parser
EXPORT perfflow_export
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
8 changes: 5 additions & 3 deletions src/c/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ set(perfflow_runtime_sources
perfflow_runtime.cpp
)

set(perfflow_runtime_deps -ljansson -lssl -lcrypto
find_package(OpenSSL REQUIRED)

set(perfflow_runtime_deps -ljansson
)

add_library(perfflow_runtime SHARED
${perfflow_runtime_sources}
${perfflow_runtime_headers}
)

target_link_libraries(perfflow_runtime ${perfflow_runtime_deps})
target_link_libraries(perfflow_runtime ${perfflow_runtime_deps} OpenSSL::SSL OpenSSL::Crypto)

install(TARGETS perfflow_runtime
EXPORT perfflow_runtime
EXPORT perfflow_export
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
6 changes: 4 additions & 2 deletions src/c/runtime/advice_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ struct advice_base_t
virtual ~advice_base_t () {}
virtual int before (const char *module,
const char *function,
const char *flow) = 0;
const char *flow,
const char *pcut) = 0;
virtual int after (const char *module,
const char *function,
const char *flow) = 0;
const char *flow,
const char *pcut) = 0;
virtual int before_async (const char *module,
const char *function,
const char *scope,
Expand Down
Loading

0 comments on commit efc320c

Please sign in to comment.