Skip to content

Commit

Permalink
Configuration now allows users to pass path to software dependencies,…
Browse files Browse the repository at this point in the history
… using eg --with-papi=/path/to/papi
  • Loading branch information
DylanKierans committed Jul 22, 2024
1 parent 9c8388f commit ca990c6
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 1,239 deletions.
48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,57 @@ Using `PMPMEAS (Poor Man's Performance Measurement tool)` to interface with papi

## Installation

Install [`libotf2`](https://www.vi-hps.org/projects/score-p/), and [`zeromq`](https://github.com/zeromq) dependency. Then install `rTrace` from github with:
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.

Then install `rTrace` from github with:

```R
install.packages("devtools") # if not yet installed
devtools::install_github("DylanKierans/rTrace")
```

Refer to #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")
```

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

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

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

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

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

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

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

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


## Usage

```R
Expand Down
110 changes: 92 additions & 18 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,8 @@ LTLIBOBJS
LIBOBJS
PMPMEAS_CPP_SOURCE
PMPMEAS_C_SOURCE
USER_INC
USER_LIBS
PAPICNTMAX
EGREP
GREP
Expand Down Expand Up @@ -719,9 +721,13 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_silent_rules
with_zeromq
enable_dependency_tracking
with_otf2
enable_metrics
enable_papi
with_papi
with_perf
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1365,11 +1371,16 @@ Optional Features:
--disable-dependency-tracking
speeds up one-time build
--disable-metrics do not use metrics (default: yes)
--disable-papi do not use papi for metric collection (default: yes)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-papi do not use papi for metric collection (default: yes)
--with-zeromq=PATH specify prefix directory for installed zeromq
package.
--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.
Some influential environment variables:
CXX C++ compiler command
Expand Down Expand Up @@ -2751,8 +2762,16 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
###################
# Look for libraries
## AC_CHECK_LIB (library, function, [action-if-found], [action-if-not-found], [other-libraries])
## AC_ARG_ENABLE(option-name, help-string, action-if-present, action-if-not-present)
## AC_ARG_WITH(option-name, help-string, action-if-present, action-if-not-present)
## Zeromq
# Check whether --with-zeromq was given.
if test "${with_zeromq+set}" = set; then :
withval=$with_zeromq;
fi
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
Expand Down Expand Up @@ -3845,7 +3864,9 @@ fi
done
for ac_header in zmq.h sys/wait.h
if test "X$with_zeromq" = "X"; then :
for ac_header in zmq.h sys/wait.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
Expand All @@ -3861,7 +3882,7 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zmq_ctx_new" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zmq_ctx_new" >&5
$as_echo_n "checking for library containing zmq_ctx_new... " >&6; }
if ${ac_cv_search_zmq_ctx_new+:} false; then :
$as_echo_n "(cached) " >&6
Expand Down Expand Up @@ -3920,8 +3941,24 @@ else
fi
else
# User provided path
#user_libs="-L$with_zeromq/lib -lzmq $user_libs"
user_libs="-L$with_zeromq/lib -lzmq -Wl,-rpath=$with_zeromq/lib $user_libs"
user_inc="-I$with_zeromq/include $user_inc"
fi
## OTF2
for ac_header in otf2/otf2.h
# Check whether --with-otf2 was given.
if test "${with_otf2+set}" = set; then :
withval=$with_otf2;
fi
if test "X$with_otf2" = "X"; then
for ac_header in otf2/otf2.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "otf2/otf2.h" "ac_cv_header_otf2_otf2_h" "$ac_includes_default"
if test "x$ac_cv_header_otf2_otf2_h" = xyes; then :
Expand All @@ -3936,7 +3973,7 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing OTF2_Archive_Open" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing OTF2_Archive_Open" >&5
$as_echo_n "checking for library containing OTF2_Archive_Open... " >&6; }
if ${ac_cv_search_OTF2_Archive_Open+:} false; then :
$as_echo_n "(cached) " >&6
Expand Down Expand Up @@ -3994,26 +4031,45 @@ else
as_fn_error $? "Unable to find otf2 libs" "$LINENO" 5
fi
else
# User provided path
#user_libs="-L${with_otf2}/lib -lotf2 ${user_libs}"
user_libs="-Wl,-rpath=$with_otf2/lib -lotf2 $user_libs"
user_inc="-I$with_otf2/include $user_inc"
fi
## PMPMEAS DEPENDENCIES
### PMPMEAS DEPENDENCIES
# Check whether --enable-metrics was given.
if test "${enable_metrics+set}" = set; then :
enableval=$enable_metrics;
fi
if test "$enable_metrics" != no
then
### PAPI - sub-option if metrics enabled
### PAPI - optional if metrics enabled
# Check whether --enable-papi was given.
if test "${enable_papi+set}" = set; then :
enableval=$enable_papi;
fi
# Check whether --with-papi was given.
if test "${with_papi+set}" = set; then :
withval=$with_papi;
fi
if test "X$with_papi" != "Xno"
then
for ac_header in papi.h
### Perf - requirement if metrics enabled
# Check whether --with-perf was given.
if test "${with_perf+set}" = set; then :
withval=$with_perf;
fi
if test "X$enable_metrics" != "Xno"; then
if test "X$enable_papi" != "Xno"; then
if test "X$with_papi" = "X"; then
for ac_header in papi.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "papi.h" "ac_cv_header_papi_h" "$ac_includes_default"
if test "x$ac_cv_header_papi_h" = xyes; then :
Expand All @@ -4028,7 +4084,7 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing PAPI_library_init" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing PAPI_library_init" >&5
$as_echo_n "checking for library containing PAPI_library_init... " >&6; }
if ${ac_cv_search_PAPI_library_init+:} false; then :
$as_echo_n "(cached) " >&6
Expand Down Expand Up @@ -4087,15 +4143,23 @@ else
fi
$as_echo "#define USEPAPI /**/" >>confdefs.h
PAPICNTMAX=$(papi_avail | grep "Number Hardware Counters :" | sed -e "s|Number Hardware Counters : ||")
else
# User provided path
#user_libs="-L$with_papi/lib -lpapi $user_libs"
user_libs="-Wl,-rpath=$with_papi/lib -lpapi $user_libs"
user_inc="-I$with_papi/include $user_inc"
PAPICNTMAX=$($with_papi/bin/papi_avail | grep "Number Hardware Counters :" | sed -e "s|Number Hardware Counters : ||")
fi
PAPICNTMAX=$(papi_avail | grep "Number Hardware Counters :" | sed -e "s|Number Hardware Counters : ||")
$as_echo "#define USEPAPI /**/" >>confdefs.h
fi
### Perf
for ac_header in linux/perf_event.h
if test "X$with_perf" = "X"; then
for ac_header in linux/perf_event.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "linux/perf_event.h" "ac_cv_header_linux_perf_event_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_perf_event_h" = xyes; then :
Expand All @@ -4104,11 +4168,16 @@ if test "x$ac_cv_header_linux_perf_event_h" = xyes; then :
_ACEOF
else
as_fn_error $? "Unable to find perf" "$LINENO" 5
as_fn_error $? "Unable to find linux/perf_event.h" "$LINENO" 5
fi
done
else
#user_libs="-L$with_perf/lib $user_libs"
user_libs="-Wl,-rpath=$with_perf/lib $user_libs"
user_inc="-I$with_perf/include $user_inc"
fi
$as_echo "#define _COLLECT_METRICS /**/" >>confdefs.h
Expand All @@ -4118,6 +4187,11 @@ $as_echo "#define RTRACE_SUPPORT /**/" >>confdefs.h
fi
USER_LIBS="$user_libs"
USER_INC="$user_inc"
## PMPMEAS OBJECTS
# Dynamically generate list of sources from subdirectories via shell
Expand Down
Loading

0 comments on commit ca990c6

Please sign in to comment.