Skip to content

Commit

Permalink
Install python libs and commands (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme authored Apr 2, 2024
1 parent 4a10065 commit 83f4c47
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,23 @@ if (INSTALL_HEADERS)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/caliper/fortran
FILES_MATCHING PATTERN "*.mod")
endif()

install(
DIRECTORY
"python/caliper-reader/caliperreader"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/caliper"
FILES_MATCHING
PATTERN "*.py"
)

install(
PROGRAMS
"python/cali2traceevent.py"
"python/cali2traceevent"
DESTINATION
${CMAKE_INSTALL_BINDIR}
)
endif()

if (INSTALL_CONFIG)
Expand Down Expand Up @@ -559,9 +576,9 @@ if (INSTALL_CONFIG)
)

install(
FILES
FILES
${PROJECT_BINARY_DIR}/caliper.pc
DESTINATION
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
endif()
Expand Down
20 changes: 20 additions & 0 deletions python/cali2traceevent
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
#
# Copyright (c) 2024, Lawrence Livermore National Security, LLC.
# See top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause

import os
import os.path
import sys

exe_file = os.path.realpath(os.path.expanduser(__file__))
cali_prefix = os.path.dirname(os.path.dirname(exe_file))
cali_lib_path = os.path.join(cali_prefix, "lib64", "caliper")
sys.path.insert(0, cali_lib_path)

from cali2traceevent import main

if __name__ == "__main__":
sys.exit(main())

0 comments on commit 83f4c47

Please sign in to comment.