1# This file is to be processed with autoconf to generate a configure script 2 3dnl Prologue 4dnl 5 6AC_INIT(slurm, m4_esyscmd([perl -ne 'print,exit if s/^\s*VERSION:\s*(\d*.\d*).\S*/\1/i' ./META | sed 's/^v//' | tr '-' '_' | tr -d '\n']), [], [], [https://slurm.schedmd.com]) 7AC_PREREQ(2.59) 8AC_CONFIG_SRCDIR([configure.ac]) 9AC_CONFIG_AUX_DIR([auxdir]) 10AC_CONFIG_MACRO_DIR([auxdir]) 11AC_CANONICAL_TARGET([]) 12 13dnl the is a generic flag to avoid building things 14AM_CONDITIONAL(DONT_BUILD, test "1" = "0") 15 16# Determine project/version from META file. 17# Sets PACKAGE, VERSION, SLURM_VERSION 18X_AC_SLURM_VERSION 19 20dnl Initialize Automake 21dnl 22dnl If you ever change to use AM_INIT_AUTOMAKE(subdir-objects) edit 23dnl auxdir/slurm.m4 to not define VERSION 24dnl 25AM_INIT_AUTOMAKE(no-define) 26AM_MAINTAINER_MODE 27AC_CONFIG_HEADERS([config.h]) 28AC_CONFIG_HEADERS([slurm/slurm.h]) 29 30X_AC_RPATH 31 32dnl This sets the first compiler to be C instead of C++. 33X_AC_DATABASES 34 35dnl Check to see if this architecture should use slurm_* prefix function 36dnl aliases for plugins. 37dnl 38case "$host" in 39 *darwin*) AC_DEFINE(USE_ALIAS, 0, 40 [Define slurm_ prefix function aliases for plugins]) ;; 41 *) AC_DEFINE(USE_ALIAS, 1, 42 [Define slurm_ prefix function aliases for plugins]) ;; 43esac 44 45dnl Checks for programs. 46dnl 47AC_PROG_CC 48AC_PROG_CXX 49AC_PROG_MAKE_SET 50AC_PROG_LIBTOOL 51PKG_PROG_PKG_CONFIG([0.9.0]) 52 53dnl Find objcopy and setup path 54AC_CHECK_TARGET_TOOL([OBJCOPY], objcopy, [], []) 55 56dnl Silence warning: ar: 'u' modifier ignored since 'D' is the default 57dnl 58AC_SUBST(AR_FLAGS, [cr]) 59 60AM_CONDITIONAL(WITH_CXX, test -n "$ac_ct_CXX") 61AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes") 62 63AC_PATH_PROG([SLEEP_CMD], [sleep], [/bin/sleep]) 64AC_DEFINE_UNQUOTED([SLEEP_CMD], ["$SLEEP_CMD"], [Define path to sleep command]) 65 66AC_PATH_PROG([SUCMD], [su], [/bin/su]) 67AC_DEFINE_UNQUOTED([SUCMD], ["$SUCMD"], [Define path to su command]) 68 69dnl Checks for libraries 70dnl 71AC_SEARCH_LIBS([socket], [socket]) 72AC_SEARCH_LIBS([gethostbyname], [nsl]) 73AC_SEARCH_LIBS([hstrerror], [resolv]) 74AC_SEARCH_LIBS([kstat_open], [kstat]) 75AC_SEARCH_LIBS([ns_initparse], [resolv]) 76 77dnl Checks for header files. 78dnl 79AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \ 80 stdbool.h sys/ipc.h sys/shm.h sys/sem.h errno.h \ 81 stdlib.h dirent.h pthread.h sys/prctl.h \ 82 sysint.h inttypes.h termcap.h netdb.h sys/socket.h \ 83 sys/systemcfg.h sys/dr.h sys/vfs.h \ 84 pam/pam_appl.h security/pam_appl.h sys/sysctl.h \ 85 pty.h utmp.h \ 86 sys/syslog.h linux/sched.h \ 87 kstat.h paths.h limits.h sys/statfs.h sys/ptrace.h \ 88 float.h sys/statvfs.h 89 ) 90AC_HEADER_SYS_WAIT 91AC_HEADER_TIME 92AC_HEADER_STDC 93 94# Workaround for transition of autoconf/glibc issues in deprecation of the 95# definitions major, minor, makedev by sys/types.h vs sys/sysmacros.h 96old_CFLAGS=$CFLAGS 97CFLAGS="$CFLAGS -Werror" 98AC_HEADER_MAJOR 99CFLAGS=$old_CFLAGS 100 101dnl Check for dlfcn 102dnl 103X_AC_DLFCN 104 105dnl check to see if glibc's program_invocation_name is available: 106dnl 107X_AC_SLURM_PROGRAM_INVOCATION_NAME 108 109dnl Check if ptrace takes four or five arguments 110dnl 111X_AC_PTRACE 112 113dnl Check of sched_getaffinity exists and it's argument count 114dnl 115X_AC_AFFINITY 116 117dnl 118dnl Check for PAM module support 119X_AC_PAM 120 121dnl 122dnl Check to see how we link to libslurm 123X_AC_LIBSLURM 124 125dnl 126dnl Check if we want to load .login with sbatch --get-user-env option 127X_AC_ENV_LOGIC 128 129dnl Checks for types. 130dnl 131X_AC_SLURM_BIGENDIAN 132 133dnl Check for C99 compatibility 134dnl 135X_AC_C99 136 137dnl check for presumed size of uid_t and gid_t 138X_AC_UID_GID_SIZE_CHECK 139 140dnl Check for JSON parser 141X_AC_JSON 142 143dnl Check for JWT library 144X_AC_JWT 145 146dnl Check for HTTP parser 147X_AC_HTTP_PARSER 148 149dnl Check for yaml parser 150X_AC_YAML 151 152dnl Checks for compiler characteristics. 153dnl 154AC_PROG_GCC_TRADITIONAL([]) 155 156AX_GCC_BUILTIN(__builtin_clzll) 157AX_GCC_BUILTIN(__builtin_ctzll) 158AX_GCC_BUILTIN(__builtin_popcountll) 159 160 161dnl checks for library functions. 162dnl 163AC_FUNC_STRERROR_R 164AC_CHECK_FUNCS( \ 165 fdatasync \ 166 hstrerror \ 167 strerror \ 168 mtrace \ 169 strndup \ 170 strlcpy \ 171 strsignal \ 172 inet_aton \ 173 inet_ntop \ 174 inet_pton \ 175 setproctitle \ 176 sysctlbyname \ 177 cfmakeraw \ 178 setresuid \ 179 get_current_dir_name \ 180 faccessat \ 181 eaccess \ 182 statvfs \ 183 statfs \ 184 memfd_create \ 185) 186 187AC_CHECK_DECLS([hstrerror, strsignal, sys_siglist]) 188 189dnl Skip pthread checks on macOS as support is always enabled, 190dnl and ACX_PTHREAD will inject flags that will throw spurious warnings. 191case "$host" in 192*-darwin*) 193 ;; 194*) 195 ACX_PTHREAD([], AC_MSG_ERROR([Error: Cannot figure out how to use pthreads!])) 196 ;; 197esac 198 199LDFLAGS="$LDFLAGS " 200CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 201LIBS="$PTHREAD_LIBS $LIBS" 202 203X_AC_DIMENSIONS 204 205X_AC_OFED 206 207AX_LIB_HDF5() 208AM_CONDITIONAL(BUILD_HDF5, test "$with_hdf5" = "yes") 209# Some older systems (Debian/Ubuntu/...) configure HDF5 with 210# --with-default-api-version=v16 which creates problems for slurm 211# because slurm uses the 1.8 API. By defining this CPP macro we get 212# the 1.8 API. 213AC_DEFINE([H5_NO_DEPRECATED_SYMBOLS], [1], [Make sure we get the 1.8 HDF5 API]) 214 215AX_CHECK_ZLIB([], []) 216X_AC_LZ4 217X_AC_HWLOC 218X_AC_NVML 219X_AC_RSMI 220X_AC_PMIX 221X_AC_FREEIPMI 222X_AC_RRDTOOL 223X_AC_UCX 224X_AC_X11 225 226X_AC_CGROUP 227 228# 229# Tests for Check 230# 231 232PKG_CHECK_MODULES([CHECK], [check >= 0.9.8], [ac_have_check="yes"], [ac_have_check="no"]) 233AM_CONDITIONAL(HAVE_CHECK, test "x$ac_have_check" = "xyes") 234 235# 236# Tests for GTK+ 237# 238 239# use the correct libs if running on 64bit 240if test -d "/usr/lib64/pkgconfig"; then 241 PKG_CONFIG_PATH="/usr/lib64/pkgconfig/:$PKG_CONFIG_PATH" 242fi 243 244if test -d "/opt/gnome/lib64/pkgconfig"; then 245 PKG_CONFIG_PATH="/opt/gnome/lib64/pkgconfig/:$PKG_CONFIG_PATH" 246fi 247 248AM_PATH_GLIB_2_0([2.7.1], [ac_glib_test="yes"], [ac_glib_test="no"], [gthread]) 249 250if test ${glib_config_minor_version=0} -ge 32 ; then 251 AC_DEFINE([GLIB_NEW_THREADS], 1, [Define to 1 if using glib-2.32.0 or higher]) 252fi 253 254AM_PATH_GTK_2_0([2.7.1], [ac_gtk_test="yes"], [ac_gtk_test="no"], [gthread]) 255if test ${gtk_config_minor_version=0} -ge 10 ; then 256 AC_DEFINE([GTK2_USE_RADIO_SET], 1, [Define to 1 if using gtk+-2.10.0 or higher]) 257fi 258 259if test ${gtk_config_minor_version=0} -ge 12 ; then 260 AC_DEFINE([GTK2_USE_TOOLTIP], 1, [Define to 1 if using gtk+-2.12.0 or higher]) 261fi 262 263if test ${gtk_config_minor_version=0} -ge 14 ; then 264 AC_DEFINE([GTK2_USE_GET_FOCUS], 1, [Define to 1 if using gtk+-2.14.0 or higher]) 265fi 266 267if test "x$ac_glib_test" != "xyes" -o "x$ac_gtk_test" != "xyes"; then 268 AC_MSG_WARN([cannot build sview without gtk library]); 269fi 270 271AM_CONDITIONAL(BUILD_SVIEW, [test "x$ac_glib_test" = "xyes"] && [test "x$ac_gtk_test" = "xyes"]) 272 273X_AC_CRAY 274 275dnl checks for system services. 276dnl 277 278 279dnl checks for system-specific stuff. 280dnl 281 282dnl check for how to emulate setproctitle 283dnl 284X_AC_SETPROCTITLE 285 286dnl check for debug compilation, must follow X_AC_CRAY 287dnl 288X_AC_DEBUG 289 290dnl check for slurmctld, slurmd and slurmdbd default ports, 291dnl and default number of slurmctld ports 292dnl 293X_AC_SLURM_PORTS([6817], [6818], [6819], [1]) 294 295 296dnl add SLURM_PREFIX to config.h 297dnl 298if test "x$prefix" = "xNONE" ; then 299 AC_DEFINE_UNQUOTED(SLURM_PREFIX, "/usr/local", [Define Slurm installation prefix]) 300else 301 AC_DEFINE_UNQUOTED(SLURM_PREFIX, "$prefix", [Define Slurm installation prefix]) 302fi 303AC_SUBST(SLURM_PREFIX) 304 305X_AC_SLURMRESTD([6820]) 306 307dnl check for netloc library 308dnl 309X_AC_NETLOC 310 311dnl check for lua library 312dnl 313X_AC_LUA 314 315dnl check for presence of the man2html command 316dnl 317X_AC_MAN2HTML 318AM_CONDITIONAL(HAVE_MAN2HTML, test "x$ac_have_man2html" = "xyes") 319AC_SUBST(HAVE_MAN2HTML) 320 321 322dnl check if we can use standard printf functions 323dnl 324X_AC_PRINTF_NULL 325 326dnl Check for whether to include readline support 327dnl 328X_AC_READLINE 329 330dnl 331dnl Check for systemd presence, version and system unit dir 332dnl 333X_AC_SYSTEMD 334 335dnl 336dnl Check for compilation of Slurm auth modules: 337dnl 338X_AC_MUNGE 339 340dnl 341dnl Check if multiple-slurmd support is requested and define MULTIPLE_SLURMD 342dnl if it is. 343dnl 344AC_MSG_CHECKING(whether to enable multiple-slurmd support) 345AC_ARG_ENABLE([multiple-slurmd], 346 AS_HELP_STRING(--enable-multiple-slurmd,enable multiple-slurmd support), 347 [ case "$enableval" in 348 yes) multiple_slurmd=yes ;; 349 no) multiple_slurmd=no ;; 350 *) AC_MSG_ERROR([bad value "$enableval" for --enable-multiple-slurmd]);; 351 esac ] 352) 353if test "x$multiple_slurmd" = "xyes"; then 354 AC_DEFINE([MULTIPLE_SLURMD], [1], [Enable multiple slurmd on one node]) 355 AC_MSG_RESULT([yes]) 356else 357 AC_MSG_RESULT([no]) 358fi 359 360savedLIBS="$LIBS" 361LIBS="-lutil $LIBS" 362AC_CHECK_LIB(util, openpty, [UTIL_LIBS="-lutil"], []) 363AC_SUBST(UTIL_LIBS) 364LIBS="$savedLIBS" 365 366dnl 367dnl Check for compilation of Slurm with CURL support: 368dnl 369LIBCURL_CHECK_CONFIG 370 371dnl Check word size so we can deprecate 32-bit systems 372AC_CHECK_SIZEOF([void *], 8) 373 374dnl This needs to come last so it can detect deprecated options in use. 375X_AC_DEPRECATED 376 377dnl All slurm Makefiles: 378 379AC_CONFIG_FILES([Makefile 380 auxdir/Makefile 381 contribs/Makefile 382 contribs/cray/Makefile 383 contribs/cray/csm/Makefile 384 contribs/cray/slurmsmwd/Makefile 385 contribs/lua/Makefile 386 contribs/mic/Makefile 387 contribs/nss_slurm/Makefile 388 contribs/pam/Makefile 389 contribs/pam_slurm_adopt/Makefile 390 contribs/perlapi/Makefile 391 contribs/perlapi/libslurm/Makefile 392 contribs/perlapi/libslurm/perl/Makefile.PL 393 contribs/perlapi/libslurmdb/Makefile 394 contribs/perlapi/libslurmdb/perl/Makefile.PL 395 contribs/seff/Makefile 396 contribs/torque/Makefile 397 contribs/openlava/Makefile 398 contribs/sgather/Makefile 399 contribs/sgi/Makefile 400 contribs/sjobexit/Makefile 401 contribs/pmi/Makefile 402 contribs/pmi2/Makefile 403 doc/Makefile 404 doc/man/Makefile 405 doc/man/man1/Makefile 406 doc/man/man3/Makefile 407 doc/man/man5/Makefile 408 doc/man/man8/Makefile 409 doc/html/Makefile 410 doc/html/configurator.html 411 doc/html/configurator.easy.html 412 etc/Makefile 413 src/Makefile 414 src/api/Makefile 415 src/bcast/Makefile 416 src/common/Makefile 417 src/database/Makefile 418 src/layouts/Makefile 419 src/layouts/power/Makefile 420 src/layouts/unit/Makefile 421 src/lua/Makefile 422 src/sacct/Makefile 423 src/sacctmgr/Makefile 424 src/sreport/Makefile 425 src/salloc/Makefile 426 src/sbatch/Makefile 427 src/sbcast/Makefile 428 src/sattach/Makefile 429 src/scancel/Makefile 430 src/scontrol/Makefile 431 src/sdiag/Makefile 432 src/sinfo/Makefile 433 src/slurmctld/Makefile 434 src/slurmd/Makefile 435 src/slurmd/common/Makefile 436 src/slurmd/slurmd/Makefile 437 src/slurmd/slurmstepd/Makefile 438 src/slurmdbd/Makefile 439 src/slurmrestd/Makefile 440 src/slurmrestd/ops/Makefile 441 src/sprio/Makefile 442 src/squeue/Makefile 443 src/srun/Makefile 444 src/srun/libsrun/Makefile 445 src/sshare/Makefile 446 src/sstat/Makefile 447 src/strigger/Makefile 448 src/sview/Makefile 449 src/plugins/Makefile 450 src/plugins/accounting_storage/Makefile 451 src/plugins/accounting_storage/common/Makefile 452 src/plugins/accounting_storage/filetxt/Makefile 453 src/plugins/accounting_storage/mysql/Makefile 454 src/plugins/accounting_storage/none/Makefile 455 src/plugins/accounting_storage/slurmdbd/Makefile 456 src/plugins/acct_gather_energy/Makefile 457 src/plugins/acct_gather_energy/cray_aries/Makefile 458 src/plugins/acct_gather_energy/ibmaem/Makefile 459 src/plugins/acct_gather_energy/ipmi/Makefile 460 src/plugins/acct_gather_energy/none/Makefile 461 src/plugins/acct_gather_energy/rapl/Makefile 462 src/plugins/acct_gather_energy/rsmi/Makefile 463 src/plugins/acct_gather_energy/xcc/Makefile 464 src/plugins/acct_gather_interconnect/Makefile 465 src/plugins/acct_gather_interconnect/ofed/Makefile 466 src/plugins/acct_gather_interconnect/none/Makefile 467 src/plugins/acct_gather_filesystem/Makefile 468 src/plugins/acct_gather_filesystem/lustre/Makefile 469 src/plugins/acct_gather_filesystem/none/Makefile 470 src/plugins/acct_gather_profile/Makefile 471 src/plugins/acct_gather_profile/hdf5/Makefile 472 src/plugins/acct_gather_profile/hdf5/sh5util/Makefile 473 src/plugins/acct_gather_profile/influxdb/Makefile 474 src/plugins/acct_gather_profile/none/Makefile 475 src/plugins/auth/Makefile 476 src/plugins/auth/jwt/Makefile 477 src/plugins/auth/munge/Makefile 478 src/plugins/auth/none/Makefile 479 src/plugins/burst_buffer/Makefile 480 src/plugins/burst_buffer/common/Makefile 481 src/plugins/burst_buffer/datawarp/Makefile 482 src/plugins/burst_buffer/generic/Makefile 483 src/plugins/cli_filter/Makefile 484 src/plugins/cli_filter/common/Makefile 485 src/plugins/cli_filter/lua/Makefile 486 src/plugins/cli_filter/none/Makefile 487 src/plugins/cli_filter/syslog/Makefile 488 src/plugins/cli_filter/user_defaults/Makefile 489 src/plugins/core_spec/Makefile 490 src/plugins/core_spec/cray_aries/Makefile 491 src/plugins/core_spec/none/Makefile 492 src/plugins/cred/Makefile 493 src/plugins/cred/munge/Makefile 494 src/plugins/cred/none/Makefile 495 src/plugins/ext_sensors/Makefile 496 src/plugins/ext_sensors/rrd/Makefile 497 src/plugins/ext_sensors/none/Makefile 498 src/plugins/gpu/Makefile 499 src/plugins/gpu/generic/Makefile 500 src/plugins/gpu/nvml/Makefile 501 src/plugins/gpu/rsmi/Makefile 502 src/plugins/gres/Makefile 503 src/plugins/gres/common/Makefile 504 src/plugins/gres/gpu/Makefile 505 src/plugins/gres/nic/Makefile 506 src/plugins/gres/mic/Makefile 507 src/plugins/gres/mps/Makefile 508 src/plugins/jobacct_gather/Makefile 509 src/plugins/jobacct_gather/common/Makefile 510 src/plugins/jobacct_gather/linux/Makefile 511 src/plugins/jobacct_gather/cgroup/Makefile 512 src/plugins/jobacct_gather/none/Makefile 513 src/plugins/jobcomp/Makefile 514 src/plugins/jobcomp/elasticsearch/Makefile 515 src/plugins/jobcomp/filetxt/Makefile 516 src/plugins/jobcomp/lua/Makefile 517 src/plugins/jobcomp/none/Makefile 518 src/plugins/jobcomp/script/Makefile 519 src/plugins/jobcomp/mysql/Makefile 520 src/plugins/job_container/Makefile 521 src/plugins/job_container/cncu/Makefile 522 src/plugins/job_container/none/Makefile 523 src/plugins/job_submit/Makefile 524 src/plugins/job_submit/all_partitions/Makefile 525 src/plugins/job_submit/cray_aries/Makefile 526 src/plugins/job_submit/defaults/Makefile 527 src/plugins/job_submit/logging/Makefile 528 src/plugins/job_submit/lua/Makefile 529 src/plugins/job_submit/partition/Makefile 530 src/plugins/job_submit/pbs/Makefile 531 src/plugins/job_submit/require_timelimit/Makefile 532 src/plugins/job_submit/throttle/Makefile 533 src/plugins/launch/Makefile 534 src/plugins/launch/slurm/Makefile 535 src/plugins/mcs/Makefile 536 src/plugins/mcs/account/Makefile 537 src/plugins/mcs/group/Makefile 538 src/plugins/mcs/none/Makefile 539 src/plugins/mcs/user/Makefile 540 src/plugins/node_features/Makefile 541 src/plugins/node_features/knl_cray/Makefile 542 src/plugins/node_features/knl_generic/Makefile 543 src/plugins/power/Makefile 544 src/plugins/power/common/Makefile 545 src/plugins/power/cray_aries/Makefile 546 src/plugins/power/none/Makefile 547 src/plugins/preempt/Makefile 548 src/plugins/preempt/none/Makefile 549 src/plugins/preempt/partition_prio/Makefile 550 src/plugins/preempt/qos/Makefile 551 src/plugins/priority/Makefile 552 src/plugins/priority/basic/Makefile 553 src/plugins/priority/multifactor/Makefile 554 src/plugins/prep/Makefile 555 src/plugins/prep/script/Makefile 556 src/plugins/proctrack/Makefile 557 src/plugins/proctrack/cray_aries/Makefile 558 src/plugins/proctrack/cgroup/Makefile 559 src/plugins/proctrack/pgid/Makefile 560 src/plugins/proctrack/linuxproc/Makefile 561 src/plugins/route/Makefile 562 src/plugins/route/default/Makefile 563 src/plugins/route/topology/Makefile 564 src/plugins/sched/Makefile 565 src/plugins/sched/backfill/Makefile 566 src/plugins/sched/builtin/Makefile 567 src/plugins/sched/hold/Makefile 568 src/plugins/select/Makefile 569 src/plugins/select/cons_common/Makefile 570 src/plugins/select/cons_res/Makefile 571 src/plugins/select/cons_tres/Makefile 572 src/plugins/select/cray_aries/Makefile 573 src/plugins/select/linear/Makefile 574 src/plugins/select/other/Makefile 575 src/plugins/site_factor/Makefile 576 src/plugins/site_factor/none/Makefile 577 src/plugins/slurmctld/Makefile 578 src/plugins/slurmctld/nonstop/Makefile 579 src/plugins/switch/Makefile 580 src/plugins/switch/cray_aries/Makefile 581 src/plugins/switch/generic/Makefile 582 src/plugins/switch/none/Makefile 583 src/plugins/mpi/Makefile 584 src/plugins/mpi/cray_shasta/Makefile 585 src/plugins/mpi/none/Makefile 586 src/plugins/mpi/pmi2/Makefile 587 src/plugins/mpi/pmix/Makefile 588 src/plugins/task/Makefile 589 src/plugins/task/affinity/Makefile 590 src/plugins/task/cgroup/Makefile 591 src/plugins/task/cray_aries/Makefile 592 src/plugins/task/none/Makefile 593 src/plugins/topology/Makefile 594 src/plugins/topology/3d_torus/Makefile 595 src/plugins/topology/hypercube/Makefile 596 src/plugins/topology/node_rank/Makefile 597 src/plugins/topology/none/Makefile 598 src/plugins/topology/tree/Makefile 599 testsuite/Makefile 600 testsuite/expect/Makefile 601 testsuite/slurm_unit/Makefile 602 testsuite/slurm_unit/api/Makefile 603 testsuite/slurm_unit/api/manual/Makefile 604 testsuite/slurm_unit/common/Makefile 605 testsuite/slurm_unit/common/slurm_protocol_pack/Makefile 606 testsuite/slurm_unit/common/slurmdb_pack/Makefile 607 testsuite/slurm_unit/common/bitstring/Makefile 608 testsuite/slurm_unit/slurmd/Makefile 609 testsuite/slurm_unit/slurmd/common/Makefile 610 ] 611) 612 613AC_OUTPUT 614