Skip to content

Commit

Permalink
Updating README and build chain with debugging instructions for all u…
Browse files Browse the repository at this point in the history
…pdated dependencies
  • Loading branch information
DylanKierans committed Jul 23, 2024
1 parent c2f7d8b commit d2b228c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 37 deletions.
45 changes: 16 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,41 @@ Using `PMPMEAS (Poor Man's Performance Measurement tool)` to interface with papi

Install [`libotf2`](https://www.vi-hps.org/projects/score-p/), and [`zeromq`](https://github.com/zeromq) required dependency.

Install [`papi`](https://hpc.llnl.gov/software/development-environment-software/papi-performance-application-programming-interface) optional (but recommended) dependency.
If metrics enabled (default: yes), install [`boost`](https://www.boost.org/) required dependency, and install [`papi`](https://hpc.llnl.gov/software/development-environment-software/papi-performance-application-programming-interface) optional (but recommended) dependency.

Then install `rTrace` from github with:

```R
devtools::install_github("DylanKierans/rTrace")
```

Refer to #debugging if you are having errors.
Refer to [debugging section](#debugging) if you are having errors.

### DEBUGGING

1. Dependencies not found during installation. Either dependencies are not installed or are in non-standard directories.
```
configure: error: Unable to find FOO.h
ERROR: configuration failed for package ‘rTrace’
```

- Error - `configure: error: Unable to find zmq.h`. Solution:

```R
devtools::install_github("DylanKierans/rTrace", configure.args="--with-zeromq=/path/to/zeromq/directory")
1. Dependency not found during installation. Either dependency is not installed or is installed in non-standard directories.
```

- Error - `configure: error: Unable to find otf2/otf2.h`. Solution:

```R
devtools::install_github("DylanKierans/rTrace", configure.args="--with-otf2=/path/to/otf2/directory")
configure: error: Unable to find FOO.h
ERROR: configuration failed for package ‘rTrace’
```

- Error - `configure: error: Unable to find papi.h`. Solution:


**Solution**: if installed in non-standard dirctory pass the following argument to `devtools::install_github` where `FOO` can be one of the dependencies `{zeromq, otf2, papi, perf, boost}`.

Example:
Error - `configure: error: Unable to find FOO_HEADER.h`.

```R
devtools::install_github("DylanKierans/rTrace", configure.args="--with-papi=/path/to/papi/directory")
devtools::install_github("DylanKierans/rTrace", configure.args="--with-FOO=/path/to/install/directory")
```

- Error - `configure: error: Unable to find linux/perf_event.h`. Solution:
2. If you are receiving error about `devtools` not installed.

**Solution**: install with

```R
devtools::install_github("DylanKierans/rTrace", configure.args="--with-perf=/path/to/perf/directory")
install.packages("devtools")
```

2. If you are receiving error about `devtools` not installed, first install with:

```R
install.packages("devtools") # if not yet installed
```


## Usage

Expand Down
33 changes: 29 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ enable_metrics
enable_papi
with_papi
with_perf
with_boost
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1381,6 +1382,8 @@ Optional Packages:
--with-otf2=PATH specify prefix directory for installed otf2 package.
--with-papi=PATH specify prefix directory for installed papi package.
--with-perf=PATH specify prefix directory for installed perf package.
--with-boost=PATH specify prefix directory for installed boost
package.
Some influential environment variables:
CXX C++ compiler command
Expand Down Expand Up @@ -4042,8 +4045,6 @@ if test "${enable_metrics+set}" = set; then :
enableval=$enable_metrics;
fi
### PAPI - optional if metrics enabled
# Check whether --enable-papi was given.
if test "${enable_papi+set}" = set; then :
enableval=$enable_papi;
Expand All @@ -4056,14 +4057,18 @@ if test "${with_papi+set}" = set; then :
fi
### Perf - requirement if metrics enabled
# Check whether --with-perf was given.
if test "${with_perf+set}" = set; then :
withval=$with_perf;
fi
# Check whether --with-boost was given.
if test "${with_boost+set}" = set; then :
withval=$with_boost;
fi
if test "X$enable_metrics" != "Xno"; then
if test "X$enable_papi" != "Xno"; then
if test "X$with_papi" = "X"; then
Expand Down Expand Up @@ -4175,6 +4180,26 @@ done
user_inc="-I$with_perf/include $user_inc"
fi
if test "X$with_boost" = "X"; then
for ac_header in boost/format.hpp
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "boost/format.hpp" "ac_cv_header_boost_format_hpp" "$ac_includes_default"
if test "x$ac_cv_header_boost_format_hpp" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_BOOST_FORMAT_HPP 1
_ACEOF
else
as_fn_error $? "Unable to find boost/format.hpp" "$LINENO" 5
fi
done
else
user_libs="-Wl,-rpath=$with_boost/lib $user_libs"
user_inc="-I$with_boost/include $user_inc"
fi
$as_echo "#define _COLLECT_METRICS /**/" >>confdefs.h
Expand Down
13 changes: 9 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,10 @@ fi

### PMPMEAS DEPENDENCIES
AC_ARG_ENABLE(metrics, [AS_HELP_STRING([--disable-metrics], [do not use metrics (default: yes)])])

### PAPI - optional if metrics enabled
AC_ARG_ENABLE(papi, [AS_HELP_STRING([--disable-papi], [do not use papi for metric collection (default: yes)])])
AC_ARG_WITH(papi, [AS_HELP_STRING([--with-papi=PATH], [specify prefix directory for installed papi package.])])

### Perf - requirement if metrics enabled
AC_ARG_WITH(perf, [AS_HELP_STRING([--with-perf=PATH], [specify prefix directory for installed perf package.])])
AC_ARG_WITH(boost, [AS_HELP_STRING([--with-boost=PATH], [specify prefix directory for installed boost package.])])

if test "X$enable_metrics" != "Xno"; then
if test "X$enable_papi" != "Xno"; then
Expand Down Expand Up @@ -109,6 +106,14 @@ if test "X$enable_metrics" != "Xno"; then
user_inc="-I$with_perf/include $user_inc"
fi

if test "X$with_boost" = "X"; then
AC_CHECK_HEADERS([boost/format.hpp], [],
[AC_MSG_ERROR([Unable to find boost/format.hpp])])
else
user_libs="-Wl,-rpath=$with_boost/lib $user_libs"
user_inc="-I$with_boost/include $user_inc"
fi

AC_DEFINE(_COLLECT_METRICS, [], [Enable rTrace metric collection])
AC_DEFINE(PMPMEAS_USERTRACE, [], [Tell pmpmeas to compile in R compatible way])
fi
Expand Down
3 changes: 3 additions & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* src/config.h.in. Generated from configure.ac by autoheader. */

/* Define to 1 if you have the <boost/format.hpp> header file. */
#undef HAVE_BOOST_FORMAT_HPP

/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

Expand Down

0 comments on commit d2b228c

Please sign in to comment.