x_ac_bluegene.m4 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. ##*****************************************************************************
  2. # AUTHOR:
  3. # Morris Jette <jette1@llnl.gov>, Danny Auble <da@llnl.gov>
  4. #
  5. # SYNOPSIS:
  6. # X_AC_BGL X_AC_BGP X_AC_BGQ
  7. #
  8. # DESCRIPTION:
  9. # Test for Blue Gene specific files.
  10. # If found define HAVE_BG and HAVE_FRONT_END and others
  11. ##*****************************************************************************
  12. AC_DEFUN([X_AC_BG],
  13. [
  14. ac_real_bluegene_loaded=no
  15. ac_bluegene_loaded=no
  16. AC_MSG_CHECKING([whether BG is explicitly disabled])
  17. AC_ARG_ENABLE(
  18. [bluegene],
  19. AS_HELP_STRING(--disable-bluegene,Disable Bluegene support for BGAS nodes (or wherever you run a Slurm on a bluegene system not wanting it to act like a Bluegene)),
  20. [ case "$enableval" in
  21. yes) ac_bluegene_loaded=no ;;
  22. no) ac_bluegene_loaded=yes ;;
  23. *) AC_MSG_RESULT([doh!])
  24. AC_MSG_ERROR([bad value "$enableval" for --disable-bluegene]) ;;
  25. esac ]
  26. )
  27. AC_MSG_RESULT([${ac_bluegene_loaded=yes}])
  28. ])
  29. AC_DEFUN([X_AC_BGL],
  30. [
  31. AC_ARG_WITH(db2-dir, AS_HELP_STRING(--with-db2-dir=PATH,Specify path to parent directory of DB2 library), [ trydb2dir=$withval ])
  32. # test for bluegene emulation mode
  33. AC_ARG_ENABLE(bluegene-emulation, AS_HELP_STRING(--enable-bluegene-emulation, deprecated use --enable-bgl-emulation),
  34. [ case "$enableval" in
  35. yes) bluegene_emulation=yes ;;
  36. no) bluegene_emulation=no ;;
  37. *) AC_MSG_ERROR([bad value "$enableval" for --enable-bluegene-emulation]) ;;
  38. esac ])
  39. AC_ARG_ENABLE(bgl-emulation, AS_HELP_STRING(--enable-bgl-emulation,Run SLURM in BGL mode on a non-bluegene system),
  40. [ case "$enableval" in
  41. yes) bgl_emulation=yes ;;
  42. no) bgl_emulation=no ;;
  43. *) AC_MSG_ERROR([bad value "$enableval" for --enable-bgl-emulation]) ;;
  44. esac ])
  45. # Skip if already set
  46. if test "x$ac_bluegene_loaded" = "xyes" ; then
  47. bg_default_dirs=""
  48. elif test "x$bluegene_emulation" = "xyes" -o "x$bgl_emulation" = "xyes"; then
  49. AC_DEFINE(HAVE_3D, 1, [Define to 1 if 3-dimensional architecture])
  50. AC_DEFINE(SYSTEM_DIMENSIONS, 3, [3-dimensional architecture])
  51. AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
  52. AC_DEFINE(HAVE_BG_L_P, 1, [Define to 1 if emulating or running on Blue Gene/L or P system])
  53. AC_DEFINE(HAVE_BGL, 1, [Define to 1 if emulating or running on Blue Gene/L system])
  54. AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
  55. AC_MSG_NOTICE([Running in BG/L emulation mode])
  56. bg_default_dirs=""
  57. #define ac_bluegene_loaded so we don't load another bluegene conf
  58. ac_bluegene_loaded=yes
  59. else
  60. bg_default_dirs="/bgl/BlueLight/ppcfloor/bglsys /opt/IBM/db2/V8.1 /u/bgdb2cli/sqllib /home/bgdb2cli/sqllib"
  61. fi
  62. for bg_dir in $trydb2dir "" $bg_default_dirs; do
  63. # Skip directories that don't exist
  64. if test ! -z "$bg_dir" -a ! -d "$bg_dir" ; then
  65. continue;
  66. fi
  67. # Search for required BG API libraries in the directory
  68. if test -z "$have_bg_ar" -a -f "$bg_dir/lib64/libbglbridge.so" ; then
  69. have_bg_ar=yes
  70. bg_bridge_so="$bg_dir/lib64/libbglbridge.so"
  71. bg_ldflags="$bg_ldflags -L$bg_dir/lib64 -L/usr/lib64 -Wl,--unresolved-symbols=ignore-in-shared-libs -lbglbridge -lbgldb -ltableapi -lbglmachine -lexpat -lsaymessage"
  72. fi
  73. # Search for required DB2 library in the directory
  74. if test -z "$have_db2" -a -f "$bg_dir/lib64/libdb2.so" ; then
  75. have_db2=yes
  76. bg_db2_so="$bg_dir/lib64/libdb2.so"
  77. bg_ldflags="$bg_ldflags -L$bg_dir/lib64 -ldb2"
  78. fi
  79. # Search for headers in the directory
  80. if test -z "$have_bg_hdr" -a -f "$bg_dir/include/rm_api.h" ; then
  81. have_bg_hdr=yes
  82. bg_includes="-I$bg_dir/include"
  83. fi
  84. done
  85. if test ! -z "$have_bg_ar" -a ! -z "$have_bg_hdr" -a ! -z "$have_db2" ; then
  86. # ac_with_readline="no"
  87. # Test to make sure the api is good
  88. have_bg_files=yes
  89. saved_LDFLAGS="$LDFLAGS"
  90. LDFLAGS="$saved_LDFLAGS $bg_ldflags -m64"
  91. AC_LINK_IFELSE([AC_LANG_PROGRAM([[ int rm_set_serial(char *); ]], [[ rm_set_serial(""); ]])],[have_bg_files=yes],[AC_MSG_ERROR(There is a problem linking to the BG/L api.)])
  92. LDFLAGS="$saved_LDFLAGS"
  93. fi
  94. if test ! -z "$have_bg_files" ; then
  95. BG_INCLUDES="$bg_includes"
  96. CFLAGS="$CFLAGS -m64 --std=gnu99"
  97. CXXFLAGS="$CXXFLAGS $CFLAGS"
  98. AC_DEFINE(HAVE_3D, 1, [Define to 1 if 3-dimensional architecture])
  99. AC_DEFINE(SYSTEM_DIMENSIONS, 3, [3-dimensional architecture])
  100. AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
  101. AC_DEFINE(HAVE_BG_L_P, 1, [Define to 1 if emulating or running on Blue Gene/L or P system])
  102. AC_DEFINE(HAVE_BGL, 1, [Define to 1 if emulating or running on Blue Gene/L system])
  103. AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
  104. AC_DEFINE(HAVE_BG_FILES, 1, [Define to 1 if have Blue Gene files])
  105. AC_DEFINE_UNQUOTED(BG_BRIDGE_SO, "$bg_bridge_so", [Define the BG_BRIDGE_SO value])
  106. AC_DEFINE_UNQUOTED(BG_DB2_SO, "$bg_db2_so", [Define the BG_DB2_SO value])
  107. AC_MSG_CHECKING(for BG serial value)
  108. bg_serial="BGL"
  109. AC_ARG_WITH(bg-serial,
  110. AS_HELP_STRING(--with-bg-serial=NAME,set BG_SERIAL value), [bg_serial="$withval"])
  111. AC_MSG_RESULT($bg_serial)
  112. AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])
  113. #define ac_bluegene_loaded so we don't load another bluegene conf
  114. ac_bluegene_loaded=yes
  115. ac_real_bluegene_loaded=yes
  116. fi
  117. AC_SUBST(BG_INCLUDES)
  118. ])
  119. AC_DEFUN([X_AC_BGP],
  120. [
  121. # test for bluegene emulation mode
  122. AC_ARG_ENABLE(bgp-emulation, AS_HELP_STRING(--enable-bgp-emulation,Run SLURM in BG/P mode on a non-bluegene system),
  123. [ case "$enableval" in
  124. yes) bgp_emulation=yes ;;
  125. no) bgp_emulation=no ;;
  126. *) AC_MSG_ERROR([bad value "$enableval" for --enable-bgp-emulation]) ;;
  127. esac ])
  128. # Skip if already set
  129. if test "x$ac_bluegene_loaded" = "xyes" ; then
  130. bg_default_dirs=""
  131. elif test "x$bgp_emulation" = "xyes"; then
  132. AC_DEFINE(HAVE_3D, 1, [Define to 1 if 3-dimensional architecture])
  133. AC_DEFINE(SYSTEM_DIMENSIONS, 3, [3-dimensional architecture])
  134. AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
  135. AC_DEFINE(HAVE_BG_L_P, 1, [Define to 1 if emulating or running on Blue Gene/L or P system])
  136. AC_DEFINE(HAVE_BGP, 1, [Define to 1 if emulating or running on Blue Gene/P system])
  137. AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
  138. AC_MSG_NOTICE([Running in BG/P emulation mode])
  139. bg_default_dirs=""
  140. #define ac_bluegene_loaded so we don't load another bluegene conf
  141. ac_bluegene_loaded=yes
  142. else
  143. bg_default_dirs="/bgsys/drivers/ppcfloor"
  144. fi
  145. libname=bgpbridge
  146. for bg_dir in $trydb2dir "" $bg_default_dirs; do
  147. # Skip directories that don't exist
  148. if test ! -z "$bg_dir" -a ! -d "$bg_dir" ; then
  149. continue;
  150. fi
  151. soloc=$bg_dir/lib64/lib$libname.so
  152. # Search for required BG API libraries in the directory
  153. if test -z "$have_bg_ar" -a -f "$soloc" ; then
  154. have_bgp_ar=yes
  155. bg_ldflags="$bg_ldflags -L$bg_dir/lib64 -L/usr/lib64 -Wl,--unresolved-symbols=ignore-in-shared-libs -l$libname"
  156. fi
  157. # Search for headers in the directory
  158. if test -z "$have_bg_hdr" -a -f "$bg_dir/include/rm_api.h" ; then
  159. have_bgp_hdr=yes
  160. bg_includes="-I$bg_dir/include"
  161. fi
  162. done
  163. if test ! -z "$have_bgp_ar" -a ! -z "$have_bgp_hdr" ; then
  164. # ac_with_readline="no"
  165. # Test to make sure the api is good
  166. saved_LDFLAGS="$LDFLAGS"
  167. LDFLAGS="$saved_LDFLAGS $bg_ldflags -m64"
  168. AC_LINK_IFELSE([AC_LANG_PROGRAM([[ int rm_set_serial(char *); ]], [[ rm_set_serial(""); ]])],[have_bgp_files=yes],[AC_MSG_ERROR(There is a problem linking to the BG/P api.)])
  169. LDFLAGS="$saved_LDFLAGS"
  170. fi
  171. if test ! -z "$have_bgp_files" ; then
  172. BG_INCLUDES="$bg_includes"
  173. CFLAGS="$CFLAGS -m64"
  174. CXXFLAGS="$CXXFLAGS $CFLAGS"
  175. AC_DEFINE(HAVE_3D, 1, [Define to 1 if 3-dimensional architecture])
  176. AC_DEFINE(SYSTEM_DIMENSIONS, 3, [3-dimensional architecture])
  177. AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
  178. AC_DEFINE(HAVE_BG_L_P, 1, [Define to 1 if emulating or running on Blue Gene/L or P system])
  179. AC_DEFINE(HAVE_BGP, 1, [Define to 1 if emulating or running on Blue Gene/P system])
  180. AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
  181. AC_DEFINE(HAVE_BG_FILES, 1, [Define to 1 if have Blue Gene files])
  182. AC_DEFINE_UNQUOTED(BG_BRIDGE_SO, "$soloc", [Define the BG_BRIDGE_SO value])
  183. AC_MSG_CHECKING(for BG serial value)
  184. bg_serial="BGP"
  185. AC_ARG_WITH(bg-serial,, [bg_serial="$withval"])
  186. AC_MSG_RESULT($bg_serial)
  187. AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])
  188. #define ac_bluegene_loaded so we don't load another bluegene conf
  189. ac_bluegene_loaded=yes
  190. ac_real_bluegene_loaded=yes
  191. fi
  192. AC_SUBST(BG_INCLUDES)
  193. ])
  194. AC_DEFUN([X_AC_BGQ],
  195. [
  196. # test for bluegene emulation mode
  197. AC_ARG_ENABLE(bgq-emulation, AS_HELP_STRING(--enable-bgq-emulation,Run SLURM in BG/Q mode on a non-bluegene system),
  198. [ case "$enableval" in
  199. yes) bgq_emulation=yes ;;
  200. no) bgq_emulation=no ;;
  201. *) AC_MSG_ERROR([bad value "$enableval" for --enable-bgq-emulation]) ;;
  202. esac ])
  203. # Skip if already set
  204. if test "x$ac_bluegene_loaded" = "xyes" ; then
  205. bg_default_dirs=""
  206. elif test "x$bgq_emulation" = "xyes"; then
  207. AC_DEFINE(HAVE_4D, 1, [Define to 1 if 4-dimensional architecture])
  208. AC_DEFINE(SYSTEM_DIMENSIONS, 4, [4-dimensional schedulable architecture])
  209. AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
  210. AC_DEFINE(HAVE_BGQ, 1, [Define to 1 if emulating or running on Blue Gene/Q system])
  211. AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
  212. AC_MSG_NOTICE([Running in BG/Q emulation mode])
  213. bg_default_dirs=""
  214. #define ac_bluegene_loaded so we don't load another bluegene conf
  215. ac_bluegene_loaded=yes
  216. ac_bgq_loaded=yes
  217. else
  218. bg_default_dirs="/bgsys/drivers/ppcfloor"
  219. fi
  220. libname=bgsched
  221. loglibname=log4cxx
  222. runjoblibname=runjob_client
  223. for bg_dir in $trydb2dir "" $bg_default_dirs; do
  224. # Skip directories that don't exist
  225. if test ! -z "$bg_dir" -a ! -d "$bg_dir" ; then
  226. continue;
  227. fi
  228. soloc=$bg_dir/hlcs/lib/lib$libname.so
  229. # Search for required BG API libraries in the directory
  230. if test -z "$have_bg_ar" -a -f "$soloc" ; then
  231. have_bgq_ar=yes
  232. if test "$ac_with_rpath" = "yes"; then
  233. bg_libs="$bg_libs -Wl,-rpath -Wl,$bg_dir/hlcs/lib -L$bg_dir/hlcs/lib -l$libname"
  234. else
  235. bg_libs="$bg_libs -L$bg_dir/hlcs/lib -l$libname"
  236. fi
  237. fi
  238. soloc=$bg_dir/extlib/lib/lib$loglibname.so
  239. if test -z "$have_bg_ar" -a -f "$soloc" ; then
  240. have_bgq_ar=yes
  241. if test "$ac_with_rpath" = "yes"; then
  242. bg_libs="$bg_libs -Wl,-rpath -Wl,$bg_dir/extlib/lib -L$bg_dir/extlib/lib -l$loglibname"
  243. else
  244. bg_libs="$bg_libs -L$bg_dir/extlib/lib -l$loglibname"
  245. fi
  246. fi
  247. soloc=$bg_dir/hlcs/lib/lib$runjoblibname.so
  248. # Search for required BG API libraries in the directory
  249. if test -z "$have_bg_ar" -a -f "$soloc" ; then
  250. have_bgq_ar=yes
  251. if test "$ac_with_rpath" = "yes"; then
  252. runjob_ldflags="$runjob_ldflags -Wl,-rpath -Wl,$bg_dir/hlcs/lib -L$bg_dir/hlcs/lib -l$runjoblibname"
  253. else
  254. runjob_ldflags="$runjob_ldflags -L$bg_dir/hlcs/lib -l$runjoblibname"
  255. fi
  256. fi
  257. # Search for headers in the directory
  258. if test -z "$have_bg_hdr" -a -f "$bg_dir/hlcs/include/bgsched/bgsched.h" ; then
  259. have_bgq_hdr=yes
  260. bg_includes="-I$bg_dir -I$bg_dir/hlcs/include"
  261. fi
  262. if test -z "$have_bg_hdr" -a -f "$bg_dir/extlib/include/log4cxx/logger.h" ; then
  263. have_bgq_hdr=yes
  264. bg_includes="$bg_includes -I$bg_dir/extlib/include"
  265. fi
  266. done
  267. if test ! -z "$have_bgq_ar" -a ! -z "$have_bgq_hdr" ; then
  268. # ac_with_readline="no"
  269. # Test to make sure the api is good
  270. saved_LIBS="$LIBS"
  271. saved_CPPFLAGS="$CPPFLAGS"
  272. LIBS="$saved_LIBS $bg_libs"
  273. CPPFLAGS="$saved_CPPFLAGS -m64 $bg_includes"
  274. AC_LANG_PUSH(C++)
  275. AC_LINK_IFELSE([AC_LANG_PROGRAM(
  276. [[#include <bgsched/bgsched.h>
  277. #include <log4cxx/logger.h>]],
  278. [[ bgsched::init("");
  279. log4cxx::LoggerPtr logger_ptr(log4cxx::Logger::getLogger( "ibm" ));]])],
  280. [have_bgq_files=yes],
  281. [AC_MSG_ERROR(There is a problem linking to the BG/Q api.)])
  282. # In later versions of the driver IBM added a better function
  283. # to see if blocks were IO connected or not. Here is a check
  284. # to not break backwards compatibility
  285. AC_LINK_IFELSE([AC_LANG_PROGRAM(
  286. [[#include <bgsched/bgsched.h>
  287. #include <bgsched/Block.h>]],
  288. [[ bgsched::Block::checkIO("", NULL, NULL);]])],
  289. [have_bgq_new_io_check=yes],
  290. [AC_MSG_RESULT(Using old iocheck.)])
  291. # In later versions of the driver IBM added an "action" to a
  292. # block. Here is a check to not break backwards compatibility
  293. AC_LINK_IFELSE([AC_LANG_PROGRAM(
  294. [[#include <bgsched/bgsched.h>
  295. #include <bgsched/Block.h>]],
  296. [[ bgsched::Block::Ptr block_ptr;
  297. block_ptr->getAction();]])],
  298. [have_bgq_get_action=yes],
  299. [AC_MSG_RESULT(Blocks do not have actions!)])
  300. AC_LANG_POP(C++)
  301. LIBS="$saved_LIBS"
  302. CPPFLAGS="$saved_CPPFLAGS"
  303. fi
  304. if test ! -z "$have_bgq_files" ; then
  305. BG_LDFLAGS="$bg_libs"
  306. RUNJOB_LDFLAGS="$runjob_ldflags"
  307. BG_INCLUDES="$bg_includes"
  308. CFLAGS="$CFLAGS -m64"
  309. CXXFLAGS="$CXXFLAGS $CFLAGS"
  310. AC_DEFINE(HAVE_4D, 1, [Define to 1 if 4-dimensional architecture])
  311. AC_DEFINE(SYSTEM_DIMENSIONS, 4, [4-dimensional architecture])
  312. AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
  313. AC_DEFINE(HAVE_BGQ, 1, [Define to 1 if emulating or running on Blue Gene/Q system])
  314. AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
  315. AC_DEFINE(HAVE_BG_FILES, 1, [Define to 1 if have Blue Gene files])
  316. #AC_DEFINE_UNQUOTED(BG_BRIDGE_SO, "$soloc", [Define the BG_BRIDGE_SO value])
  317. if test ! -z "$have_bgq_new_io_check" ; then
  318. AC_DEFINE(HAVE_BG_NEW_IO_CHECK, 1, [Define to 1 if using code with new iocheck])
  319. fi
  320. if test ! -z "$have_bgq_get_action" ; then
  321. AC_DEFINE(HAVE_BG_GET_ACTION, 1, [Define to 1 if using code where blocks have actions])
  322. fi
  323. AC_MSG_NOTICE([Running on a legitimate BG/Q system])
  324. # AC_MSG_CHECKING(for BG serial value)
  325. # bg_serial="BGQ"
  326. # AC_ARG_WITH(bg-serial,, [bg_serial="$withval"])
  327. # AC_MSG_RESULT($bg_serial)
  328. # AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])
  329. #define ac_bluegene_loaded so we don't load another bluegene conf
  330. ac_bluegene_loaded=yes
  331. ac_real_bluegene_loaded=yes
  332. ac_bgq_loaded=yes
  333. fi
  334. AC_SUBST(BG_INCLUDES)
  335. AC_SUBST(BG_LDFLAGS)
  336. AC_SUBST(RUNJOB_LDFLAGS)
  337. ])