@@ -102,6 +102,15 @@ case "$host_cpu" in
102102 x86_64|i?86) is_x86=true ;;
103103esac
104104
105+ likwid=false
106+ dcgm_checked=false
107+ CPU_COUNTER_BACKEND_CPPFLAG=""
108+ MONITOR_ARCH_CPPFLAG=""
109+
110+ if test "x$hardware" != "xtrue"; then
111+ cpu_counter_backend="none"
112+ AC_MSG_NOTICE ( [ CPU counter backend: disabled (--disable-hardware)] )
113+ else
105114if test "x$cpu_counter_backend" = "xauto"; then
106115 if test "x$is_x86" = "xtrue"; then
107116 cpu_counter_backend="likwid"
@@ -139,11 +148,7 @@ if test "x$cpu_counter_backend" = "xlikwid"; then
139148 esac
140149 fi
141150fi
142- AM_CONDITIONAL([ LIKWID] , [ test x$likwid = xtrue] )
143- AM_CONDITIONAL([ CPU_BACKEND_LIKWID] , [ test x$cpu_counter_backend = xlikwid] )
144- AM_CONDITIONAL([ CPU_BACKEND_DCGM] , [ test x$cpu_counter_backend = xdcgm] )
145151
146- dcgm_checked=false
147152if test "x$cpu_counter_backend" = "xdcgm"; then
148153 if test "x$enable_all_static" = xyes; then
149154 save_LIBS=$LIBS
@@ -168,9 +173,14 @@ if test "x$cpu_counter_backend" = "xdcgm"; then
168173 dcgm_checked=true
169174 CPU_COUNTER_BACKEND_CPPFLAG="-DMONITOR_CPU_BACKEND_DCGM"
170175 MONITOR_ARCH_CPPFLAG=""
171- else
176+ elif test "x$cpu_counter_backend" = "xlikwid"; then
172177 CPU_COUNTER_BACKEND_CPPFLAG="-DMONITOR_CPU_BACKEND_LIKWID"
173178fi
179+
180+ if test "x$hardware" = "xtrue"; then
181+ AC_MSG_NOTICE ( [ CPU counter backend: ${cpu_counter_backend} (host_cpu=${host_cpu})] )
182+ fi
183+ fi
174184AC_SUBST ( [ CPU_COUNTER_BACKEND_CPPFLAG] )
175185
176186AC_ARG_WITH ( [ monitor-arch] ,
@@ -207,7 +217,11 @@ case "$host_cpu" in
207217esac
208218AM_CONDITIONAL([ MONITOR_ARCH_ARM] , [ test x$monitor_arch_arm = xtrue] )
209219
210- AC_MSG_NOTICE ( [ CPU counter backend: ${cpu_counter_backend} (host_cpu=${host_cpu})] )
220+ AM_CONDITIONAL([ LIKWID] , [ test x$likwid = xtrue] )
221+ AM_CONDITIONAL([ CPU_BACKEND_LIKWID] ,
222+ [ test x$hardware = xtrue -a x$cpu_counter_backend = xlikwid] )
223+ AM_CONDITIONAL([ CPU_BACKEND_DCGM] ,
224+ [ test x$hardware = xtrue -a x$cpu_counter_backend = xdcgm] )
211225
212226AC_ARG_ENABLE ( [ infiniband] ,
213227[ --enable-infiniband Enable Infiniband support (default is true)] ,
@@ -432,6 +446,30 @@ AS_IF([test "x$with_systemduserunitdir" != "xno"],
432446 [ AC_SUBST ( [ systemduserunitdir] , [ $with_systemduserunitdir] ) ] )
433447AM_CONDITIONAL([ HAVE_SYSTEMD] , [ test "x$with_systemduserunitdir" != "xno"] )
434448
449+ MONITOR_FEATURE_CPPFLAGS=""
450+ if test "x$hardware" = "xtrue"; then
451+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_WITH_HARDWARE"
452+ fi
453+ if test "x$infiniband" = "xtrue"; then
454+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_WITH_INFINIBAND"
455+ fi
456+ if test "x$lustre" = "xtrue"; then
457+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_WITH_LUSTRE"
458+ fi
459+ if test "x$gpu" = "xtrue"; then
460+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_WITH_GPU"
461+ fi
462+ if test "x$amd_gpu" = "xtrue"; then
463+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_WITH_AMD_GPU"
464+ fi
465+ if test "x$opa" = "xtrue"; then
466+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_WITH_OPA"
467+ fi
468+ if test "x$monitor_arch_arm" = "xtrue"; then
469+ MONITOR_FEATURE_CPPFLAGS="$MONITOR_FEATURE_CPPFLAGS -DMONITOR_HOST_IS_ARM"
470+ fi
471+ AC_SUBST ( [ MONITOR_FEATURE_CPPFLAGS] )
472+
435473AC_CONFIG_FILES ( [ Makefile src/Makefile tests/Makefile] )
436474AC_OUTPUT
437475
0 commit comments