Skip to content

Commit 9f4cecd

Browse files
committed
Merge branch 'ckelly_develop' of https://github.com/CODARcode/PerformanceAnalysis into ckelly_develop
2 parents ef4f678 + 3cb31c0 commit 9f4cecd

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

configure.ac

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,45 @@ AC_PROG_CXX
66
AM_PROG_AR
77
LT_INIT
88

9+
#Enable pkg-config
10+
AC_ARG_WITH([pkg-config], AS_HELP_STRING([--with-pkg-config], [Use pkg-config to determine configuration of some dependencies]),[use_pkgconfig="yes"],[use_pkgconfig="no"])
11+
12+
#Check if pkg-config is installed
13+
no_pkgconfig=1
14+
if test "x$use_pkgconfig" != "xno"; then
15+
no_pkgconfig=$(echo $(pkg-config 2>&1) | grep -c "not found")
16+
if [[ "${no_pkgconfig}" -eq 0 ]]; then
17+
AC_MSG_NOTICE([pkg-config was detected])
18+
fi
19+
fi
20+
21+
#spdlog propagates its compile flags through cmake targets and pkg-config but doesn't for autotools
22+
#thus if pkg-config is available we try to get the flags there
23+
if [[ "${no_pkgconfig}" -eq 0 ]]; then
24+
SPDLOG_CFLAGS=$(pkg-config --cflags spdlog 2>&1)
25+
if [[ $(echo ${SPDLOG_CFLAGS} | grep -c "not found") -eq 1 ]]; then
26+
AC_MSG_FAILURE(["Cannot find spdlog configuration with pkg-config"])
27+
fi
28+
CXXFLAGS+=" ${SPDLOG_CFLAGS} "
29+
SPDLOG_LDFLAGS=$(pkg-config --libs spdlog 2>&1)
30+
LDFLAGS+=" ${SPDLOG_LDFLAGS} "
31+
AC_MSG_NOTICE([Retrieved configuration for spdlog from pkg-config])
32+
fi
33+
34+
#on the IC the incorrect build of zmq is being used despite spack. Here we explicitly set the paths using pkg-config
35+
if [[ "${no_pkgconfig}" -eq 0 ]]; then
36+
ZMQ_CFLAGS=$(pkg-config --cflags libzmq 2>&1)
37+
if [[ $(echo ${ZMQ_CFLAGS} | grep -c "not found") -eq 1 ]]; then
38+
AC_MSG_FAILURE(["Cannot find libzmq configuration with pkg-config"])
39+
fi
40+
CXXFLAGS+=" ${ZMQ_CFLAGS} "
41+
ZMQ_LDFLAGS=$(pkg-config --libs libzmq 2>&1)
42+
LDFLAGS+=" ${ZMQ_LDFLAGS} "
43+
AC_MSG_NOTICE([Retrieved configuration for libzmq from pkg-config])
44+
fi
45+
46+
47+
948
# Check if compiling to generate a coverage report using gcov
1049
# Once built, run the tests in the install/test directory, then from the build directory run
1150
#(pip3 install gcovr)
@@ -172,7 +211,6 @@ if test "x$with_boost" != "x"; then
172211
fi
173212
AC_CHECK_HEADERS([boost/math/distributions/normal.hpp], [], [AC_MSG_ERROR(Boost library is required)])
174213

175-
176214
AC_CONFIG_HEADERS([chimbuko_config.h])
177215
AC_SUBST([PS_FLAGS])
178216

spack/repo/chimbuko/packages/chimbuko-performance-analysis/package.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class ChimbukoPerformanceAnalysis(AutotoolsPackage):
1818

1919
variant('perf-metric', default=True, description='Build with performance monitoring')
2020
variant('mpi', default=True, description='Enable building Chimbuko with MPI. If disabled the user must manually provide the rank index to the OAD.')
21-
21+
variant('pkg-config', default=True, description='Enable the configuration script to use pkg-config to aid in the configuration of dependencies')
22+
2223
depends_on('mpi', when="+mpi")
2324
depends_on('cereal')
2425
depends_on('adios2')
@@ -32,6 +33,7 @@ class ChimbukoPerformanceAnalysis(AutotoolsPackage):
3233
depends_on('automake', type='build')
3334
depends_on('libtool', type='build')
3435
depends_on('m4', type='build')
36+
depends_on('pkgconfig', when='+pkg-config', type='build')
3537

3638

3739
def setup_build_environment(self, env):
@@ -45,5 +47,8 @@ def configure_args(self):
4547
args.append('--with-perf-metric')
4648
if '+mpi' not in self.spec:
4749
args.append('--disable-mpi')
50+
if '+pkg-config' in self.spec:
51+
args.append('--with-pkg-config')
52+
4853

4954
return args

0 commit comments

Comments
 (0)