Skip to content

Commit

Permalink
update compilation and installation
Browse files Browse the repository at this point in the history
  • Loading branch information
FindHao committed Mar 28, 2023
1 parent f34cb07 commit 6233dc5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions bin/gpupunk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export GPUPUNK_WITH_HPCRUN=0
export GPUPUNK_VERBOSE=0
# filter cubins
export GPUPUNK_CUBIN_FILTER=1

export SANITIZER_DISABLE_PARALLEL_LAUNCHES=1


usage() {
cat <<EOF
Usage:
Expand Down
5 changes: 0 additions & 5 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@ if [ ! -d spack ];then
fi
export SPACK_ROOT=$(pwd)/spack
source ${SPACK_ROOT}/share/spack/setup-env.sh
# This is necessary and used when statically compiling redshow.
# mbedtls has to older than 2.28.0
# spack install [email protected] [email protected] libs=shared [email protected]
spack install boost mbedtls libs=shared elfutils
check_status "spack install"
# TODO: find a better solution for those packages' installation
# spack load [email protected] [email protected] [email protected]
spack load boost mbedtls elfutils

# Find spack and boost dir
Expand Down
10 changes: 9 additions & 1 deletion bin/setgpupunk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@ export REDSHOW_PATH=${GPUPUNK_PATH}/redshow
export GPUTRIGGER_PATH=${GPUPUNK_PATH}/gputrigger
export DRCCTPROF_PATH=${GPUPUNK_PATH}/drcctprof

export LD_LIBRARY_PATH=${GPUTRIGGER_PATH}:${REDSHOW_PATH}/lib:$LD_LIBRARY_PATH
SPACK_PATH=${SPACK_PATH:-$GPUPUNK_PATH/spack}
source ${SPACK_PATH}/share/spack/setup-env.sh
spack load boost mbedtls elfutils
# @FindHao NOTE: this is a hack to get the path of the latest version of mbedtls
B=$(spack find --path mbedtls | tail -n 1 | cut -d ' ' -f 3)
S=${B%/*}
echo "GPUPUNK-> mbedtls install path is " $B

export LD_LIBRARY_PATH=$B/lib:${GPUTRIGGER_PATH}:${REDSHOW_PATH}/lib:$LD_LIBRARY_PATH
export PATH=${GPUPUNK_PATH}/bin/:${DRCCTPROF_PATH}/bin:$PATH
7 changes: 2 additions & 5 deletions cubin_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ else ()
endif ()
enable_language(CUDA)

include(FindLibElf.cmake)

include(FindMbedTLS.cmake)

message(INFO "==========")
message(STATUS ${LIBELF_INCLUDE_DIRS})
message(STATUS ${LIBELF_LIBRARIES_PATH})
message(STATUS ${MBEDTLS_INCLUDE_DIRS})
message(STATUS ${MBEDCRYPTO_LIBRARY_PATH})

Expand All @@ -49,7 +47,6 @@ include_directories(${SANITIZER_PATH}/include/
${CUDAToolkit_TARGET_DIR}/include/
${CMAKE_CURRENT_LIST_DIR}/include/
${CMAKE_CURRENT_LIST_DIR}/src/
${LIBELF_INCLUDE_DIRS}
${MBEDTLS_INCLUDE_DIRS}
)
message(INFO ${SANITIZER_PATH} ${CUDAToolkit_NVCC_EXECUTABLE})
Expand All @@ -60,7 +57,7 @@ file(GLOB cubin_filter_head CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/*.h" )



add_link_options(-L${LIBELF_LIBRARIES_PATH} -L${MBEDTLS_LIBRARY_PATH} -L${MBEDCRYPTO_LIBRARY_PATH})
add_link_options(-L${MBEDTLS_LIBRARY_PATH} -L${MBEDCRYPTO_LIBRARY_PATH})

message(INFO ${mbedcrypto_lib})

Expand Down
2 changes: 1 addition & 1 deletion cubin_filter/crypto-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ crypto_hash_compute
memset(hash, 0, hash_length);

// compute an MD5 hash of input
mbedtls_md5_ret(input, input_length, hash);
mbedtls_md5(input, input_length, hash);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion gpupunk_samples
2 changes: 1 addition & 1 deletion gputrigger

0 comments on commit 6233dc5

Please sign in to comment.