diff --git a/auxdir/x_ac_ncurses.m4 b/auxdir/x_ac_ncurses.m4 index 11bea086bb92631f16601fd90895dfac0746f9bc..c647bdb538f9188200891f33016ef0e9d1aedbec 100644 --- a/auxdir/x_ac_ncurses.m4 +++ b/auxdir/x_ac_ncurses.m4 @@ -24,9 +24,12 @@ AC_DEFUN([X_AC_NCURSES], AC_SUBST(NCURSES) if test "$ac_have_ncurses" = "yes"; then NCURSES="-lncurses" + ac_have_some_curses="yes" elif test "$ac_have_curses" = "yes"; then NCURSES="-lcurses" + ac_have_some_curses="yes" else - AC_MSG_ERROR([Can not find curses or ncurses library.]) + AC_MSG_NOTICE([Can not build smap without curses or ncurses library]) + ac_have_some_curses="no" fi ]) diff --git a/configure.ac b/configure.ac index 0aee2cafb281904d63c6f10b87bca234a7630649..b535440abd851b0ad9e77b98b5c716ffafadf8ae 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \ stdbool.h sys/ipc.h sys/shm.h sys/sem.h errno.h \ stdlib.h dirent.h pthread.h sys/prctl.h \ sysint.h inttypes.h termcap.h netdb.h sys/socket.h \ - sys/systemcfg.h ncurses.h curses.h\ + sys/systemcfg.h ncurses.h curses.h \ ) AC_HEADER_SYS_WAIT AC_HEADER_TIME @@ -103,7 +103,10 @@ LIBS="$PTHREAD_LIBS $LIBS" X_AC_BGL X_AC_SLURM_SEMAPHORE + X_AC_NCURSES +AM_CONDITIONAL(HAVE_SOME_CURSES, test "x$ac_have_some_curses" = "xyes") +AC_SUBST(HAVE_SOME_CURSES) dnl checks for system services. dnl diff --git a/slurm.spec.in b/slurm.spec.in index 7cabe7a6eca4187603161fd1121f0f92cb627c89..efd32d6587da050c4a4fd9a3f394a9a98a5f43d6 100644 --- a/slurm.spec.in +++ b/slurm.spec.in @@ -173,12 +173,7 @@ rm -rf $RPM_BUILD_ROOT %doc COPYING %doc etc/slurm.conf.example %doc doc/html -%{_bindir}/scancel -%{_bindir}/scontrol -%{_bindir}/sinfo -%{_bindir}/smap -%{_bindir}/squeue -%{_bindir}/srun +%{_bindir}/* %{_sbindir}/slurmctld %{_sbindir}/slurmd %{_libdir}/*.so* diff --git a/src/partition_allocator/partition_allocator.h b/src/partition_allocator/partition_allocator.h index 5b2f306ea4823a91518913f43cdacf51e2cd96cb..de9f09b2c6495a5cae1f5de575f26bce2ac216c5 100644 --- a/src/partition_allocator/partition_allocator.h +++ b/src/partition_allocator/partition_allocator.h @@ -29,7 +29,21 @@ /* This must be included first for AIX systems */ #include "src/common/macros.h" -#include <curses.h> +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif + +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#if HAVE_CURSES_H +# include <curses.h> +#endif +#if HAVE_NCURSES_H +# include <ncurses.h> +#endif + #include "src/api/node_select_info.h" #include "src/common/read_config.h" #include "src/common/parse_spec.h" diff --git a/src/plugins/select/bluegene/bluegene.h b/src/plugins/select/bluegene/bluegene.h index fbcb33e11370a4ec854b22bffe36fb07d2d97888..ab8f9e68184e2d2cba8a328156c44d76a5759616 100644 --- a/src/plugins/select/bluegene/bluegene.h +++ b/src/plugins/select/bluegene/bluegene.h @@ -1,7 +1,7 @@ /*****************************************************************************\ * bluegene.h - header for blue gene configuration processing module. * - * $Id$ + * $Id$ ***************************************************************************** * Copyright (C) 2004 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -42,13 +42,7 @@ #include "src/common/macros.h" #include "src/slurmctld/slurmctld.h" #include "src/partition_allocator/partition_allocator.h" - -#ifdef HAVE_BGL_FILES -# include "src/plugins/select/bluegene/wrap_rm_api.h" - -#else -# include "src/smap/smap.h" -#endif +#include "src/plugins/select/bluegene/wrap_rm_api.h" #define USER_NAME "slurm" diff --git a/src/plugins/select/bluegene/wrap_rm_api.h b/src/plugins/select/bluegene/wrap_rm_api.h index 4d92a7fbec8410220affd6f52e6d3fb7374bac92..1338bae609fd4cac3e73f4bc2485199418b99c15 100644 --- a/src/plugins/select/bluegene/wrap_rm_api.h +++ b/src/plugins/select/bluegene/wrap_rm_api.h @@ -3,19 +3,58 @@ #ifndef ATTACH_BGL_H #define ATTACH_BGL_H -/* Over-ride attach_bgl.h inclusion due to problems in compiling it - * with gcc and missing externals in that file */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_BGL_FILES + /* Over-ride attach_bgl.h inclusion due to problems in compiling it + * with gcc and missing externals in that file */ + + /* MPI Debug support */ -/* MPI Debug support */ + typedef struct { + const char * host_name; /* Something we can pass to inet_addr */ + const char * executable_name; /* The name of the image */ + int pid; /* The pid of the process */ + } MPIR_PROCDESC; -typedef struct { - const char * host_name; /* Something we can pass to inet_addr */ - const char * executable_name; /* The name of the image */ - int pid; /* The pid of the process */ -} MPIR_PROCDESC; +# include "rm_api.h" +#else + typedef char * pm_partition_id_t; + typedef int rm_connection_type_t; + typedef int rm_partition_mode_t; + typedef int rm_partition_state_t; + typedef uint16_t rm_partition_t; + typedef char * rm_BGL_t; + typedef char * rm_component_id_t; + typedef rm_component_id_t rm_bp_id_t; + typedef int rm_BP_state_t; + /* these are the typedefs that we will need to have + * if we want the states on the Front End Node of a BGL system + * make certain they match the rm_api.h values on the Service Node */ + enum rm_partition_state {RM_PARTITION_FREE, + RM_PARTITION_CONFIGURING, + RM_PARTITION_READY, + RM_PARTITION_BUSY, + RM_PARTITION_DEALLOCATING, + RM_PARTITION_ERROR, + RM_PARTITION_NAV}; + typedef enum status {STATUS_OK = 0, + PARTITION_NOT_FOUND = -1, + JOB_NOT_FOUND = -2, + BP_NOT_FOUND = -3, + SWITCH_NOT_FOUND = -4, + JOB_ALREADY_DEFINED=-5, + CONNECTION_ERROR=-10, + INTERNAL_ERROR = -11, + INVALID_INPUT=-12, + INCOMPATIBLE_STATE=-13, + INCONSISTENT_DATA=-14 + }status_t; + +#endif -#include "rm_api.h" - #endif diff --git a/src/smap/Makefile.am b/src/smap/Makefile.am index 6df9d0b8c3ae16bd0196ec64b4d662790e73b77c..2d42391d7f9d15128a084f466cb537cde24c1bb9 100644 --- a/src/smap/Makefile.am +++ b/src/smap/Makefile.am @@ -1,18 +1,26 @@ # $Id$ # # Makefile for smap +# NOTE: smap is only built and installed if HAVE_SOME_CURSES is set. +# That means we have either curses or ncurses installed. +# AUTOMAKE_OPTIONS = foreign LIBS=$(NCURSES) INCLUDES = -I$(top_srcdir) $(BGL_INCLUDES) + +if HAVE_SOME_CURSES + bin_PROGRAMS = smap smap_LDADD = \ $(top_builddir)/src/partition_allocator/libpartition_allocator.la noinst_HEADERS = smap.h -smap_SOURCES = smap.c job_functions.c partition_functions.c configure_functions.c grid_functions.c opts.c +smap_SOURCES = smap.c \ + job_functions.c partition_functions.c \ + configure_functions.c grid_functions.c opts.c force: $(smap_LDADD) : force @@ -20,3 +28,12 @@ $(smap_LDADD) : force smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(BGL_LDFLAGS) +else + +EXTRA_smap_SOURCES = smap.h smap.c \ + job_functions.c partition_functions.c \ + configure_functions.c grid_functions.c opts.c + +endif + + diff --git a/src/smap/smap.h b/src/smap/smap.h index 03f200875f0da13065861dfe1057bf3a95ded142..d24185c1aefda1b93382cc2f414ac88e0b6d21f5 100644 --- a/src/smap/smap.h +++ b/src/smap/smap.h @@ -60,49 +60,14 @@ #include "src/common/hostlist.h" #include "src/common/list.h" #include "src/common/macros.h" -//#include "src/slurmctld/slurmctld.h" #include "src/partition_allocator/partition_allocator.h" #include "src/common/slurm_protocol_api.h" -#ifdef HAVE_BGL_FILES -# include "src/plugins/select/bluegene/wrap_rm_api.h" -#else - typedef char * pm_partition_id_t; - typedef int rm_connection_type_t; - typedef int rm_partition_mode_t; - typedef int rm_partition_state_t; - typedef uint16_t rm_partition_t; - typedef char * rm_BGL_t; - typedef char * rm_component_id_t; - typedef rm_component_id_t rm_bp_id_t; - typedef int rm_BP_state_t; - -/* these are the typedefs that we will need to have */ -/* if we want the states on the fen in a bgl system */ - enum rm_partition_state {RM_PARTITION_FREE, - RM_PARTITION_CONFIGURING, - RM_PARTITION_READY, - RM_PARTITION_BUSY, - RM_PARTITION_DEALLOCATING, - RM_PARTITION_ERROR, - RM_PARTITION_NAV}; - typedef enum status {STATUS_OK = 0, - PARTITION_NOT_FOUND = -1, - JOB_NOT_FOUND = -2, - BP_NOT_FOUND = -3, - SWITCH_NOT_FOUND = -4, - JOB_ALREADY_DEFINED=-5, - CONNECTION_ERROR=-10, - INTERNAL_ERROR = -11, - INVALID_INPUT=-12, - INCOMPATIBLE_STATE=-13, - INCONSISTENT_DATA=-14, - }status_t; -#endif +#include "src/plugins/select/bluegene/wrap_rm_api.h" /* getopt_long options, integers but not characters */ -#define OPT_LONG_HELP 0x100 -#define OPT_LONG_USAGE 0x101 +#define OPT_LONG_HELP 0x100 +#define OPT_LONG_USAGE 0x101 #define OPT_LONG_HIDE 0x102 enum { JOBS, SLURMPART, BGLPART, COMMANDS }; @@ -111,7 +76,6 @@ typedef void (*sighandler_t) (int); /* Input parameters */ typedef struct { - //Both bool all_flag; bool no_header;