Skip to content
Permalink
Browse files

Merge pull request #129 from xd009642/cmake_config

Initial version of coz-profileConfig.cmake
  • Loading branch information...
ccurtsinger committed Oct 20, 2019
2 parents d87e924 + b7c65bb commit 030f6742558a5e1959029ded71f81bc6c882c9dd
Showing with 31 additions and 0 deletions.
  1. +2 −0 Makefile
  2. +3 −0 README.md
  3. +26 −0 coz-profilerConfig.cmake.in
@@ -9,7 +9,9 @@ update-gh-pages:: all

install:: all
@echo $(LOG_PREFIX) Installing coz to prefix $(prefix) $(LOG_SUFFIX)
@sed 's@destdir@"${DESTDIR}${prefix}"@g' coz-profilerConfig.cmake.in > coz-profilerConfig.cmake
@$(INSTALL) -D coz $(DESTDIR)$(bindir)/coz
@$(INSTALL) -D coz-profilerConfig.cmake $(DESTDIR)$(pkglibdir)/coz-profilerConfig.cmake
@$(INSTALL) -D libcoz/libcoz.so $(DESTDIR)$(pkglibdir)/libcoz.so
@$(INSTALL) -D include/coz.h $(DESTDIR)$(incdir)/coz.h
@mkdir -p $(DESTDIR)$(man1dir)
@@ -67,6 +67,9 @@ To plot profile results, go to http://plasma-umass.github.io/coz/ and load your
## Sample Applications
The `benchmarks` directory in this repository includes several small benchmarks with progress points added at appropriate locations. To build and run one of these benchmarks with `coz`, just browse to `benchmarks/{bench name}` and type `make bench` (or `make test` for a smaller input size). These programs may require several runs before coz has enough measurements to generate a useful profile. Once you have profiled these programs for several minutes, go to http://plasma-umass.github.io/coz/ to load and plot your profile.

## CMake
When you install coz it installs a cmake config file. To add coz to a cmake project simply use the command `find_package(coz-profiler)`. This will import a target for the library and includes called `coz::coz` and a target for the coz binary `coz::profiler`. For guidance on how to use these targets refer to the CMake documentation.

## Limitations
Coz currently does not support interpreted or JIT-compiled languages such as Python, Ruby, or JavaScript. Interpreted languages will likely not be supported at any point, but support for JIT-compiled languages that produce debug information could be added in the future.

@@ -0,0 +1,26 @@


set(COZDIR destdir)

set(COZ_BIN ${COZDIR}/bin/coz)
set(COZ_INCLUDE_DIR ${COZDIR}/include)
get_filename_component(LIBRARY_DIR ${CMAKE_CURRENT_LIST_FILE} DIRECTORY)
set(COZ_LIBRARY ${LIBRARY_DIR}/libcoz.so)

set(COZ_FOUND ON)

message(INFO " ${COZ_INCLUDE_DIR} ${COZ_LIBRARY} ${COZ_FOUND}")

mark_as_advanced(COZ_FOUND COZ_INCLUDE_DIR COZ_LIBRARY)

add_library(coz::coz UNKNOWN IMPORTED)
set_target_properties(coz::coz PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${COZ_INCLUDE_DIR}")

set_target_properties(coz::coz PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${COZ_INCLUDE_DIR}")

add_executable(coz::profiler IMPORTED)

set_property(TARGET coz::profiler PROPERTY IMPORTED_LOCATION ${COZ_BIN})

0 comments on commit 030f674

Please sign in to comment.
You can’t perform that action at this time.