Skip to content

Commit

Permalink
flux: ensure flux_job_timeleft() is available
Browse files Browse the repository at this point in the history
flux_job_timeleft() was introduced in flux-core 0.47.0, so check the
flux-core version in the spec file, and check the function is available
when configure is run.
  • Loading branch information
ofaaland authored and morrone committed Jan 11, 2023
1 parent 4c692b4 commit 4346565
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions config/x_ac_flux_job_timeleft.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
##*****************************************************************************
# SYNOPSIS:
# X_AC_FLUX_JOB_TIMELEFT()
#
# DESCRIPTION:
# Check flux_job_timeleft() is present
##*****************************************************************************

AC_DEFUN([X_AC_FLUX_JOB_TIMELEFT], [
AS_IF([test "$FLUX_LIBADD"],[
AC_MSG_CHECKING([Whether flux_job_timeleft() is present.])
LIBS="$FLUX_LIBS $FLUX_LIBADD $LIBS"
AC_LINK_IFELSE([
AC_LANG_PROGRAM(
[[#include <flux/core.h>]],
[[double tl = flux_job_timeleft(NULL, NULL, NULL);]]
)],
[x_ac_cv_flux_job_timeleft=1],
[x_ac_cv_flux_job_timeleft=0]
)
AS_IF([test "x$x_ac_cv_flux_job_timeleft" = x1],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([flux_job_timeleft() is required. Update to a newer flux or use --without-flux.])
]
)
])
])
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ X_AC_LCRM
X_AC_MOAB
X_AC_LSF
X_AC_FLUX
X_AC_FLUX_JOB_TIMELEFT

aix_64bit_mode=no
using_aix=no
Expand Down
2 changes: 1 addition & 1 deletion libyogrt.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ SLURM plugin for libyogrt
%package flux
Summary: libyogrt plugin for Flux
Group: System Environment/Base
BuildRequires: flux-core
BuildRequires: flux-core >= 0.47.0
Requires: flux-core
Requires: libyogrt = %{version}
%description flux
Expand Down

0 comments on commit 4346565

Please sign in to comment.