-
Notifications
You must be signed in to change notification settings - Fork 35
Add proxy library (for Linux only now) #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Proxy library | ||
|
||
on: workflow_call | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
ubuntu-build: | ||
name: Build - Ubuntu | ||
|
||
strategy: | ||
matrix: | ||
os: ['ubuntu-22.04'] | ||
build_type: [Release, Debug] | ||
compiler: [{c: gcc, cxx: g++}] | ||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Install apt packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake libhwloc-dev libjemalloc-dev libtbb-dev | ||
|
||
- name: Configure build | ||
run: > | ||
cmake | ||
-B ${{github.workspace}}/build | ||
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | ||
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | ||
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | ||
-DUMF_BUILD_SHARED_LIBRARY=ON | ||
-DUMF_BUILD_BENCHMARKS=ON | ||
-DUMF_BUILD_TESTS=ON | ||
-DUMF_FORMAT_CODE_STYLE=OFF | ||
-DUMF_DEVELOPER_MODE=OFF | ||
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON | ||
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON | ||
-DUMF_BUILD_LIBUMF_POOL_SCALABLE=ON | ||
-DUMF_ENABLE_POOL_TRACKING=OFF | ||
|
||
- name: Build UMF | ||
run: cmake --build ${{github.workspace}}/build -j $(nproc) | ||
|
||
- name: Run "ctest --output-on-failure" with proxy library | ||
working-directory: ${{github.workspace}}/build | ||
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure | ||
|
||
- name: Run "./test/umf_test-memoryPool" with proxy library | ||
working-directory: ${{github.workspace}}/build | ||
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/umf_test-memoryPool | ||
|
||
- name: Run "/usr/bin/ls" with proxy library | ||
working-directory: ${{github.workspace}}/build | ||
run: LD_PRELOAD=./lib/libumf_proxy.so /usr/bin/ls | ||
|
||
- name: Run "/usr/bin/date" with proxy library | ||
working-directory: ${{github.workspace}}/build | ||
run: LD_PRELOAD=./lib/libumf_proxy.so /usr/bin/date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright (C) 2023-2024 Intel Corporation | ||
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake) | ||
|
||
set(PROXY_SOURCES | ||
proxy_lib.c | ||
) | ||
|
||
set(PROXY_SOURCES_LINUX | ||
proxy_lib_linux.c | ||
) | ||
|
||
set(PROXY_SOURCES_WINDOWS | ||
proxy_lib_windows.c | ||
) | ||
|
||
set(PROXY_SOURCES_MACOSX | ||
proxy_lib_linux.c | ||
) | ||
|
||
if(LINUX) | ||
set(PROXY_SOURCES ${PROXY_SOURCES} ${PROXY_SOURCES_LINUX}) | ||
elseif(WINDOWS) | ||
set(PROXY_SOURCES ${PROXY_SOURCES} ${PROXY_SOURCES_WINDOWS}) | ||
elseif(MACOSX) | ||
set(PROXY_SOURCES ${PROXY_SOURCES} ${PROXY_SOURCES_MACOSX}) | ||
endif() | ||
|
||
add_umf_library(NAME umf_proxy | ||
TYPE SHARED | ||
SRCS ${PROXY_SOURCES} | ||
LIBS ${PROXY_LIBS} | ||
LINUX_MAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/proxy_lib.map | ||
WINDOWS_DEF_FILE ${CMAKE_CURRENT_SOURCE_DIR}/proxy_lib.def) | ||
|
||
add_library(${PROJECT_NAME}::proxy ALIAS umf_proxy) | ||
|
||
if(PROXY_LIB_USES_SCALABLE_POOL) | ||
target_compile_definitions(umf_proxy PRIVATE PROXY_LIB_USES_SCALABLE_POOL=1) | ||
elseif(PROXY_LIB_USES_JEMALLOC_POOL) | ||
target_compile_definitions(umf_proxy PRIVATE PROXY_LIB_USES_JEMALLOC_POOL=1) | ||
endif() | ||
|
||
target_include_directories(umf_proxy PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/utils> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
install(TARGETS umf_proxy | ||
EXPORT ${PROJECT_NAME}-targets) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.