configure.ac 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2016 Université de Bordeaux
  4. # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 CNRS
  5. # Copyright (C) 2011 Télécom-SudParis
  6. # Copyright (C) 2011, 2012, 2014-2016 INRIA
  7. #
  8. # StarPU is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU Lesser General Public License as published by
  10. # the Free Software Foundation; either version 2.1 of the License, or (at
  11. # your option) any later version.
  12. #
  13. # StarPU is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. #
  17. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. AC_INIT([StarPU], [1.3.0], [starpu-devel@lists.gforge.inria.fr], [starpu], [http://runtime.bordeaux.inria.fr/StarPU/])
  19. AC_CONFIG_SRCDIR(include/starpu.h)
  20. AC_CONFIG_AUX_DIR([build-aux])
  21. # libtool doesn't actually properly manage a space in the workdir
  22. case `pwd` in
  23. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  24. AC_MSG_ERROR([unsafe absolute working directory name]);;
  25. esac
  26. dnl Versioning.
  27. STARPU_MAJOR_VERSION="`echo $PACKAGE_VERSION | cut -d . -f 1`"
  28. STARPU_MINOR_VERSION="`echo $PACKAGE_VERSION | cut -d . -f 2`"
  29. STARPU_RELEASE_VERSION="`echo $PACKAGE_VERSION | cut -d . -f 3`"
  30. STARPU_RELEASE_VERSION="`echo $PACKAGE_VERSION | cut -d . -f 3| sed 's/rc.*//'`"
  31. dnl we do not want the rcXX in the release version. we would like to use sed -r 's/[a-z]+.*//' to remove any string but the -r option is not portable
  32. AC_SUBST([STARPU_MAJOR_VERSION])
  33. AC_SUBST([STARPU_MINOR_VERSION])
  34. AC_SUBST([STARPU_RELEASE_VERSION])
  35. AC_SUBST([STARPU_EFFECTIVE_VERSION])
  36. AC_DEFINE_UNQUOTED([STARPU_MAJOR_VERSION], [$STARPU_MAJOR_VERSION], [Major version number of StarPU.])
  37. AC_DEFINE_UNQUOTED([STARPU_MINOR_VERSION], [$STARPU_MINOR_VERSION], [Minor version number of StarPU.])
  38. AC_DEFINE_UNQUOTED([STARPU_RELEASE_VERSION], [$STARPU_RELEASE_VERSION], [Release version number of StarPU.])
  39. . "$srcdir/STARPU-VERSION"
  40. AC_SUBST([LIBSTARPU_INTERFACE_CURRENT])
  41. AC_SUBST([LIBSTARPU_INTERFACE_REVISION])
  42. AC_SUBST([LIBSTARPU_INTERFACE_AGE])
  43. AC_SUBST([LIBSTARPUMPI_INTERFACE_CURRENT])
  44. AC_SUBST([LIBSTARPUMPI_INTERFACE_REVISION])
  45. AC_SUBST([LIBSTARPUMPI_INTERFACE_AGE])
  46. AC_SUBST([LIBSTARPUFFT_INTERFACE_CURRENT])
  47. AC_SUBST([LIBSTARPUFFT_INTERFACE_REVISION])
  48. AC_SUBST([LIBSTARPUFFT_INTERFACE_AGE])
  49. AC_SUBST([LIBSOCL_INTERFACE_CURRENT])
  50. AC_SUBST([LIBSOCL_INTERFACE_REVISION])
  51. AC_SUBST([LIBSOCL_INTERFACE_AGE])
  52. AC_CANONICAL_SYSTEM
  53. dnl Automake 1.11 introduced `silent-rules' and `color-tests'. Use them
  54. dnl when they're available.
  55. dnl do not use option subdir-objects, it causes fortran compilation to fail
  56. m4_ifdef([AM_SILENT_RULES],
  57. [AM_INIT_AUTOMAKE([1.11 -Wall foreign silent-rules color-tests parallel-tests])],
  58. [AM_INIT_AUTOMAKE([1.10 -Wall foreign])])
  59. m4_ifdef([AM_SILENT_RULES],
  60. [AM_SILENT_RULES(yes)])
  61. AC_PREREQ(2.64)
  62. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  63. AC_PROG_CC
  64. AM_PROG_CC_C_O
  65. AC_PROG_CXX
  66. AC_PROG_CPP
  67. AC_PROG_SED
  68. AC_PROG_LN_S
  69. AC_PROG_F77
  70. AC_PROG_FC
  71. AC_CHECK_PROGS(PROG_STAT,gstat stat)
  72. AC_CHECK_PROGS(PROG_DATE,gdate date)
  73. AC_OPENMP
  74. #c++11 detection
  75. AX_CXX_COMPILE_STDCXX(11,noext,optional)
  76. AC_SUBST([STARPU_HAVE_CXX11], [test "$HAVE_CXX11" -eq 1])
  77. AM_CONDITIONAL([STARPU_HAVE_CXX11], [test "$HAVE_CXX11" -eq 1])
  78. if test $HAVE_CXX11 -eq 1; then
  79. AC_DEFINE(STARPU_HAVE_CXX11, [1], [compiler supports cxx11])
  80. fi
  81. if test x$enable_perf_debug = xyes; then
  82. enable_shared=no
  83. fi
  84. LT_PREREQ([2.2])
  85. LT_INIT([win32-dll])
  86. AC_PROG_INSTALL
  87. AC_PROG_MKDIR_P
  88. AC_PROG_LN_S
  89. AC_HEADER_STDC
  90. AC_C_RESTRICT
  91. # Check if bash is available
  92. AC_CHECK_PROGS([BASH], [bash])
  93. # Check whether subversion is installed
  94. AC_PATH_PROG(svncommand, svn)
  95. AC_PATH_PROG(svnversioncommand, svnversion)
  96. # find out if we are are in a subversion directory
  97. svndir=0
  98. if test "$svncommand" != "" ; then
  99. $svncommand info $srcdir >/dev/null 2>&1
  100. if test $? -eq 0; then
  101. svndir=1
  102. fi
  103. fi
  104. # use svnversion to record the current repository revision only if
  105. # subversion is installed and we are in a working copy
  106. if test "$svnversioncommand" = "" || test "`LC_ALL=C $svnversioncommand -n $srcdir`" = "exported" ; then
  107. if test -f $srcdir/STARPU-REVISION ; then
  108. cp $srcdir/STARPU-REVISION .
  109. else
  110. echo "unknown" > ./STARPU-REVISION
  111. fi
  112. else
  113. LC_ALL=C svnversion $srcdir > ./STARPU-REVISION
  114. fi
  115. AM_CONDITIONAL([STARPU_CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
  116. ###############################################################################
  117. # #
  118. # MIC device compilation #
  119. # (Must be done in beginning to change prefix in the whole configuration) #
  120. # #
  121. ###############################################################################
  122. AC_ARG_ENABLE(mic, [AS_HELP_STRING([--enable-mic],
  123. [use MIC device(s)])], [enable_mic=$enableval], [enable_mic=no])
  124. AC_ARG_ENABLE(mic-rma, [AS_HELP_STRING([--disable-mic-rma],
  125. [use MIC RMA transfer])], [enable_mic_rma=$enableval], [enable_mic_rma=yes])
  126. if test x$enable_mic = xyes ; then
  127. AC_DEFINE(STARPU_USE_MIC, [1], [MIC workers support is enabled])
  128. fi
  129. if test x$enable_mic_rma = xyes ; then
  130. AC_DEFINE([STARPU_MIC_USE_RMA], [1], [MIC RMA transfer is enable])
  131. fi
  132. AM_CONDITIONAL([STARPU_USE_MIC], [test "x$enable_mic" = "xyes"])
  133. ###############################################################################
  134. AC_PATH_PROGS([STARPU_MS_LIB], [lib])
  135. AC_ARG_VAR([STARPU_MS_LIB], [Path to Microsoft's Visual Studio `lib' tool])
  136. AM_CONDITIONAL([STARPU_HAVE_MS_LIB], [test "x$STARPU_MS_LIB" != "x"])
  137. case "$target" in
  138. *-*-mingw*|*-*-cygwin*)
  139. starpu_windows=yes
  140. libext=a
  141. AC_DEFINE(STARPU_HAVE_WINDOWS, [1], [Define this on windows.])
  142. ;;
  143. *-*-linux*)
  144. starpu_linux=yes
  145. AC_DEFINE(STARPU_LINUX_SYS, [1], [Define to 1 on Linux])
  146. ;;
  147. *-*darwin*)
  148. starpu_darwin=yes
  149. AC_DEFINE(STARPU_HAVE_DARWIN, [1], [Define this on darwin.])
  150. ;;
  151. esac
  152. AM_CONDITIONAL([STARPU_HAVE_WINDOWS], [test "x$starpu_windows" = "xyes"])
  153. AM_CONDITIONAL([STARPU_LINUX_SYS], [test "x$starpu_linux" = "xyes"])
  154. AM_CONDITIONAL([STARPU_HAVE_DARWIN], [test "x$starpu_darwin" = "xyes"])
  155. # on Darwin, GCC targets i386 by default, so we don't have atomic ops
  156. AC_CHECK_SIZEOF([void *])
  157. SIZEOF_VOID_P=$ac_cv_sizeof_void_p
  158. case $SIZEOF_VOID_P in
  159. 4)
  160. case "$target" in
  161. i386-*darwin*) CFLAGS+=" -march=i686 " ;;
  162. esac
  163. STARPU_MS_LIB_ARCH=X86
  164. ;;
  165. 8)
  166. STARPU_MS_LIB_ARCH=X64
  167. ;;
  168. esac
  169. AC_SUBST(STARPU_MS_LIB_ARCH)
  170. # This will be useful for program which use CUDA (and .cubin files) which need
  171. # some path to the CUDA code at runtime.
  172. AC_DEFINE_UNQUOTED(STARPU_BUILD_DIR, "$PWD", [location of StarPU build directory])
  173. AC_SUBST(STARPU_BUILD_DIR, $PWD)
  174. case "${srcdir}" in
  175. /*) AC_DEFINE_UNQUOTED(STARPU_SRC_DIR, "$(eval echo ${srcdir})", [location of StarPU sources])
  176. AC_SUBST(STARPU_SRC_DIR, "$(eval echo ${srcdir})") ;;
  177. *) AC_DEFINE_UNQUOTED(STARPU_SRC_DIR, "$(eval echo $PWD/${srcdir})", [location of StarPU sources])
  178. AC_SUBST(STARPU_SRC_DIR, "$(eval echo $PWD/${srcdir})") ;;
  179. esac
  180. case "$target" in
  181. *-*-mingw*|*-*-cygwin*)
  182. AC_ARG_ENABLE(native-winthreads, [AS_HELP_STRING([--enable-native-winthreads],
  183. [Use native windows threads instead of pthread])],
  184. enable_native_winthreads=$enableval, enable_native_winthreads=no)
  185. ;;
  186. esac
  187. if test x"$enable_native_winthreads" != xyes
  188. then
  189. INCLUDE_PTHREAD_H='#include <pthread.h>'
  190. fi
  191. AC_CHECK_TYPE([struct timespec],
  192. AC_DEFINE(STARPU_HAVE_STRUCT_TIMESPEC,[1],[struct timespec is defined]),
  193. [], [
  194. #include <sys/types.h>
  195. #include <sys/stat.h>
  196. #ifdef HAVE_UNISTD_H
  197. #include <unistd.h>
  198. #endif
  199. #include <time.h>
  200. $INCLUDE_PTHREAD_H
  201. ])
  202. AC_CHECK_HEADERS([unistd.h], [AC_DEFINE([STARPU_HAVE_UNISTD_H], [1], [Define to 1 if you have the <unistd.h> header file.])])
  203. if test x"$enable_native_winthreads" = xyes
  204. then
  205. CPPFLAGS+=" -I$STARPU_SRC_DIR/include/pthread_win32 "
  206. AC_COMPILE_IFELSE(
  207. [AC_LANG_PROGRAM([[
  208. #define STARPU_CONFIGURE
  209. #include <pthread.h>
  210. ]],
  211. [[ pthread_t t; pthread_create(&t, NULL, NULL, NULL); ]])],
  212. AC_DEFINE(STARPU_NATIVE_WINTHREADS,[1],[Using native windows threads]),
  213. AC_MSG_ERROR([pthread_create unavailable]))
  214. else
  215. AC_CHECK_LIB([pthread], [pthread_create])
  216. fi
  217. AC_SEARCH_LIBS([sqrt],[m],,AC_MSG_ERROR([math library unavailable]))
  218. AC_HAVE_LIBRARY([ws2_32])
  219. AC_CHECK_FUNCS([sysconf])
  220. AC_CHECK_FUNC([pthread_spin_lock], have_pthread_spin_lock=yes, have_pthread_spin_lock=no)
  221. if test x$have_pthread_spin_lock = xyes; then
  222. AC_DEFINE(HAVE_PTHREAD_SPIN_LOCK,[1],[pthread_spin_lock is available])
  223. AC_DEFINE(STARPU_HAVE_PTHREAD_SPIN_LOCK,[1],[pthread_spin_lock is available])
  224. fi
  225. AC_CHECK_FUNC([pthread_barrier_init], have_pthread_barrier=yes, have_pthread_barrier=no)
  226. if test x$have_pthread_barrier = xyes; then
  227. AC_DEFINE(STARPU_HAVE_PTHREAD_BARRIER,[1],[pthread_barrier is available])
  228. fi
  229. # yes, that's non portable, but it's still better than sched_setaffinity
  230. AC_CHECK_FUNCS(pthread_setaffinity_np)
  231. AC_CHECK_FUNC([pthread_setname_np], have_pthread_setname_np=yes, have_pthread_setname_np=no)
  232. if test x$have_pthread_setname_np = xyes; then
  233. AC_DEFINE(STARPU_HAVE_PTHREAD_SETNAME_NP,[1],[pthread_setname_np is available])
  234. fi
  235. # There is no posix_memalign on Mac OS X, only memalign
  236. AC_CHECK_FUNCS([posix_memalign], [AC_DEFINE([STARPU_HAVE_POSIX_MEMALIGN], [1], [Define to 1 if you have the `posix_memalign' function.])])
  237. AC_CHECK_FUNCS([memalign], [AC_DEFINE([STARPU_HAVE_MEMALIGN], [1], [Define to 1 if you have the `memalign' function.])])
  238. # Some systems don't have drand48
  239. AC_CHECK_FUNC([drand48], have_drand48=yes, have_drand48=no)
  240. AC_CHECK_FUNC([erand48_r], have_erand48_r=yes, have_erand48_r=no)
  241. # Maybe the user still does not want to use the provided drand48
  242. AC_ARG_ENABLE(default-drand48, [AS_HELP_STRING([--disable-default-drand48],
  243. [Do not use the default version of drand48])],
  244. enable_default_drand48=$enableval, enable_default_drand48=yes)
  245. if test x$have_drand48 = xyes -a x$enable_default_drand48 = xyes ; then
  246. AC_DEFINE([STARPU_USE_DRAND48], [1], [Define to 1 if drandr48 is available and should be used])
  247. fi
  248. if test x$have_erand48_r = xyes ; then
  249. AC_DEFINE([STARPU_USE_ERAND48_R], [1], [Define to 1 if erandr48_r is available])
  250. fi
  251. # Some systems do not define strerror_r
  252. AC_CHECK_FUNC([strerror_r], [AC_DEFINE([STARPU_HAVE_STRERROR_R], [1], [Define to 1 if the function strerro_r is available.])])
  253. # Some systems may not define setenv
  254. AC_CHECK_FUNC([setenv], [AC_DEFINE([STARPU_HAVE_SETENV], [1], [Define to 1 if the function setenv is available.])])
  255. # Some systems do not define unsetenv
  256. AC_CHECK_FUNC([unsetenv], [AC_DEFINE([STARPU_HAVE_UNSETENV], [1], [Define to 1 if the function unsetenv is available.])])
  257. # Some systems do not define nearbyintf...
  258. AC_CHECK_FUNC([nearbyintf], [AC_DEFINE([STARPU_HAVE_NEARBYINTF], [1], [Define to 1 if the function nearbyintf is available.])])
  259. # ... but they may define rintf.
  260. AC_CHECK_FUNC([rintf], [AC_DEFINE([STARPU_HAVE_RINTF], [1], [Define to 1 if the function rintf is available.])])
  261. # Define quick check
  262. AC_ARG_ENABLE(quick-check, [AS_HELP_STRING([--enable-quick-check],
  263. [Lower default values for the testcases run by make check to allow a faster execution])],
  264. enable_quick_check=$enableval, enable_quick_check=no)
  265. if test x$enable_quick_check = xyes; then
  266. AC_DEFINE(STARPU_QUICK_CHECK, [1], [enable quick check])
  267. fi
  268. AM_CONDITIONAL([STARPU_QUICK_CHECK], [test "x$enable_quick_check" = "xyes"])
  269. # Define long check
  270. AC_ARG_ENABLE(long-check, [AS_HELP_STRING([--enable-long-check],
  271. [Enable some exhaustive checks which take a really long time])],
  272. enable_long_check=$enableval, enable_long_check=no)
  273. if test x$enable_long_check = xyes; then
  274. AC_DEFINE(STARPU_LONG_CHECK, [1], [enable long check])
  275. fi
  276. AM_CONDITIONAL([STARPU_LONG_CHECK], [test "x$enable_long_check" = "xyes"])
  277. # Define new check
  278. AC_ARG_ENABLE(new-check, [AS_HELP_STRING([--enable-new-check],
  279. [Enable new and known-to-fail testcases])],
  280. enable_new_check=$enableval, enable_new_check=no)
  281. if test x$enable_new_check = xyes; then
  282. AC_DEFINE(STARPU_NEW_CHECK, [1], [enable new check])
  283. fi
  284. AM_CONDITIONAL([STARPU_NEW_CHECK], [test "x$enable_new_check" = "xyes"])
  285. AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([STARPU_HAVE_MALLOC_H], [1], [Define to 1 if you have the <malloc.h> header file.])])
  286. AC_ARG_ENABLE(valgrind, [AS_HELP_STRING([--disable-valgrind],
  287. [Do not check the availability of valgrind.h and helgrind.h])],
  288. enable_valgrind=$enableval, enable_valgrind=yes)
  289. if test "$enable_valgrind" != "no" ; then
  290. AC_CHECK_HEADERS([valgrind/valgrind.h], [AC_DEFINE([STARPU_HAVE_VALGRIND_H], [1], [Define to 1 if you have the <valgrind/valgrind.h> header file.])])
  291. AC_CHECK_HEADERS([valgrind/memcheck.h], [AC_DEFINE([STARPU_HAVE_MEMCHECK_H], [1], [Define to 1 if you have the <valgrind/memcheck.h> header file.])])
  292. AC_CHECK_HEADERS([valgrind/helgrind.h], [AC_DEFINE([STARPU_HAVE_HELGRIND_H], [1], [Define to 1 if you have the <valgrind/helgrind.h> header file.])])
  293. fi
  294. if test "$enable_valgrind" = "full" ; then
  295. AC_DEFINE([STARPU_VALGRIND_FULL], [1], [Define to 1 to disable STARPU_SKIP_IF_VALGRIND when running tests.])
  296. fi
  297. AC_CHECK_FUNC([sched_yield], [AC_DEFINE([STARPU_HAVE_SCHED_YIELD], [1], [Define to 1 if the function sched_yield is available.])])
  298. AC_CHECK_HEADERS([aio.h])
  299. AC_CHECK_LIB([rt], [aio_read])
  300. AC_CHECK_FUNCS([mkostemp])
  301. AC_CHECK_FUNCS([pread pwrite])
  302. # This defines HAVE_SYNC_VAL_COMPARE_AND_SWAP
  303. STARPU_CHECK_SYNC_VAL_COMPARE_AND_SWAP
  304. # This defines HAVE_SYNC_BOOL_COMPARE_AND_SWAP
  305. STARPU_CHECK_SYNC_BOOL_COMPARE_AND_SWAP
  306. # This defines HAVE_SYNC_FETCH_AND_ADD
  307. STARPU_CHECK_SYNC_FETCH_AND_ADD
  308. # This defines HAVE_SYNC_FETCH_AND_OR
  309. STARPU_CHECK_SYNC_FETCH_AND_OR
  310. # This defines HAVE_SYNC_LOCK_TEST_AND_SET
  311. STARPU_CHECK_SYNC_LOCK_TEST_AND_SET
  312. # This defines HAVE_SYNC_SYNCHRONIZE
  313. STARPU_CHECK_SYNC_SYNCHRONIZE
  314. CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE "
  315. STARPU_SEARCH_LIBS([LIBNUMA],[set_mempolicy],[numa],[enable_libnuma=yes],[enable_libnuma=no])
  316. AC_MSG_CHECKING(whether libnuma is available)
  317. AC_MSG_RESULT($enable_libnuma)
  318. if test x$enable_libnuma = xyes; then
  319. AC_DEFINE(STARPU_HAVE_LIBNUMA,[1],[libnuma is available])
  320. fi
  321. ###############################################################################
  322. # #
  323. # SCHED_CTX settings #
  324. # #
  325. ###############################################################################
  326. AC_MSG_CHECKING(maximum number of sched_ctxs)
  327. AC_ARG_ENABLE(max_sched_ctxs, [AS_HELP_STRING([--enable-max-sched-ctxs=<number>],
  328. [maximum number of sched_ctxs])],
  329. max_sched_ctxs=$enableval, max_sched_ctxs=10)
  330. AC_MSG_RESULT($max_sched_ctxs)
  331. AC_DEFINE_UNQUOTED(STARPU_NMAX_SCHED_CTXS, [$max_sched_ctxs], [Maximum number of sched_ctxs supported])
  332. AC_ARG_ENABLE([sc_hypervisor],
  333. [AS_HELP_STRING([--enable-sc-hypervisor],
  334. [enable resizing contexts (experimental)])],
  335. [enable_sc_hypervisor="yes"],
  336. [enable_sc_hypervisor="no"])
  337. #for pkgconfig
  338. AC_SUBST(STARPU_SC_HYPERVISOR)
  339. if test "x$enable_sc_hypervisor" = "xyes"; then
  340. AC_DEFINE(STARPU_USE_SC_HYPERVISOR, [1], [enable sc_hypervisor lib])
  341. # PKG_CHECK_MODULES([SC_HYPERVISOR], [libsc_hypervisor], [], build_sc_hypervisor="yes")
  342. STARPU_SC_HYPERVISOR="-lsc_hypervisor"
  343. build_sc_hypervisor="yes"
  344. else
  345. build_sc_hypervisor="no"
  346. fi
  347. AM_CONDITIONAL([STARPU_BUILD_SC_HYPERVISOR], [test "x$build_sc_hypervisor" = "xyes"])
  348. AM_CONDITIONAL([STARPU_USE_SC_HYPERVISOR], [test "x$build_sc_hypervisor" = "xyes"])
  349. AC_ARG_ENABLE([sc_hypervisor_debug],
  350. [AS_HELP_STRING([--enable-sc-hypervisor-debug],
  351. [enable debug for resizing contexts (experimental)])],
  352. [enable_sc_hypervisor_debug="yes"],
  353. [enable_sc_hypervisor_debug="no"])
  354. AC_SUBST(STARPU_SC_HYPERVISOR_DEBUG, $enable_sc_hypervisor_debug)
  355. AM_CONDITIONAL([STARPU_SC_HYPERVISOR_DEBUG], [test "x$enable_sc_hypervisor_debug" = "xyes"])
  356. if test "x$enable_sc_hypervisor_debug" = "xyes"; then
  357. AC_DEFINE(STARPU_SC_HYPERVISOR_DEBUG, [1], [enable debug sc_hypervisor])
  358. fi
  359. ###############################################################################
  360. # #
  361. # CPUs settings #
  362. # #
  363. ###############################################################################
  364. AC_MSG_CHECKING(maximum number of CPUs)
  365. AC_ARG_ENABLE(maxcpus, [AS_HELP_STRING([--enable-maxcpus=<number>],
  366. [maximum number of CPUs])],
  367. maxcpus=$enableval, maxcpus=64)
  368. AC_MSG_RESULT($maxcpus)
  369. AC_DEFINE_UNQUOTED(STARPU_MAXCPUS, [$maxcpus], [Maximum number of CPUs supported])
  370. AC_MSG_CHECKING(whether CPUs should be used)
  371. AC_ARG_ENABLE(cpu, [AS_HELP_STRING([--disable-cpu],
  372. [do not use the CPU(s)])],
  373. enable_cpu=$enableval, enable_cpu=yes)
  374. AC_MSG_RESULT($enable_cpu)
  375. AC_SUBST(STARPU_USE_CPU, $enable_cpu)
  376. AM_CONDITIONAL(STARPU_USE_CPU, test x$enable_cpu = xyes)
  377. if test x$enable_cpu = xyes; then
  378. AC_DEFINE(STARPU_USE_CPU, [1], [CPU driver is activated])
  379. fi
  380. ###############################################################################
  381. # #
  382. # CUDA settings #
  383. # #
  384. ###############################################################################
  385. AC_MSG_CHECKING(maximum number of CUDA devices)
  386. AC_ARG_ENABLE(maxcudadev, [AS_HELP_STRING([--enable-maxcudadev=<number>],
  387. [maximum number of CUDA devices])],
  388. nmaxcudadev=$enableval, nmaxcudadev=4)
  389. AC_MSG_RESULT($nmaxcudadev)
  390. AC_DEFINE_UNQUOTED(STARPU_MAXCUDADEVS, [$nmaxcudadev],
  391. [maximum number of CUDA devices])
  392. AC_ARG_ENABLE(cuda, [AS_HELP_STRING([--disable-cuda],
  393. [do not use CUDA device(s)])],, [enable_cuda=maybe])
  394. #AC_MSG_CHECKING(whether CUDA is available)
  395. AC_ARG_WITH(cuda-dir,
  396. [AS_HELP_STRING([--with-cuda-dir=<path>],
  397. [specify CUDA installation directory])],
  398. [
  399. cuda_dir="$withval"
  400. # in case this was not explicit yet
  401. enable_cuda=yes
  402. ], cuda_dir=no)
  403. AC_ARG_WITH(cuda-include-dir,
  404. [AS_HELP_STRING([--with-cuda-include-dir=<path>],
  405. [specify where CUDA headers are installed])],
  406. [
  407. cuda_include_dir="$withval"
  408. # in case this was not explicit yet
  409. enable_cuda=yes
  410. ], [cuda_include_dir=no])
  411. AC_ARG_WITH(cuda-lib-dir,
  412. [AS_HELP_STRING([--with-cuda-lib-dir=<path>],
  413. [specify where CUDA libraries are installed])],
  414. [
  415. cuda_lib_dir="$withval"
  416. # in case this was not explicit yet
  417. enable_cuda=yes
  418. ], [cuda_lib_dir=no])
  419. AC_DEFUN([STARPU_CHECK_CUDA_L],
  420. [
  421. __cuda_L=$1
  422. SAVED_LDFLAGS="${LDFLAGS}"
  423. STARPU_CUDA_LDFLAGS="${__cuda_L}"
  424. AC_MSG_CHECKING(whether CUDA is available with: $__cuda_L)
  425. AC_MSG_RESULT()
  426. LDFLAGS="${SAVED_LDFLAGS} ${__cuda_L}"
  427. AC_HAVE_LIBRARY([cuda],[have_valid_cuda=yes],[have_valid_cuda=no])
  428. unset ac_cv_lib_cuda_main
  429. if test "$have_valid_cuda" = "yes" ; then
  430. AC_HAVE_LIBRARY([cudart],[have_valid_cuda=yes],[have_valid_cuda=no])
  431. unset ac_cv_lib_cudart_main
  432. if test "$have_valid_cuda" = yes ; then
  433. STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcudart"
  434. LDFLAGS="${SAVED_LDFLAGS} ${STARPU_CUDA_LDFLAGS}"
  435. # we also check that CUBLAS is available
  436. AC_HAVE_LIBRARY([cublas],[have_valid_cuda=yes],[have_valid_cuda=no])
  437. unset ac_cv_lib_cublas_main
  438. if test "$have_valid_cuda" = "yes" ; then
  439. STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcublas"
  440. fi
  441. fi
  442. fi
  443. LDFLAGS="${SAVED_LDFLAGS}"
  444. ])
  445. AC_DEFUN([STARPU_CHECK_CUDA],
  446. [
  447. __cuda_dir=$1
  448. __cuda_include_dir=$2
  449. __cuda_lib_dir=$3
  450. if test -z "$__cuda_lib_dir" ; then
  451. __cuda_lib_dir=no
  452. fi
  453. if test -z "$__cuda_include_dir" ; then
  454. __cuda_include_dir=no
  455. fi
  456. if test -z "$__cuda_dir" ; then
  457. __cuda_dir=no
  458. fi
  459. if test "$__cuda_dir" != "no" ; then
  460. AC_MSG_CHECKING(whether CUDA is available in $__cuda_dir, $__cuda_include_dir and $__cuda_lib_dir)
  461. else
  462. AC_MSG_CHECKING(whether CUDA is available)
  463. fi
  464. AC_MSG_RESULT()
  465. if test "$__cuda_include_dir" = "no" -a "$__cuda_dir" != "no" ; then
  466. __cuda_include_dir="$__cuda_dir/include"
  467. fi
  468. SAVED_CPPFLAGS="$CPPFLAGS"
  469. have_valid_cuda=no
  470. if test "$__cuda_include_dir" != "no" ; then
  471. CPPFLAGS="${CPPFLAGS} -I$__cuda_include_dir"
  472. fi
  473. AC_CHECK_HEADER([cuda.h],[have_valid_cuda=yes],[have_valid_cuda=no])
  474. unset ac_cv_header_cuda_h
  475. if test "$have_valid_cuda" = "yes" ; then
  476. if test "$__cuda_lib_dir" != "no" ; then
  477. STARPU_CHECK_CUDA_L("-L${__cuda_lib_dir}")
  478. else
  479. if test "$__cuda_dir" != "no" ; then
  480. for __cuda_libdir in lib64 lib lib/x64 lib/Win32 ; do
  481. STARPU_CHECK_CUDA_L("-L${__cuda_dir}/${__cuda_libdir}")
  482. if test "$have_valid_cuda" = yes ; then
  483. break
  484. fi
  485. done
  486. else
  487. STARPU_CHECK_CUDA_L("")
  488. fi
  489. fi
  490. fi
  491. if test "$have_valid_cuda" = "no" ; then
  492. CPPFLAGS="${SAVED_CPPFLAGS}"
  493. unset STARPU_CUDA_LDFLAGS
  494. else
  495. if test "$NVCC" = "" ; then
  496. AC_PATH_PROG([NVCC], [nvcc], [not-found],
  497. [$cuda_dir/bin:$PATH:/usr/local/cuda/bin:/usr/bin:/bin])
  498. fi
  499. if test "x$NVCC" = "xnot-found"; then
  500. AC_MSG_WARN(['nvcc' not found, disabling CUDA])
  501. have_valid_cuda=no
  502. else
  503. # This is for very old cuda, to enable the use of double etc.
  504. AC_MSG_CHECKING(whether nvcc supports sm_13 architecture)
  505. OLD_NVCCFLAGS="$NVCCFLAGS"
  506. NVCCFLAGS="$NVCCFLAGS -arch sm_13"
  507. echo "int main(int argc, char **argv) { return 0;}" > cuda_test.cu
  508. $NVCC $NVCCFLAGS -c cuda_test.cu >/dev/null 2>&1
  509. if test $? -eq 0
  510. then
  511. AC_MSG_RESULT(yes)
  512. else
  513. AC_MSG_RESULT(no)
  514. NVCCFLAGS="$OLD_NVCCFLAGS"
  515. fi
  516. # This is for recent cuda, which complains if we don't actually set an arch!?
  517. AC_MSG_CHECKING(whether nvcc supports -Wno-deprecated-gpu-targets)
  518. OLD_NVCCFLAGS="$NVCCFLAGS"
  519. NVCCFLAGS="$NVCCFLAGS -Wno-deprecated-gpu-targets"
  520. echo "int main(int argc, char **argv) { return 0;}" > cuda_test.cu
  521. $NVCC $NVCCFLAGS -c cuda_test.cu >/dev/null 2>&1
  522. if test $? -eq 0
  523. then
  524. AC_MSG_RESULT(yes)
  525. else
  526. AC_MSG_RESULT(no)
  527. NVCCFLAGS="$OLD_NVCCFLAGS"
  528. fi
  529. rm -f cuda_test*
  530. fi
  531. # nvcc is a wrapper around GCC, and calls it with the -dumpspecs
  532. # option, which is GCC specific. If $CC does not support -dumpspecs, we
  533. # should let nvcc choose another compiler (by default, gcc, if it is
  534. # installed). If gcc is not installed, the build will probably fail.
  535. $CC -dumpspecs >/dev/null 2>&1
  536. if test $? -eq 0 -a x$starpu_windows != xyes; then
  537. NVCCFLAGS="${NVCCFLAGS} -ccbin \${CC}"
  538. fi
  539. if test "$__cuda_include_dir" != "no"; then
  540. STARPU_CUDA_CPPFLAGS="-I$__cuda_include_dir"
  541. NVCCFLAGS="${NVCCFLAGS} -I$__cuda_include_dir"
  542. fi
  543. fi
  544. ])
  545. if test x$enable_cuda = xyes -o x$enable_cuda = xmaybe; then
  546. STARPU_CHECK_CUDA("$cuda_dir", "$cuda_include_dir", "$cuda_lib_dir")
  547. if test "$have_valid_cuda" = "no" ; then
  548. STARPU_CHECK_CUDA("$CUDA_ROOT", "$CUDA_PATH", "$CUDA_INC_PATH", "$CUDA_LIB_PATH")
  549. fi
  550. if test "$have_valid_cuda" = "no" ; then
  551. for f in "/usr/local/cuda" "/c/cuda" "/cygdrive/c/cuda" "/opt/cuda" "$CUDA_ROOT" "$CUDA_PATH" "$CUDA_INC_PATH/.." "$CUDA_INC/.." "$CUDA_BIN/.." "$CUDA_SDK/.." "$CUDA_INSTALL_PATH" "$CUDA_TOOLKIT"; do
  552. if test -n "$f" ; then
  553. STARPU_CHECK_CUDA("$f", "no", "no")
  554. if test "$have_valid_cuda" = "yes" ; then
  555. break
  556. fi
  557. fi
  558. done
  559. fi
  560. # Check cuda is compatible with the C compiler
  561. AC_MSG_CHECKING(whether CUDA is working)
  562. if test "$have_valid_cuda" = "yes" ; then
  563. SAVED_CPPFLAGS="${CPPFLAGS}"
  564. CPPFLAGS="${CPPFLAGS} ${STARPU_CUDA_CPPFLAGS}"
  565. SAVED_LDFLAGS="${LDFLAGS}"
  566. LDFLAGS="${LDFLAGS} ${STARPU_CUDA_LDFLAGS} -lcuda"
  567. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  568. [[#include <cuda.h>]],
  569. [[]]
  570. )],
  571. [
  572. AC_RUN_IFELSE([AC_LANG_PROGRAM(
  573. [[#include <cuda.h>]],
  574. [[]]
  575. )],
  576. [have_valid_cuda="yes"],
  577. [
  578. AC_MSG_RESULT([CUDA found and can be compiled, but compiled application can not be run, is the CUDA path missing in LD_LIBRARY_PATH?])
  579. have_valid_cuda="no"
  580. ])
  581. ],
  582. [
  583. AC_MSG_ERROR([CUDA found, but cuda.h could not be compiled])
  584. have_valid_cuda="no"
  585. ]
  586. )
  587. CPPFLAGS="${SAVED_CPPFLAGS}"
  588. LDFLAGS="${SAVED_LDFLAGS}"
  589. fi
  590. AC_MSG_RESULT($have_valid_cuda)
  591. # in case CUDA was explicitely required, but is not available, this is an error
  592. if test x$enable_cuda = xyes -a x$have_valid_cuda = xno; then
  593. AC_MSG_ERROR([cannot find CUDA])
  594. fi
  595. # now we enable CUDA if and only if a proper setup is available
  596. enable_cuda=$have_valid_cuda
  597. fi
  598. AC_MSG_CHECKING(whether CUDA should be used)
  599. AC_MSG_RESULT($enable_cuda)
  600. AC_SUBST(STARPU_USE_CUDA, $enable_cuda)
  601. AM_CONDITIONAL(STARPU_USE_CUDA, test x$enable_cuda = xyes)
  602. if test x$enable_cuda = xyes; then
  603. AC_DEFINE(STARPU_USE_CUDA, [1], [CUDA support is activated])
  604. # On Darwin, the libstdc++ dependency is not automatically added by nvcc
  605. # case "$target" in
  606. # *-*darwin*) AC_HAVE_LIBRARY([stdc++], []) ;;
  607. # #*-*darwin*) AC_HAVE_LIBRARY([stdc++], [STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lstdc++"]) ;;
  608. # esac
  609. STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lcuda"
  610. STARPU_CUFFT_LDFLAGS="-lcufft"
  611. if test "$F77" = "gfortran" -o "$FC" = "gfortran" ; then
  612. STARPU_CUDA_FORTRAN_LDFLAGS="-lgfortran"
  613. AC_SUBST(STARPU_CUDA_FORTRAN_LDFLAGS)
  614. fi
  615. #in case this is a 64bit setup, we tell nvcc to use a -m64 flag
  616. if test x$SIZEOF_VOID_P = x8; then
  617. NVCCFLAGS="${NVCCFLAGS} -m64"
  618. AC_SUBST(NVCCFLAGS)
  619. fi
  620. AC_CHECK_HEADERS([cuda_gl_interop.h])
  621. fi
  622. dnl Hey dude, are you around?
  623. PKG_PROG_PKG_CONFIG
  624. have_magma=no
  625. if test x$enable_cuda = xyes; then
  626. PKG_CHECK_MODULES([MAGMA], [magma], [
  627. AC_DEFINE([STARPU_HAVE_MAGMA], [1], [Define to 1 if you have the MAGMA library.])
  628. AC_SUBST([STARPU_HAVE_MAGMA], [1])
  629. have_magma=yes
  630. ], [:])
  631. fi
  632. AM_CONDITIONAL(STARPU_HAVE_MAGMA, [test x$have_magma = xyes])
  633. AC_MSG_CHECKING(whether MAGMA should be used)
  634. AC_MSG_RESULT($have_magma)
  635. # cufftDoubleComplex may not be available on an old CUDA setup
  636. AC_CHECK_TYPE(cufftDoubleComplex,
  637. [have_cufftdoublecomplex=yes],
  638. [have_cufftdoublecomplex=no], [#include <cufft.h>])
  639. AM_CONDITIONAL(STARPU_HAVE_CUFFTDOUBLECOMPLEX, test x$have_cufftdoublecomplex = xyes)
  640. if test x$have_cufftdoublecomplex = xyes; then
  641. AC_DEFINE(STARPU_HAVE_CUFFTDOUBLECOMPLEX, [1], [cufftDoubleComplex is available])
  642. fi
  643. # The CURAND library is only available since CUDA 3.2
  644. have_curand=$enable_cuda
  645. if test x$enable_cuda = xyes; then
  646. SAVED_LDFLAGS="${LDFLAGS}"
  647. LDFLAGS="${LDFLAGS} ${STARPU_CUDA_LDFLAGS}"
  648. AC_HAVE_LIBRARY([curand],[have_curand=yes],[have_curand=no])
  649. LDFLAGS="${SAVED_LDFLAGS}"
  650. fi
  651. AC_MSG_CHECKING(whether CURAND is available)
  652. AC_MSG_RESULT($have_curand)
  653. if test x$have_curand = xyes; then
  654. AC_DEFINE(STARPU_HAVE_CURAND,[1], [CURAND is available])
  655. STARPU_CURAND_LDFLAGS="$STARPU_CURAND_LDFLAGS -lcurand"
  656. AC_SUBST(STARPU_CURAND_LDFLAGS)
  657. fi
  658. # Peer transfers are only supported since CUDA 4.0
  659. # Disable them if user explicity wants to disable them
  660. AC_ARG_ENABLE(cuda_memcpy_peer, [AS_HELP_STRING([--disable-cuda-memcpy-peer], [do not allow peer transfers when using CUDA 4.0])],, [enable_cuda_memcpy_peer=yes])
  661. have_cuda_memcpy_peer=no
  662. if test x$enable_cuda_memcpy_peer = xyes -a x$enable_cuda = xyes ; then
  663. SAVED_LDFLAGS="${LDFLAGS}"
  664. LDFLAGS="${LDFLAGS} ${STARPU_CUDA_LDFLAGS}"
  665. AC_CHECK_FUNC([cudaMemcpyPeer], have_cuda_memcpy_peer=yes, have_cuda_memcpy_peer=no)
  666. LDFLAGS="${SAVED_LDFLAGS}"
  667. fi
  668. if test x$have_cuda_memcpy_peer = xyes; then
  669. AC_DEFINE(HAVE_CUDA_MEMCPY_PEER,[1],[Peer transfers are supported in CUDA])
  670. fi
  671. if test x$enable_cuda = xyes; then
  672. if test x$starpu_windows != xyes ; then
  673. STARPU_CUDA_LDFLAGS="$STARPU_CUDA_LDFLAGS -lstdc++"
  674. fi
  675. AC_SUBST(STARPU_CUDA_LDFLAGS)
  676. AC_SUBST(STARPU_CUFFT_LDFLAGS)
  677. AC_SUBST(STARPU_CUDA_CPPFLAGS)
  678. fi
  679. AC_ARG_VAR([NVCC], [CUDA compiler])
  680. AC_ARG_VAR([NVCCFLAGS], [CUDA compiler flags])
  681. ###############################################################################
  682. # #
  683. # OpenCL settings #
  684. # #
  685. ###############################################################################
  686. AC_MSG_CHECKING(maximum number of OpenCL devices)
  687. AC_ARG_ENABLE(maxopencldev, [AS_HELP_STRING([--enable-maxopencldev=<number>],
  688. [maximum number of OPENCL devices])],
  689. nmaxopencldev=$enableval, nmaxopencldev=8)
  690. AC_MSG_RESULT($nmaxopencldev)
  691. AC_DEFINE_UNQUOTED(STARPU_MAXOPENCLDEVS, [$nmaxopencldev],
  692. [maximum number of OPENCL devices])
  693. AC_ARG_ENABLE(opencl, [AS_HELP_STRING([--disable-opencl],
  694. [do not use OpenCL device(s)])],, [enable_opencl=maybe])
  695. have_valid_opencl=no
  696. AC_DEFUN([STARPU_CHECK_OPENCL],
  697. [
  698. __opencl_dir=$1
  699. __opencl_include_dir=$2
  700. __opencl_lib_dir=$3
  701. if test "$__opencl_dir" != "no" ; then
  702. AC_MSG_CHECKING(whether OpenCL is available in $__opencl_dir $__opencl_include_dir and $__opencl_lib_dir)
  703. else
  704. AC_MSG_CHECKING(whether OpenCL is available)
  705. fi
  706. AC_MSG_RESULT()
  707. if test "$__opencl_include_dir" = "no" -a "$__opencl_dir" != "no" ; then
  708. __opencl_include_dir="$__opencl_dir/include"
  709. fi
  710. SAVED_CPPFLAGS="$CPPFLAGS"
  711. SAVED_LDFLAGS="${LDFLAGS}"
  712. if test "$__opencl_include_dir" != "no" ; then
  713. CPPFLAGS="${CPPFLAGS} -I$__opencl_include_dir"
  714. fi
  715. AC_CHECK_HEADER([CL/cl.h],[have_valid_opencl=yes],[have_valid_opencl=no])
  716. unset ac_cv_header_CL_cl_h
  717. if test "$have_valid_opencl" = "yes" ; then
  718. if test "$__opencl_lib_dir" != "no"; then
  719. LDFLAGS="${SAVED_LDFLAGS} -L$__opencl_lib_dir"
  720. AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
  721. unset ac_cv_lib_OpenCL_main
  722. else
  723. AC_MSG_CHECKING(whether OpenCL is available in $__opencl_dir)
  724. AC_MSG_RESULT()
  725. AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
  726. unset ac_cv_lib_OpenCL_main
  727. if test "$have_valid_opencl" = "no" -a "$__opencl_dir" != "no" ; then
  728. for __cuda_libdir in lib64 lib lib/x86 lib/Win32 ; do
  729. __opencl_lib_dir="$__opencl_dir/$__cuda_libdir"
  730. AC_MSG_CHECKING(whether OpenCL is available in $__opencl_dir and $__opencl_lib_dir)
  731. AC_MSG_RESULT()
  732. LDFLAGS="${SAVED_LDFLAGS} -L$__opencl_lib_dir"
  733. AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
  734. unset ac_cv_lib_OpenCL_main
  735. if test "$have_valid_opencl" = yes ; then
  736. break
  737. fi
  738. done
  739. else
  740. LDFLAGS="${SAVED_LDFLAGS}"
  741. AC_HAVE_LIBRARY([OpenCL],[have_valid_opencl=yes],[have_valid_opencl=no])
  742. unset ac_cv_lib_OpenCL_main
  743. fi
  744. fi
  745. fi
  746. if test "$have_valid_opencl" = "yes" -a "$__opencl_include_dir" != "no"; then
  747. STARPU_OPENCL_CPPFLAGS="-I$__opencl_include_dir"
  748. AC_CHECK_HEADERS([CL/cl_ext.h])
  749. fi
  750. CPPFLAGS="${SAVED_CPPFLAGS}"
  751. LDFLAGS="${SAVED_LDFLAGS}"
  752. if test "$have_valid_opencl" = "yes" ; then
  753. if test "$__opencl_lib_dir" != "no"; then
  754. STARPU_OPENCL_LDFLAGS="-L$__opencl_lib_dir"
  755. fi
  756. STARPU_OPENCL_LDFLAGS="${STARPU_OPENCL_LDFLAGS} -lOpenCL"
  757. fi
  758. ])
  759. #AC_MSG_CHECKING(whether OpenCL is available)
  760. AC_ARG_WITH(opencl-dir,
  761. [AS_HELP_STRING([--with-opencl-dir=<path>],
  762. [specify OpenCL installation directory])],
  763. [
  764. opencl_dir="$withval"
  765. # in case this was not explicit yet
  766. enable_opencl=yes
  767. ], opencl_dir=no)
  768. AC_ARG_WITH(opencl-include-dir,
  769. [AS_HELP_STRING([--with-opencl-include-dir=<path>],
  770. [specify where OpenCL headers are installed])],
  771. [
  772. opencl_include_dir="$withval"
  773. # in case this was not explicit yet
  774. enable_opencl=yes
  775. ], [opencl_include_dir=no])
  776. AC_ARG_WITH(opencl-lib-dir,
  777. [AS_HELP_STRING([--with-opencl-lib-dir=<path>],
  778. [specify where OpenCL libraries are installed])],
  779. [
  780. opencl_lib_dir="$withval"
  781. # in case this was not explicit yet
  782. enable_opencl=yes
  783. ], [opencl_lib_dir=no])
  784. AC_DEFUN([STARPU_LOOK_FOR_OPENCL],
  785. [
  786. if test "x$has_opencl_being_checked" != "xyes" ; then
  787. STARPU_CHECK_OPENCL("$opencl_dir", "$opencl_include_dir", "$opencl_lib_dir")
  788. if test "$have_valid_opencl" = "no" ; then
  789. for f in "/usr/local/cuda" "/c/cuda" "/cygdrive/c/cuda" "/opt/cuda" "$CUDA_ROOT" "$CUDA_PATH" "$CUDA_INC_PATH/.." "$CUDA_INSTALL_PATH" "$CUDA_TOOLKIT"; do
  790. if test -n "$f" ; then
  791. STARPU_CHECK_OPENCL("$f", "no", "no")
  792. if test "$have_valid_opencl" = "yes" ; then
  793. break
  794. fi
  795. fi
  796. done
  797. fi
  798. has_opencl_being_checked=yes
  799. fi
  800. ])
  801. if test x$enable_opencl = xyes -o x$enable_opencl = xmaybe; then
  802. case $target in
  803. *-*-darwin*)
  804. AC_MSG_CHECKING(whether OpenCL is available)
  805. SAVED_LIBS=$LIBS
  806. LIBS="$LIBS -framework OpenCL"
  807. AC_LINK_IFELSE(
  808. [AC_LANG_PROGRAM([[
  809. #ifdef __APPLE_CC__
  810. #include <OpenCL/opencl.h>
  811. #else
  812. #include <CL/cl.h>
  813. #endif
  814. ]],
  815. [[return clSetKernelArg(0, 0, 0, 0); ]])],
  816. [AC_MSG_RESULT(yes)
  817. enable_opencl=yes
  818. have_valid_opencl=yes
  819. STARPU_OPENCL_CPPFLAGS=
  820. STARPU_OPENCL_LDFLAGS="-framework OpenCL"],
  821. [AC_MSG_RESULT(no)
  822. enable_opencl=no])
  823. LIBS=$SAVED_LIBS
  824. ;;
  825. *)
  826. STARPU_LOOK_FOR_OPENCL()
  827. # in case OpenCL was explicitely required, but is not available, this is an error
  828. if test x$enable_opencl = xyes -a x$have_valid_opencl = xno; then
  829. AC_MSG_ERROR([cannot find OpenCL])
  830. fi
  831. # now we enable OpenCL if and only if a proper setup is available
  832. enable_opencl=$have_valid_opencl
  833. ;;
  834. esac
  835. save_LIBS="$LIBS"
  836. LIBS="$LIBS $STARPU_OPENCL_LDFLAGS"
  837. AC_CHECK_FUNCS([clEnqueueMarkerWithWaitList])
  838. LIBS="$save_LIBS"
  839. fi
  840. AC_MSG_CHECKING(whether OpenCL should be used)
  841. AC_MSG_RESULT($enable_opencl)
  842. AC_SUBST(STARPU_USE_OPENCL, $enable_opencl)
  843. AM_CONDITIONAL(STARPU_USE_OPENCL, test x$enable_opencl = xyes)
  844. if test x$enable_opencl = xyes ; then
  845. AC_DEFINE(STARPU_USE_OPENCL, [1], [OpenCL support is activated])
  846. STARPU_OPENCL_CPPFLAGS="${STARPU_OPENCL_CPPFLAGS} -DSTARPU_OPENCL_DATADIR=${datarootdir}/starpu/opencl -DCL_USE_DEPRECATED_OPENCL_1_1_APIS"
  847. AC_SUBST(STARPU_OPENCL_DATAdir, "$(eval echo ${datarootdir}/starpu/opencl/examples)")
  848. AC_SUBST(STARPU_OPENCL_CPPFLAGS)
  849. AC_SUBST(STARPU_OPENCL_LDFLAGS)
  850. fi
  851. ###############################################################################
  852. # #
  853. # General GPU settings #
  854. # #
  855. ###############################################################################
  856. AC_MSG_CHECKING(whether asynchronous copy should be disabled)
  857. AC_ARG_ENABLE(asynchronous-copy, [AS_HELP_STRING([--disable-asynchronous-copy],
  858. [disable asynchronous copy between CPU and GPU])],
  859. enable_asynchronous_copy=$enableval, enable_asynchronous_copy=yes)
  860. disable_asynchronous_copy=no
  861. if test x$enable_asynchronous_copy = xno ; then
  862. disable_asynchronous_copy=yes
  863. fi
  864. AC_MSG_RESULT($disable_asynchronous_copy)
  865. if test x$disable_asynchronous_copy = xyes ; then
  866. AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and GPU devices])
  867. fi
  868. AC_MSG_CHECKING(whether asynchronous CUDA copy should be disabled)
  869. AC_ARG_ENABLE(asynchronous-cuda-copy, [AS_HELP_STRING([--disable-asynchronous-cuda-copy],
  870. [disable asynchronous copy between CPU and CUDA devices])],
  871. enable_asynchronous_cuda_copy=$enableval, enable_asynchronous_cuda_copy=yes)
  872. disable_asynchronous_cuda_copy=no
  873. if test x$enable_asynchronous_cuda_copy = xno ; then
  874. disable_asynchronous_cuda_copy=yes
  875. fi
  876. AC_MSG_RESULT($disable_asynchronous_cuda_copy)
  877. if test x$disable_asynchronous_cuda_copy = xyes ; then
  878. AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_CUDA_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and CUDA devices])
  879. fi
  880. AC_MSG_CHECKING(whether asynchronous OpenCL copy should be disabled)
  881. AC_ARG_ENABLE(asynchronous-opencl-copy, [AS_HELP_STRING([--disable-asynchronous-opencl-copy],
  882. [disable asynchronous copy between CPU and OPENCL devices])],
  883. enable_asynchronous_opencl_copy=$enableval, enable_asynchronous_opencl_copy=yes)
  884. disable_asynchronous_opencl_copy=no
  885. if test x$enable_asynchronous_opencl_copy = xno ; then
  886. disable_asynchronous_opencl_copy=yes
  887. fi
  888. AC_MSG_RESULT($disable_asynchronous_opencl_copy)
  889. if test x$disable_asynchronous_opencl_copy = xyes ; then
  890. AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and OpenCL devices])
  891. fi
  892. AC_MSG_CHECKING(whether asynchronous MIC copy should be disabled)
  893. AC_ARG_ENABLE(asynchronous-mic-copy, [AS_HELP_STRING([--disable-asynchronous-mic-copy],
  894. [disable asynchronous copy between CPU and MIC devices])],
  895. enable_asynchronous_mic_copy=$enableval, enable_asynchronous_mic_copy=yes)
  896. disable_asynchronous_mic_copy=no
  897. if test x$enable_asynchronous_mic_copy = xno ; then
  898. disable_asynchronous_mic_copy=yes
  899. fi
  900. AC_MSG_RESULT($disable_asynchronous_mic_copy)
  901. if test x$disable_asynchronous_mic_copy = xyes ; then
  902. AC_DEFINE([STARPU_DISABLE_ASYNCHRONOUS_MIC_COPY], [1], [Define to 1 to disable asynchronous copy between CPU and MIC devices])
  903. fi
  904. ###############################################################################
  905. # #
  906. # Drivers #
  907. # #
  908. ###############################################################################
  909. AC_ARG_ENABLE(opencl-simulator, [AS_HELP_STRING([--enable-opencl-simulator],
  910. [Enable the use of an OpenCL simulator])],
  911. enable_opencl_simulator=$enableval, enable_opencl_simulator=no)
  912. if test x$enable_opencl_simulator = xyes; then
  913. enable_simgrid=yes
  914. AC_DEFINE(STARPU_OPENCL_SIMULATOR, [1], [Define this to enable using an OpenCL simulator])
  915. fi
  916. AC_ARG_WITH(simgrid-dir,
  917. [AS_HELP_STRING([--with-simgrid-dir=<path>],
  918. [specify SimGrid installation directory])],
  919. [
  920. simgrid_dir="$withval"
  921. # in case this was not explicit yet
  922. enable_simgrid=yes
  923. ], simgrid_dir=no)
  924. AC_ARG_WITH(simgrid-include-dir,
  925. [AS_HELP_STRING([--with-simgrid-include-dir=<path>],
  926. [specify where SimGrid headers are installed])],
  927. [
  928. simgrid_include_dir="$withval"
  929. # in case this was not explicit yet
  930. enable_simgrid=yes
  931. ], [simgrid_include_dir=no])
  932. AC_ARG_WITH(simgrid-lib-dir,
  933. [AS_HELP_STRING([--with-simgrid-lib-dir=<path>],
  934. [specify where SimGrid libraries are installed])],
  935. [
  936. simgrid_lib_dir="$withval"
  937. # in case this was not explicit yet
  938. enable_simgrid=yes
  939. ], [simgrid_lib_dir=no])
  940. AC_ARG_ENABLE(simgrid, [AS_HELP_STRING([--enable-simgrid],
  941. [Enable simulating execution in simgrid])],
  942. enable_simgrid=$enableval, enable_simgrid=no)
  943. if test x$enable_simgrid = xyes ; then
  944. if test -n "$SIMGRID_CFLAGS" ; then
  945. CFLAGS="$SIMGRID_CFLAGS $CFLAGS"
  946. CXXFLAGS="$SIMGRID_CFLAGS $CXXFLAGS"
  947. NVCCFLAGS="$SIMGRID_CFLAGS $NVCCFLAGS"
  948. fi
  949. if test -n "$SIMGRID_LIBS" ; then
  950. LDFLAGS="$SIMGRID_LIBS $LDFLAGS"
  951. fi
  952. if test "$simgrid_dir" != "no" ; then
  953. CFLAGS="-I$simgrid_dir/include $CFLAGS"
  954. CXXFLAGS="-I$simgrid_dir/include $CXXFLAGS"
  955. NVCCFLAGS="-I$simgrid_dir/include $NVCCFLAGS"
  956. LDFLAGS="-L$simgrid_dir/lib $LDFLAGS"
  957. fi
  958. if test "$simgrid_include_dir" != "no" ; then
  959. CFLAGS="-I$simgrid_include_dir $CFLAGS"
  960. CXXFLAGS="-I$simgrid_include_dir $CXXFLAGS"
  961. NVCCFLAGS="-I$simgrid_include_dir $NVCCFLAGS"
  962. fi
  963. if test "$simgrid_lib_dir" != "no" ; then
  964. LDFLAGS="-L$simgrid_lib_dir $LDFLAGS"
  965. fi
  966. AC_HAVE_LIBRARY([simgrid], [],
  967. [
  968. AC_MSG_ERROR(Simgrid support needs simgrid installed)
  969. ]
  970. )
  971. AC_CHECK_HEADERS([simgrid/msg.h], [AC_DEFINE([STARPU_HAVE_SIMGRID_MSG_H], [1], [Define to 1 if you have msg.h in simgrid/.])])
  972. AC_CHECK_FUNCS([MSG_process_join MSG_process_attach MSG_get_as_by_name MSG_environment_get_routing_root MSG_host_get_speed xbt_mutex_try_acquire smpi_process_set_user_data])
  973. AC_CHECK_FUNCS([xbt_barrier_init], [AC_DEFINE([STARPU_SIMGRID_HAVE_XBT_BARRIER_INIT], [1], [Define to 1 if you have the `xbt_barrier_init' function.])])
  974. AC_CHECK_DECLS([smpi_process_set_user_data], [], [], [[#include <smpi/smpi.h>]])
  975. AC_CHECK_FUNCS([SIMIX_process_get_code], [AC_DEFINE([STARPU_SIMGRID_HAVE_SIMIX_PROCESS_GET_CODE], [1], [Define to 1 if you have the `SIMIX_process_get_code' function.])])
  976. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  977. [[
  978. #ifdef STARPU_HAVE_SIMGRID_MSG_H
  979. #include <simgrid/msg.h>
  980. #else
  981. #include <msg/msg.h>
  982. #endif
  983. ]],
  984. [[msg_host_t foo; ]]
  985. )],
  986. [],
  987. [
  988. AC_MSG_ERROR(StarPU needs a version of Simgrid which defines the type msg_host_t (should be any version >= 3.8.1))
  989. ])
  990. AC_DEFINE(STARPU_SIMGRID, [1], [Define this to enable simgrid execution])
  991. # We won't bind or detect anything
  992. with_hwloc=no
  993. # Simgrid 3.12 & 3.13 need -std=c++11 to be able to build anything in C++...
  994. AC_LANG_PUSH([C++])
  995. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  996. #ifdef HAVE_SIMGRID_MSG_H
  997. #include <simgrid/msg.h>
  998. #include <simgrid/host.h>
  999. #else
  1000. #include <msg/msg.h>
  1001. #endif
  1002. ]])],,
  1003. CXXFLAGS="-std=c++11 $CXXFLAGS"
  1004. NVCCFLAGS="-std=c++11 $NVCCFLAGS")
  1005. AC_LANG_POP([C++])
  1006. fi
  1007. AM_CONDITIONAL(STARPU_SIMGRID, test x$enable_simgrid = xyes)
  1008. AC_SUBST(SIMGRID_CFLAGS)
  1009. AC_SUBST(SIMGRID_LIBS)
  1010. AC_MSG_CHECKING(whether SimGrid is enabled)
  1011. AC_MSG_RESULT($enable_simgrid)
  1012. AC_MSG_CHECKING(whether blocking drivers should be enabled)
  1013. AC_ARG_ENABLE(blocking-drivers, [AS_HELP_STRING([--enable-blocking-drivers], [enable blocking drivers])],
  1014. enable_blocking=$enableval, enable_blocking=$enable_simgrid)
  1015. AC_MSG_RESULT($enable_blocking)
  1016. if test x$enable_blocking = xno ; then
  1017. AC_DEFINE(STARPU_NON_BLOCKING_DRIVERS, [1], [drivers must progress])
  1018. fi
  1019. ###############################################################################
  1020. # #
  1021. # Multiple linear regression #
  1022. # #
  1023. ###############################################################################
  1024. AC_ARG_ENABLE(mlr, [AS_HELP_STRING([--disable-mlr],
  1025. [Disable multiple linear regression models])],
  1026. enable_mlr=$enableval, enable_mlr=yes)
  1027. AC_MSG_CHECKING(whether multiple linear regression models are disabled)
  1028. if test x$enable_mlr = xyes -a "$starpu_windows" != "yes" ; then
  1029. AC_MSG_RESULT(no)
  1030. install_min_dgels=no
  1031. STARPU_SEARCH_LIBS(LAPACK,[dgels_],[lapack],use_system_lapack=yes,,)
  1032. if test x$use_system_lapack = xyes; then
  1033. AC_DEFINE(STARPU_MLR_MODEL, [1], [use reflapack library])
  1034. LDFLAGS="-llapack $LDFLAGS"
  1035. else
  1036. AC_MSG_CHECKING(whether min-dgels is linked)
  1037. if test x"$DGELS_LIBS" != x; then
  1038. AC_MSG_RESULT(yes)
  1039. AC_DEFINE(STARPU_MLR_MODEL, [1], [use user defined library])
  1040. AC_ARG_VAR([DGELS_LIBS], [linker flags for lapack dgels])
  1041. else
  1042. AC_MSG_RESULT(no)
  1043. AC_MSG_CHECKING(min-dgels source)
  1044. cp -r $srcdir/min-dgels $PWD/
  1045. AC_MSG_RESULT(yes)
  1046. DGELS_LIBS="-Wl,--start-group $STARPU_BUILD_DIR/min-dgels/build/*.a -Wl,--end-group"
  1047. AC_DEFINE(STARPU_MLR_MODEL, [1], [use user defined library])
  1048. AC_ARG_VAR([DGELS_LIBS], [linker flags for lapack dgels])
  1049. install_min_dgels=yes
  1050. fi
  1051. fi
  1052. else
  1053. AC_MSG_RESULT(yes)
  1054. fi
  1055. AM_CONDITIONAL(STARPU_USE_MIN_DGELS, test x$install_min_dgels = xyes)
  1056. ###############################################################################
  1057. # #
  1058. # MIC settings #
  1059. # #
  1060. ###############################################################################
  1061. # ignore these otions, only meant for mic-configure, but also passed here.
  1062. AC_ARG_ENABLE(native-mic)
  1063. AC_ARG_WITH(compiler)
  1064. AC_ARG_WITH(mic-param)
  1065. AC_ARG_WITH(host-param)
  1066. AC_MSG_CHECKING(maximum number of MIC devices)
  1067. AC_ARG_ENABLE(maxmicdev, [AS_HELP_STRING([--enable-maxmicdev=<number>],
  1068. [maximum number of MIC devices])],
  1069. nmaxmicdev=$enableval, nmaxmicdev=4)
  1070. AC_MSG_RESULT($nmaxmicdev)
  1071. AC_DEFINE_UNQUOTED(STARPU_MAXMICDEVS, [$nmaxmicdev],
  1072. [maximum number of MIC devices])
  1073. AC_MSG_CHECKING(maximum number of MIC threads)
  1074. AC_ARG_ENABLE(maxmicthreads, [AS_HELP_STRING([--enable-maxmicthreads=<number>],
  1075. [maximum number of MIC threads])],
  1076. nmaxmicthreads=$enableval, nmaxmicthreads=120)
  1077. AC_MSG_RESULT($nmaxmicthread)
  1078. AC_DEFINE_UNQUOTED(STARPU_MAXMICCORES, [$nmaxmicthreads],
  1079. [maximum number of MIC cores])
  1080. AC_ARG_WITH(coi-dir,
  1081. [AS_HELP_STRING([--with-coi-dir=<path>],
  1082. [specify the MIC's COI installation directory])],
  1083. [coi_dir="$withval"],
  1084. [coi_dir=no])
  1085. AC_ARG_WITH(coi-include-dir,
  1086. [AS_HELP_STRING([--with-coi-include-dir=<path>],
  1087. [specify where the MIC's COI headers are installed])],
  1088. [coi_include_dir="$withval"],
  1089. [coi_include_dir=no])
  1090. AC_ARG_WITH(coi-lib-dir,
  1091. [AS_HELP_STRING([--with-coi-lib-dir=<path>],
  1092. [specify where the MIC's COI libraries are installed])],
  1093. [coi_lib_dir="$withval"],
  1094. [coi_lib_dir=no])
  1095. AC_DEFUN([STARPU_CHECK_COI_RUNTIME],
  1096. [
  1097. __coi_dir=$1
  1098. __coi_include_dir=$2
  1099. __coi_lib_dir=$3
  1100. if test "$__coi_dir" != "no" -a "$__coi_dir" != "" ; then
  1101. AC_MSG_CHECKING(whether MIC's COI runtime is available in $__coi_dir)
  1102. else
  1103. AC_MSG_CHECKING(whether MIC's COI runtime is available)
  1104. fi
  1105. AC_MSG_RESULT()
  1106. if test "$__coi_include_dir" = "no" -a "$__coi_dir" != "no" ; then
  1107. __coi_include_dir="${__coi_dir}/include"
  1108. fi
  1109. if test "$__coi_lib_dir" = "no" -a "$__coi_dir" != "no" ; then
  1110. __coi_lib_dir="${__coi_dir}/lib"
  1111. fi
  1112. SAVED_CPPFLAGS="$CPPFLAGS"
  1113. SAVED_LDFLAGS="$LDFLAGS"
  1114. if test "$__coi_include_dir" != "no" ; then
  1115. CPPFLAGS="${CPPFLAGS} -I$__coi_include_dir"
  1116. fi
  1117. if test "$__coi_lib_dir" != "no" ; then
  1118. LDFLAGS="${LDFLAGS} -L$__coi_lib_dir ${STARPU_SCIF_LDFLAGS}"
  1119. fi
  1120. AC_CHECK_HEADER([source/COIEngine_source.h],[have_valid_coi=yes],[have_valid_coi=no])
  1121. if test "$have_valid_coi" = "yes" ; then
  1122. AC_HAVE_LIBRARY([$4],[have_valid_coi=yes],[have_valid_coi=no])
  1123. if test "$have_valid_coi" = "no" ; then
  1124. if test "$3" = "no" -a "$__coi_dir" != "no" ; then
  1125. # ${__coi_dir}/lib didn't work, let's try with lib64
  1126. __coi_lib_dir="$__coi_dir/lib64"
  1127. LDFLAGS="${SAVED_LDFLAGS} -L$__coi_lib_dir"
  1128. AC_HAVE_LIBRARY([$4],[have_valid_coi=yes],[have_valid_coi=no])
  1129. fi
  1130. fi
  1131. fi
  1132. if test "$have_valid_coi" = "yes" -a "$__coi_include_dir" != "no"; then
  1133. STARPU_COI_CPPFLAGS="-I$__coi_include_dir"
  1134. fi
  1135. if test "$have_valid_coi" = "yes" ; then
  1136. if test "$__coi_lib_dir" != "no"; then
  1137. STARPU_COI_LDFLAGS="-L$__coi_lib_dir"
  1138. fi
  1139. STARPU_COI_LDFLAGS="${STARPU_COI_LDFLAGS} -l$4"
  1140. fi
  1141. CPPFLAGS="${SAVED_CPPFLAGS}"
  1142. LDFLAGS="${SAVED_LDFLAGS}"
  1143. ])
  1144. AC_ARG_WITH(scif-dir,
  1145. [AS_HELP_STRING([--with-scif-dir=<path>],
  1146. [specify the MIC's SCIF installation directory])],
  1147. [scif_dir="$withval"],
  1148. [scif_dir=no])
  1149. AC_ARG_WITH(scif-include-dir,
  1150. [AS_HELP_STRING([--with-scif-include-dir=<path>],
  1151. [specify where the MIC's SCIF headers are installed])],
  1152. [scif_include_dir="$withval"],
  1153. [scif_include_dir=no])
  1154. AC_ARG_WITH(scif-lib-dir,
  1155. [AS_HELP_STRING([--with-scif-lib-dir=<path>],
  1156. [specify where the MIC's SCIF libraries are installed])],
  1157. [scif_lib_dir="$withval"],
  1158. [scif_lib_dir=no])
  1159. AC_DEFUN([STARPU_CHECK_SCIF_RUNTIME],
  1160. [
  1161. __scif_dir=$1
  1162. __scif_include_dir=$2
  1163. __scif_lib_dir=$3
  1164. if test "$__scif_dir" != "no" -a "$__scif_dir" != "" ; then
  1165. AC_MSG_CHECKING(whether MIC's SCIF runtime is available in $__scif_dir)
  1166. else
  1167. AC_MSG_CHECKING(whether MIC's SCIF runtime is available)
  1168. fi
  1169. AC_MSG_RESULT()
  1170. if test "$__scif_include_dir" = "no" -a "$__scif_dir" != "no" ; then
  1171. __scif_include_dir="${__scif_dir}/include"
  1172. fi
  1173. if test "$__scif_lib_dir" = "no" -a "$__scif_dir" != "no" ; then
  1174. __scif_lib_dir="${__scif_dir}/lib"
  1175. fi
  1176. SAVED_CPPFLAGS="$CPPFLAGS"
  1177. SAVED_LDFLAGS="$LDFLAGS"
  1178. if test "$__scif_include_dir" != "no" ; then
  1179. CPPFLAGS="${CPPFLAGS} -I$__scif_include_dir"
  1180. fi
  1181. if test "$__scif_lib_dir" != "no" ; then
  1182. LDFLAGS="${LDFLAGS} -L$__scif_lib_dir"
  1183. fi
  1184. # AC_CHECK_HEADER([source/SCIFEngine_source.h],[have_valid_scif=yes],[have_valid_scif=no])
  1185. # if test "$have_valid_scif" = "yes" ; then
  1186. AC_HAVE_LIBRARY([scif],[have_valid_scif=yes],[have_valid_scif=no])
  1187. if test "$have_valid_scif" = "no" ; then
  1188. if test "$3" = "no" -a "$__scif_dir" != "no" ; then
  1189. # ${__scif_dir}/lib didn't work, let's try with lib64
  1190. __scif_lib_dir="$__scif_dir/lib64"
  1191. LDFLAGS="${SAVED_LDFLAGS} -L$__scif_lib_dir"
  1192. AC_HAVE_LIBRARY([scif],[have_valid_scif=yes],[have_valid_scif=no])
  1193. fi
  1194. fi
  1195. # fi
  1196. if test "$have_valid_scif" = "yes" -a "$__scif_include_dir" != "no"; then
  1197. STARPU_SCIF_CPPFLAGS="-I$__scif_include_dir"
  1198. fi
  1199. if test "$have_valid_scif" = "yes" ; then
  1200. if test "$__scif_lib_dir" != "no"; then
  1201. STARPU_SCIF_LDFLAGS="-L$__scif_lib_dir"
  1202. fi
  1203. STARPU_SCIF_LDFLAGS="${STARPU_SCIF_LDFLAGS} -lscif"
  1204. fi
  1205. CPPFLAGS="${SAVED_CPPFLAGS}"
  1206. LDFLAGS="${SAVED_LDFLAGS}"
  1207. ])
  1208. if test x$enable_mic = xyes ; then
  1209. STARPU_CHECK_SCIF_RUNTIME($scif_dir, $scif_include_dir, $scif_lib_dir)
  1210. if test "$have_valid_scif" = "no" ; then
  1211. AC_MSG_ERROR([cannot find MIC's SCIF runtime])
  1212. fi
  1213. case $host_vendor in
  1214. *1om)
  1215. # We are cross-compiling.
  1216. # Let's have a look for the device runtime which lib has a different name
  1217. STARPU_CHECK_COI_RUNTIME($coi_dir, $coi_include_dir, $coi_lib_dir, coi_device)
  1218. ;;
  1219. *)
  1220. STARPU_CHECK_COI_RUNTIME($coi_dir, $coi_include_dir, $coi_lib_dir, coi_host)
  1221. ;;
  1222. esac
  1223. if test "$have_valid_coi" = "no" ; then
  1224. AC_MSG_ERROR([cannot find MIC's COI runtime])
  1225. fi
  1226. AC_SUBST(STARPU_COI_CPPFLAGS)
  1227. AC_SUBST(STARPU_COI_LDFLAGS)
  1228. AC_SUBST(STARPU_SCIF_CPPFLAGS)
  1229. AC_SUBST(STARPU_SCIF_LDFLAGS)
  1230. fi
  1231. ###############################################################################
  1232. # #
  1233. # SCC settings #
  1234. # #
  1235. ###############################################################################
  1236. AC_ARG_ENABLE([rcce], [AS_HELP_STRING([--disable-rcce],
  1237. [do not use SCC device(s)])], [], enable_rcce=maybe)
  1238. nmaxsccdev=47
  1239. AC_DEFINE_UNQUOTED(STARPU_MAXSCCDEVS, [$nmaxsccdev], [maximum number of SCC devices])
  1240. AC_ARG_WITH(rcce-dir,
  1241. [AS_HELP_STRING([--with-rcce-dir=<path>],
  1242. [specify RCCE installation directory])],
  1243. [
  1244. rcce_dir="$withval"
  1245. enable_rcce=yes
  1246. ],
  1247. rcce_dir=no)
  1248. AC_ARG_WITH(rcce-include-dir,
  1249. [AS_HELP_STRING([--with-rcce-include-dir=<path>],
  1250. [specify where RCCE headers are installed])],
  1251. [
  1252. rcce_include_dir="$withval"
  1253. enable_rcce=yes
  1254. ],
  1255. rcce_include_dir=no)
  1256. AC_ARG_WITH(rcce-lib-dir,
  1257. [AS_HELP_STRING([--with-rcce-lib-dir=<path>],
  1258. [specify where RCCE libraries are installed])],
  1259. [
  1260. rcce_lib_dir="$withval"
  1261. enable_rcce=yes
  1262. ],
  1263. rcce_lib_dir=no)
  1264. if test x$enable_rcce = xyes -o x$enable_rcce = xmaybe ; then
  1265. have_valid_rcce=yes
  1266. SAVED_LDFLAGS="${LDFLAGS}"
  1267. SAVED_CPPFLAGS="${CPPFLAGS}"
  1268. SAVED_LIBS="${LIBS}"
  1269. if test x$rcce_include_dir != xno ; then
  1270. STARPU_RCCE_CPPFLAGS="-I${rcce_include_dir}"
  1271. elif test x$rcce_dir != xno ; then
  1272. STARPU_RCCE_CPPFLAGS="-I${rcce_dir}/include"
  1273. fi
  1274. CPPFLAGS="${CPPFLAGS} ${STARPU_RCCE_CPPFLAGS}"
  1275. AC_CHECK_HEADER([RCCE.h], [], [have_valid_rcce=no])
  1276. if test x$rcce_lib_dir != xno ; then
  1277. STARPU_RCCE_LDFLAGS="-L${rcce_lib_dir}"
  1278. elif test x$rcce_dir != xno ; then
  1279. STARPU_RCCE_LDFLAGS="-L${rcce_lib}/lib"
  1280. fi
  1281. LDFLAGS="${LDFLAGS} ${STARPU_RCCE_LDFLAGS}"
  1282. AC_CHECK_LIB([RCCE_bigflags_nongory_nopwrmgmt], [RCCE_init], [], [have_valid_rcce=no])
  1283. # in case RCCE was explicitely required, but is not available, this is an error
  1284. if test x$enable_rcce = xyes -a x$have_valid_rcce = xno ; then
  1285. AC_MSG_ERROR([cannot find RCCE library])
  1286. fi
  1287. if test x$have_valid_rcce = xyes ; then
  1288. STARPU_RCCE_CPPFLAGS="${STARPU_RCCE_CPPFLAGS} -DSCC"
  1289. STARPU_RCCE_LDFLAGS="${STARPU_RCCE_LDFLAGS} -lRCCE_bigflags_nongory_nopwrmgmt -ldl"
  1290. AC_DEFINE(STARPU_USE_SCC, [1], [SCC support is enabled])
  1291. AC_SUBST(STARPU_RCCE_CFLAGS)
  1292. AC_SUBST(STARPU_RCCE_CPPFLAGS)
  1293. AC_SUBST(STARPU_RCCE_LDFLAGS)
  1294. fi
  1295. LDFLAGS="${SAVED_LDFLAGS}"
  1296. CPPFLAGS="${SAVED_CPPFLAGS}"
  1297. LIBS="${SAVED_LIBS}"
  1298. enable_rcce=$have_valid_rcce
  1299. fi
  1300. AM_CONDITIONAL(STARPU_USE_SCC, test x$enable_rcce = xyes)
  1301. AC_MSG_CHECKING(whether RCCE should be used)
  1302. AC_MSG_RESULT($enable_rcce)
  1303. ###############################################################################
  1304. # #
  1305. # Debug and Performance analysis tools #
  1306. # #
  1307. ###############################################################################
  1308. AC_MSG_CHECKING(whether debug mode should be enabled)
  1309. AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [enable debug mode])],
  1310. enable_debug=$enableval, enable_debug=no)
  1311. AC_MSG_RESULT($enable_debug)
  1312. AC_ARG_ENABLE(spinlock_check, [AS_HELP_STRING([--enable-spinlock-check], [enable spinlock check])], enable_spinlock_check=$enableval, enable_spinlock_check=no)
  1313. AC_ARG_ENABLE(fstack-protector-all, [AS_HELP_STRING([--disable-fstack-protector-all], [disable GCC option -fstack-protector-all])], enable_fstack_protector_all=$enableval, enable_fstack_protector_all=yes)
  1314. if test x$enable_debug = xyes; then
  1315. AC_DEFINE(STARPU_DEBUG, [1], [enable debugging statements])
  1316. CFLAGS="$CFLAGS -O0"
  1317. CXXFLAGS="$CXXFLAGS -O0"
  1318. enable_spinlock_check=yes
  1319. if test x$GCC = xyes; then
  1320. if test x$starpu_windows != xyes ; then
  1321. if test x$enable_fstack_protector_all = xyes ; then
  1322. CFLAGS="$CFLAGS -fstack-protector-all"
  1323. CXXFLAGS="$CXXFLAGS -fstack-protector-all"
  1324. fi
  1325. fi
  1326. fi
  1327. else
  1328. CFLAGS="-O3 $CFLAGS"
  1329. CXXFLAGS="-O3 $CXXFLAGS"
  1330. fi
  1331. if test x$GCC = xyes; then
  1332. CFLAGS+=" -gdwarf-2"
  1333. CXXFLAGS+=" -gdwarf-2"
  1334. LDFLAGS+=" -gdwarf-2"
  1335. fi
  1336. CFLAGS+=" -g3 "
  1337. CXXFLAGS+=" -g3 "
  1338. LDFLAGS+=" -g3 "
  1339. if test x$enable_spinlock_check = xyes; then
  1340. AC_DEFINE(STARPU_SPINLOCK_CHECK, [1], [check spinlock use])
  1341. fi
  1342. AC_MSG_CHECKING(whether extra checks should be performed)
  1343. AC_ARG_ENABLE(fast, [AS_HELP_STRING([--enable-fast],
  1344. [do not enforce assertions])],
  1345. enable_fast=$enableval, enable_fast=no)
  1346. AC_MSG_RESULT($enable_fast)
  1347. if test x$enable_fast = xyes; then
  1348. AC_DEFINE(STARPU_NO_ASSERT, [1], [disable assertions])
  1349. else
  1350. # fortify gets really enabled only with optimizations, avoid enabling it
  1351. # when they optimizations are not enabled, because with some glibc it
  1352. # spews a lot of warnings.
  1353. if test x$enable_debug != xyes; then
  1354. if test x$GCC = xyes; then
  1355. CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=1"
  1356. fi
  1357. fi
  1358. fi
  1359. AC_MSG_CHECKING(whether debug messages should be displayed)
  1360. AC_ARG_ENABLE(verbose, [AS_HELP_STRING([--enable-verbose],
  1361. [display verbose debug messages (--enable-verbose=extra increase the verbosity)])],
  1362. enable_verbose=$enableval, enable_verbose=no)
  1363. AC_MSG_RESULT($enable_verbose)
  1364. if test x$enable_verbose = xyes; then
  1365. AC_DEFINE(STARPU_VERBOSE, [1], [display verbose debug messages])
  1366. fi
  1367. if test x$enable_verbose = xextra; then
  1368. AC_DEFINE(STARPU_VERBOSE, [1], [display verbose debug messages])
  1369. AC_DEFINE(STARPU_EXTRA_VERBOSE, [1], [display verbose debug messages])
  1370. fi
  1371. AC_MSG_CHECKING(whether coverage testing should be enabled)
  1372. AC_ARG_ENABLE(coverage, [AS_HELP_STRING([--enable-coverage],
  1373. [enable coverage checking])],
  1374. enable_coverage=$enableval, enable_coverage=no)
  1375. AC_MSG_RESULT($enable_coverage)
  1376. AC_SUBST(COVERAGE, $enable_coverage)
  1377. AM_CONDITIONAL(STARPU_COVERAGE_ENABLED, [test "x$enable_coverage" = "xyes"])
  1378. if test x$enable_coverage = xyes; then
  1379. CFLAGS="${CFLAGS} --coverage"
  1380. CXXFLAGS="${CXXFLAGS} --coverage"
  1381. LDFLAGS="${LDFLAGS} --coverage"
  1382. LIBS="${LIBS} -lgcov"
  1383. fi
  1384. AC_MSG_CHECKING(whether coverity mode should be enabled)
  1385. AC_ARG_ENABLE(coverity, [AS_HELP_STRING([--enable-coverity], [enable coverity mode])],
  1386. enable_coverity=$enableval, enable_coverity=no)
  1387. AC_MSG_RESULT($enable_coverity)
  1388. AM_CONDITIONAL(STARPU_COVERITY, test x$enable_coverity = xyes)
  1389. # shall we use FxT to generate trace of the execution ?
  1390. AC_MSG_CHECKING(whether FxT traces should be generated)
  1391. AC_ARG_WITH(fxt, [AS_HELP_STRING([--with-fxt[=<dir>]], [generate fxt traces])],
  1392. [
  1393. if test x$withval != xno; then
  1394. use_fxt=yes
  1395. if test x$withval = xyes; then
  1396. AC_MSG_RESULT(yes)
  1397. use_fxt_from_system=yes
  1398. else
  1399. # use specified path
  1400. # TODO check if the dir is actually containing FxT
  1401. use_fxt_from_system=no
  1402. fxtdir=$withval
  1403. AC_MSG_RESULT(yes using $fxtdir)
  1404. AC_SUBST(FXTDIR, $fxtdir)
  1405. fi
  1406. else
  1407. use_fxt=no
  1408. AC_MSG_RESULT(no)
  1409. fi
  1410. ],
  1411. [
  1412. use_fxt=no
  1413. AC_MSG_RESULT(no)
  1414. ])
  1415. AC_SUBST(STARPU_USE_FXT, $use_fxt)
  1416. AM_CONDITIONAL(STARPU_USE_FXT, test x$use_fxt = xyes)
  1417. if test x$use_fxt = xyes; then
  1418. AC_DEFINE(STARPU_USE_FXT, [1], [enable FxT traces])
  1419. AC_DEFINE(CONFIG_FUT, [1], [enable FUT traces])
  1420. if test x$use_fxt_from_system = xno; then
  1421. save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
  1422. PKG_CONFIG_PATH="$fxtdir/lib/pkgconfig:$PKG_CONFIG_PATH"
  1423. PKG_CHECK_MODULES([FXT], [fxt], , [
  1424. AC_MSG_WARN([Old FxT without fxt.pc file, hoping link will succeed])
  1425. FXT_CFLAGS="-I$fxtdir/include/ "
  1426. FXT_LDFLAGS="-L$fxtdir/lib/"
  1427. AC_ARG_VAR(FXT_LDFLAGS)
  1428. FXT_LIBS="-lfxt"
  1429. ])
  1430. PKG_CONFIG_PATH="$save_PKG_CONFIG_PATH"
  1431. else
  1432. PKG_CHECK_MODULES([FXT], [fxt])
  1433. fi
  1434. save_LIBS="$LIBS"
  1435. LIBS="$LIBS $FXT_LIBS"
  1436. save_LDFLAGS="$LDFLAGS"
  1437. LDFLAGS="$LDFLAGS $FXT_LDFLAGS"
  1438. AC_CHECK_FUNCS([enable_fut_flush])
  1439. AC_CHECK_FUNCS([fut_set_filename])
  1440. LDFLAGS="$save_LDFLAGS"
  1441. LIBS="$save_LIBS"
  1442. save_CFLAGS="$CFLAGS"
  1443. CFLAGS="$CFLAGS $FXT_CFLAGS"
  1444. AC_CHECK_DECLS([enable_fut_flush], [], [], [[#include <fut.h>]])
  1445. AC_CHECK_DECLS([fut_set_filename], [], [], [[#include <fut.h>]])
  1446. CFLAGS="$save_CFLAGS"
  1447. if test x$enable_simgrid = xyes -a x$enable_shared = xno ; then
  1448. # simgrid's SMPI needs fxt to be linked in statically for
  1449. # variable privatization to work
  1450. FXT_LIBS="$(pkg-config --variable=libdir fxt)/libfxt.a -Wl,--as-needed $(pkg-config --libs --static fxt) -Wl,--no-as-needed"
  1451. fi
  1452. AC_ARG_ENABLE(paje-codelet-details, [AS_HELP_STRING([--enable-paje-codelet-details],
  1453. [enable details about codelets in the paje trace])],
  1454. enable_paje_codelet_details=$enableval, enable_paje_codelet_details=no)
  1455. if test x$enable_paje_codelet_details = xyes; then
  1456. AC_DEFINE(STARPU_ENABLE_PAJE_CODELET_DETAILS, [1], [enable details about codelets in the paje trace])
  1457. fi
  1458. ##########################################
  1459. # Poti is a library to generate paje trace files
  1460. ##########################################
  1461. PKG_CHECK_MODULES([POTI], [poti], [
  1462. AC_DEFINE(STARPU_HAVE_POTI, [1], [Define to 1 if you have libpoti])
  1463. ], [:])
  1464. FXT_CFLAGS="$FXT_CFLAGS $POTI_CFLAGS"
  1465. FXT_LIBS="$FXT_LIBS $POTI_LIBS"
  1466. fi
  1467. AC_MSG_CHECKING(whether additional locking systems FxT traces should be enabled)
  1468. AC_ARG_ENABLE(fxt-lock, [AS_HELP_STRING([--enable-fxt-lock],
  1469. [enable additional locking systems FxT traces])],
  1470. enable_fxt_lock=$enableval, enable_fxt_lock=no)
  1471. AC_MSG_RESULT($enable_fxt_lock)
  1472. if test x$enable_fxt_lock = xyes; then
  1473. AC_DEFINE(STARPU_FXT_LOCK_TRACES, [1], [enable additional locking systems FxT traces])
  1474. fi
  1475. AC_MSG_CHECKING(whether performance debugging should be enabled)
  1476. AC_ARG_ENABLE(perf-debug, [AS_HELP_STRING([--enable-perf-debug],
  1477. [enable performance debugging through gprof])],
  1478. enable_perf_debug=$enableval, enable_perf_debug=no)
  1479. AC_MSG_RESULT($enable_perf_debug)
  1480. AC_SUBST(STARPU_PERF_DEBUG, $enable_perf_debug)
  1481. if test x$enable_perf_debug = xyes; then
  1482. AC_DEFINE(STARPU_PERF_DEBUG, [1], [enable performance debug])
  1483. CPPFLAGS="${CPPFLAGS} -pg "
  1484. LDFLAGS="${LDFLAGS} -pg "
  1485. fi
  1486. AC_MSG_CHECKING(whether performance model debugging should be enabled)
  1487. AC_ARG_ENABLE(model-debug, [AS_HELP_STRING([--enable-model-debug],
  1488. [enable performance model debugging])],
  1489. enable_model_debug=$enableval, enable_model_debug=no)
  1490. AC_MSG_RESULT($enable_model_debug)
  1491. if test x$enable_model_debug = xyes; then
  1492. AC_DEFINE(STARPU_MODEL_DEBUG, [1], [enable performance model debug])
  1493. fi
  1494. AC_MSG_CHECKING(whether memory stats should be displayed)
  1495. AC_ARG_ENABLE(memory-stats, [AS_HELP_STRING([--enable-memory-stats],
  1496. [enable memory stats])],
  1497. enable_memory_stats=$enableval, enable_memory_stats=no)
  1498. AC_MSG_RESULT($enable_memory_stats)
  1499. if test x$enable_memory_stats = xyes; then
  1500. AC_DEFINE(STARPU_MEMORY_STATS, [1], [enable memory stats])
  1501. fi
  1502. AC_CHECK_HEADERS([glpk.h], [AC_DEFINE([STARPU_HAVE_GLPK_H], [1], [Define to 1 if you have the <glpk.h> header file.])])
  1503. STARPU_HAVE_LIBRARY(GLPK, [glpk])
  1504. AC_ARG_WITH(ayudame1-include-dir,
  1505. [AS_HELP_STRING([--with-ayudame1-include-dir=<path>],
  1506. [specify where Ayudame version 1 headers are installed])],
  1507. [
  1508. ayudame1_include_dir="$withval"
  1509. if test -n "$ayudame1_include_dir"; then
  1510. CPPFLAGS="-I$ayudame1_include_dir $CPPFLAGS"
  1511. fi
  1512. ], [ayudame1_include_dir=no])
  1513. AC_ARG_WITH(ayudame2-include-dir,
  1514. [AS_HELP_STRING([--with-ayudame2-include-dir=<path>],
  1515. [specify where Ayudame version 2 headers are installed])],
  1516. [
  1517. ayudame2_include_dir="$withval"
  1518. if test -n "$ayudame2_include_dir"; then
  1519. CPPFLAGS="-I$ayudame2_include_dir $CPPFLAGS"
  1520. fi
  1521. ], [ayudame2_include_dir=no])
  1522. # Ayudame 1 header is capitalized
  1523. AC_CHECK_HEADERS([Ayudame.h])
  1524. AC_ARG_ENABLE(ayudame1, [AS_HELP_STRING([--disable-ayudame1],
  1525. [Do not use Ayudame lib version 1])],
  1526. enable_ayudame1=$enableval, enable_ayudame1=yes)
  1527. # Ayudame 2 header is lowercase
  1528. AC_CHECK_HEADERS([ayudame.h])
  1529. AC_ARG_ENABLE(ayudame2, [AS_HELP_STRING([--disable-ayudame2],
  1530. [Do not use Ayudame lib version 2])],
  1531. enable_ayudame2=$enableval, enable_ayudame2=yes)
  1532. if test x$enable_ayudame1 = xyes -a x$ac_cv_header_Ayudame_h = xyes; then
  1533. AC_DEFINE([STARPU_USE_AYUDAME1], [1], [Define to 1 if Ayudame 1 is available and should be used])
  1534. ayu_msg="yes, use version 1"
  1535. else
  1536. if test x$enable_ayudame2 = xyes -a x$ac_cv_header_ayudame_h = xyes; then
  1537. AC_DEFINE([STARPU_USE_AYUDAME2], [1], [Define to 1 if Ayudame 2 is available and should be used])
  1538. ayu_msg="yes, use version 2"
  1539. else
  1540. ayu_msg="no"
  1541. fi
  1542. fi
  1543. AM_CONDITIONAL([STARPU_USE_AYUDAME1], [test "x$enable_ayudame1" = "xyes"])
  1544. AM_CONDITIONAL([STARPU_USE_AYUDAME2], [test "x$enable_ayudame2" = "xyes"])
  1545. ###############################################################################
  1546. # #
  1547. # MPI #
  1548. # #
  1549. ###############################################################################
  1550. AC_ARG_ENABLE(mpi, [AS_HELP_STRING([--disable-mpi],
  1551. [Disable StarPU MPI library generation])],
  1552. [enable_mpi=$enableval],
  1553. [enable_mpi=yes])
  1554. AC_ARG_ENABLE(mpi-master-slave, [AS_HELP_STRING([--enable-mpi-master-slave],
  1555. [Enable StarPU to run with the master-slave mode])],
  1556. use_mpi_master_slave=$enableval,
  1557. use_mpi_master_slave=no)
  1558. #Check MPICC
  1559. AC_ARG_WITH(mpicc, [AS_HELP_STRING([--with-mpicc[=<path to mpicc>]],
  1560. [Path of the mpicc compiler])],
  1561. [
  1562. if test x$withval = xyes; then
  1563. AC_MSG_ERROR(--with-mpicc must be given a pathname)
  1564. else
  1565. mpicc_path=$withval
  1566. fi
  1567. ],
  1568. [
  1569. if test x$enable_simgrid = xyes ; then
  1570. DEFAULT_MPICC=smpicc
  1571. else
  1572. DEFAULT_MPICC=mpicc
  1573. fi
  1574. # nothing was specified: default value is used
  1575. AC_PATH_PROG(mpicc_path, $DEFAULT_MPICC, [no], [$simgrid_dir/bin:$PATH])
  1576. ])
  1577. # We test if the MPICC compiler exists
  1578. if test ! -x $mpicc_path; then
  1579. #MPICC does not exists or is not executable
  1580. AC_MSG_RESULT(The mpicc compiler '$mpicc_path' does not have the execute permission)
  1581. use_mpi=no
  1582. else
  1583. use_mpi=yes
  1584. if test x$enable_simgrid = xyes ; then
  1585. AC_ARG_WITH(smpirun, [AS_HELP_STRING([--with-smpirun[=<path to smpirun>]],
  1586. [Path of the smpirun helper])],
  1587. [
  1588. if test x$withval = xyes; then
  1589. AC_MSG_ERROR(--with-smpirun must be given a pathname)
  1590. else
  1591. smpirun_path=$withval
  1592. fi
  1593. ],
  1594. [
  1595. # nothing was specified: default value is used
  1596. AC_PATH_PROG(smpirun_path, smpirun, [no], [$simgrid_dir/bin:$PATH])
  1597. ])
  1598. fi
  1599. fi
  1600. AC_MSG_CHECKING(mpicc path)
  1601. AC_MSG_RESULT($mpicc_path)
  1602. AC_SUBST(MPICC, $mpicc_path)
  1603. #Check MPICXX/MPIC++
  1604. AC_ARG_WITH(mpicxx, [AS_HELP_STRING([--with-mpicxx[=<path to mpicxx>]],
  1605. [Path of the mpicxx/mpic++ compiler])],
  1606. [
  1607. if test x$withval = xyes; then
  1608. AC_MSG_ERROR(--with-mpicxx must be given a pathname)
  1609. else
  1610. mpicxx_path=$withval
  1611. fi
  1612. ],
  1613. [
  1614. if test x$enable_simgrid = xyes ; then
  1615. DEFAULT_MPICXX=smpicxx
  1616. else
  1617. DEFAULT_MPICXX=mpicxx
  1618. fi
  1619. # nothing was specified: default value is used
  1620. AC_PATH_PROG(mpicxx_path, $DEFAULT_MPICXX, [no], [$simgrid_dir/bin:$PATH])
  1621. # try with mpic++ if mpicxx was not found
  1622. if test x$mpicxx_path = xno ; then
  1623. DEFAULT_MPICXX=mpic++
  1624. AC_PATH_PROG(mpicxx_path, $DEFAULT_MPICXX, [no], [$simgrid_dir/bin:$PATH])
  1625. fi
  1626. ])
  1627. # We test if the MPICXX/MPIC++ compiler exists
  1628. if test ! -x $mpicxx_path; then
  1629. #MPICXX/MPIC++ does not exists or is not executable
  1630. AC_MSG_RESULT(The mpicxx compiler '$mpicxx_path' does not have the execute permission)
  1631. use_mpicxx=no
  1632. else
  1633. use_mpicxx=yes
  1634. fi
  1635. AC_MSG_CHECKING(mpicxx/mpic++ path)
  1636. AC_MSG_RESULT($mpicxx_path)
  1637. AC_SUBST(MPICXX, $mpicxx_path)
  1638. if test x$use_mpi = xyes -a x$enable_mpi = xyes; then
  1639. cc_or_mpicc=$mpicc_path
  1640. # For some reason, libtool uses gcc instead of mpicc when linking
  1641. # libstarpumpi.
  1642. # On Darwin (and maybe other systems ?) the linker will fail (undefined
  1643. # references to MPI_*). We manually add the required flags to fix this
  1644. # issue.
  1645. AC_SUBST(MPICC_LDFLAGS, `$mpicc_path --showme:link`)
  1646. else
  1647. cc_or_mpicc=$CC
  1648. fi
  1649. AC_SUBST(CC_OR_MPICC, $cc_or_mpicc)
  1650. # If the user specifically asks for it, or if we are in a developer checkout, we enable mpi check
  1651. AC_ARG_ENABLE(mpi-check, AC_HELP_STRING([--enable-mpi-check], [Enable execution of MPI testcases]))
  1652. running_mpi_check=no
  1653. if test $svndir = 1 -o -d "$srcdir/.git" ; then
  1654. running_mpi_check=yes
  1655. fi
  1656. if test x$enable_mpi_check = xyes ; then
  1657. running_mpi_check=yes
  1658. fi
  1659. if test x$enable_mpi_check = xno ; then
  1660. running_mpi_check=no
  1661. fi
  1662. # Check if mpiexec is available
  1663. AC_ARG_WITH(mpiexec, [AS_HELP_STRING([--with-mpiexec[=<path to mpiexec>]],
  1664. [Path of mpiexec])],
  1665. [
  1666. if test x$withval = xyes; then
  1667. AC_MSG_ERROR(--with-mpiexec must be given a pathname)
  1668. else
  1669. mpiexec_path=$withval
  1670. fi
  1671. ],
  1672. [
  1673. # nothing was specified: look in the path
  1674. AC_PATH_PROG(mpiexec_path, mpiexec, [no], [$(dirname $mpicc_path):$PATH])
  1675. ])
  1676. AC_MSG_CHECKING(whether mpiexec is available)
  1677. AC_MSG_RESULT($mpiexec_path)
  1678. # We test if MPIEXEC exists
  1679. if test ! -x $mpiexec_path; then
  1680. #MPIEXEC does not exists or is not executable
  1681. AC_MSG_RESULT(The mpiexec script is not valid)
  1682. running_mpi_check=no
  1683. mpiexec_path=""
  1684. fi
  1685. AM_CONDITIONAL(STARPU_MPI_CHECK, test x$running_mpi_check = xyes)
  1686. if test x$use_mpi = xyes ; then
  1687. AC_MSG_CHECKING(whether MPI tests should be run)
  1688. AC_MSG_RESULT($running_mpi_check)
  1689. AC_SUBST(MPIEXEC,$mpiexec_path)
  1690. fi
  1691. #We can only build StarPU MPI Library if User wants it and MPI is available
  1692. if test x$use_mpi = xyes -a x$enable_mpi = xyes ; then
  1693. build_mpi_lib=yes
  1694. else
  1695. build_mpi_lib=no
  1696. fi
  1697. AC_MSG_CHECKING(whether the StarPU MPI library should be generated)
  1698. AC_MSG_RESULT($build_mpi_lib)
  1699. AC_SUBST(USE_MPI, $build_mpi_lib)
  1700. AM_CONDITIONAL(USE_MPI, test x$build_mpi_lib = xyes)
  1701. if test x$build_mpi_lib = xyes; then
  1702. AC_DEFINE(STARPU_USE_MPI,[1],[whether the StarPU MPI library is available])
  1703. else
  1704. running_mpi_check=no
  1705. fi
  1706. AC_ARG_WITH(mpiexec-args, [AS_HELP_STRING([--with-mpiexec-args[=<arguments to give when running mpiexec>]],
  1707. [Arguments for mpiexec])],
  1708. [
  1709. mpiexec_args=$withval
  1710. ])
  1711. AC_SUBST(MPIEXEC_ARGS,$mpiexec_args)
  1712. AC_ARG_ENABLE(mpi-progression-hook, [AS_HELP_STRING([--enable-mpi-progression-hook],
  1713. [Enable StarPU MPI activity polling method])],
  1714. enable_mpi_progression_hook=$enableval, enable_mpi_progression_hook=no)
  1715. if test x$enable_mpi_progression_hook = xyes; then
  1716. AC_DEFINE(STARPU_MPI_ACTIVITY, [1], [enable StarPU MPI activity polling method])
  1717. fi
  1718. #We can only build MPI Master Slave if User wants it and MPI is available
  1719. if test x$use_mpi_master_slave = xyes -a x$use_mpi = xyes -a x$use_mpicxx = xyes; then
  1720. build_mpi_master_slave=yes
  1721. else
  1722. build_mpi_master_slave=no
  1723. fi
  1724. if test x$build_mpi_master_slave = xyes; then
  1725. AC_DEFINE(STARPU_USE_MPI_MASTER_SLAVE, [1], [MPI Master Slave support is enabled])
  1726. CC=$mpicc_path
  1727. CCLD=$mpicc_path
  1728. CXX=$mpicxx_path
  1729. CXXLD=mpicxx_path
  1730. fi
  1731. AC_MSG_CHECKING(whether the master-slave mode should be enabled)
  1732. AC_MSG_RESULT($build_mpi_master_slave)
  1733. AM_CONDITIONAL([STARPU_USE_MPI_MASTER_SLAVE], [test x$build_mpi_master_slave = xyes])
  1734. AC_MSG_CHECKING(maximum number of MPI master-slave devices)
  1735. AC_ARG_ENABLE(maxmpidev, [AS_HELP_STRING([--enable-maxmpidev=<number>],
  1736. [maximum number of MPI master-slave devices])],
  1737. nmaxmpidev=$enableval,
  1738. [
  1739. if test x$build_mpi_master_slave = xyes; then
  1740. nmaxmpidev=4
  1741. else
  1742. nmaxmpidev=0
  1743. fi
  1744. ])
  1745. AC_MSG_RESULT($nmaxmpidev)
  1746. AC_DEFINE_UNQUOTED(STARPU_MAXMPIDEVS, [$nmaxmpidev], [maximum number of MPI devices])
  1747. ###############################################################################
  1748. # #
  1749. # Miscellaneous options for StarPU #
  1750. # #
  1751. ###############################################################################
  1752. AC_MSG_CHECKING(how many buffers can be manipulated per task)
  1753. AC_ARG_ENABLE(maxbuffers, [AS_HELP_STRING([--enable-maxbuffers=<nbuffers>],
  1754. [maximum number of buffers per task])],
  1755. nmaxbuffers=$enableval, nmaxbuffers=8)
  1756. AC_MSG_RESULT($nmaxbuffers)
  1757. AC_DEFINE_UNQUOTED(STARPU_NMAXBUFS, [$nmaxbuffers],
  1758. [how many buffers can be manipulated per task])
  1759. AC_MSG_CHECKING(maximum number of nodes to use)
  1760. AC_ARG_ENABLE(maxnodes, [AS_HELP_STRING([--enable-maxnodes=<nnodes>],
  1761. [maximum number of nodes])],
  1762. maxnodes=$enableval, maxnodes=0)
  1763. if test x$maxnodes = x0 ; then
  1764. if test x$enable_simgrid = xyes ; then
  1765. # We still need the room for the virtual CUDA/OpenCL devices
  1766. maxnodes=16
  1767. else
  1768. # We have one memory node shared by all CPU workers, one node per GPU
  1769. # and per MIC device
  1770. # we add nodes to use 3 memory disks
  1771. nodes=4
  1772. if test x$enable_cuda = xyes ; then
  1773. # we could have used nmaxcudadev + 1, but this would certainly give an
  1774. # odd number.
  1775. nodes=`expr $nodes + $nmaxcudadev`
  1776. fi
  1777. if test x$enable_opencl = xyes ; then
  1778. # we could have used nmaxcudadev + 1, but this would certainly give an
  1779. # odd number.
  1780. nodes=`expr $nodes + $nmaxopencldev`
  1781. fi
  1782. if test x$enable_mic = xyes ; then
  1783. nodes=`expr $nodes + $nmaxmicdev`
  1784. fi
  1785. if test x$enable_rcce = xyes ; then
  1786. # Only 1 memory node for the shared memory.
  1787. nodes=`expr $nodes + 1`
  1788. fi
  1789. #nmaxmpidev = 0 if mpi master-slave is disabled
  1790. nodes=`expr $nodes + $nmaxmpidev`
  1791. # set maxnodes to the next power of 2 greater than nodes
  1792. maxnodes=1
  1793. while test "$maxnodes" -lt "$nodes"
  1794. do
  1795. maxnodes=`expr $maxnodes \* 2`
  1796. done
  1797. fi
  1798. fi
  1799. if test $maxnodes -gt 32 ; then
  1800. AC_MSG_ERROR([selected number of nodes ($maxnodes) can not be greater than 32])
  1801. fi
  1802. AC_MSG_CHECKING(maximum number of memory nodes)
  1803. AC_MSG_RESULT($maxnodes)
  1804. AC_DEFINE_UNQUOTED(STARPU_MAXNODES, [$maxnodes],
  1805. [maximum number of memory nodes])
  1806. AC_MSG_CHECKING(whether allocation cache should be used)
  1807. AC_ARG_ENABLE(allocation-cache, [AS_HELP_STRING([--disable-allocation-cache],
  1808. [disable data allocation cache])],
  1809. enable_allocation_cache=$enableval, enable_allocation_cache=yes)
  1810. AC_MSG_RESULT($enable_allocation_cache)
  1811. if test x$enable_allocation_cache = xyes; then
  1812. AC_DEFINE(STARPU_USE_ALLOCATION_CACHE, [1], [enable data allocation cache])
  1813. fi
  1814. AC_ARG_WITH(perf-model-dir, [AS_HELP_STRING([--with-perf-model-dir=<dir>], [specify where performance models should be stored])],
  1815. [
  1816. if test x$withval = xno; then
  1817. AC_MSG_ERROR(--without-perf-model-dir is not a valid option)
  1818. fi
  1819. perf_model_dir="$withval"
  1820. have_explicit_perf_model_dir=yes
  1821. AC_DEFINE_UNQUOTED(STARPU_PERF_MODEL_DIR, ["$perf_model_dir"], [performance models location])
  1822. ], [
  1823. # by default, we put the performance models in
  1824. # $HOME/.starpu/sampling/
  1825. have_explicit_perf_model_dir=no
  1826. perf_model_dir="\$HOME/.starpu/sampling/"
  1827. ]
  1828. )
  1829. AC_MSG_CHECKING(using explicit performance model location)
  1830. AC_MSG_RESULT($have_explicit_perf_model_dir)
  1831. AC_MSG_CHECKING(performance models location)
  1832. AC_MSG_RESULT($perf_model_dir)
  1833. # On many multicore CPUs, clock cycles are not synchronized
  1834. AC_CHECK_LIB([rt], [clock_gettime])
  1835. AC_CHECK_FUNCS([clock_gettime])
  1836. # Compute the maximum number of workers (we round it to 16 for alignment
  1837. # purposes).
  1838. if test x$enable_simgrid != xyes; then
  1839. if test x$enable_cpu != xyes; then
  1840. maxcpus=0
  1841. fi
  1842. if test x$enable_cuda != xyes; then
  1843. nmaxcudadev=0
  1844. fi
  1845. if test x$enable_opencl != xyes; then
  1846. nmaxopencldev=0
  1847. fi
  1848. if test x$enable_mic != xyes; then
  1849. nmaxmicthreads=0
  1850. fi
  1851. if test x$enable_rcce != xyes; then
  1852. nmaxsccdev=0
  1853. fi
  1854. fi
  1855. #We suppose Master adds nmaxmpidev workers but slaves don't.
  1856. nmaxworkers=`expr 16 \* \( \( $maxcpus + $nmaxcudadev + $nmaxopencldev + $nmaxmicthreads + $nmaxmpidev + $nmaxsccdev + 15 \) / 16 \) `
  1857. AC_MSG_CHECKING(Maximum number of workers)
  1858. AC_MSG_RESULT($nmaxworkers)
  1859. AC_DEFINE_UNQUOTED(STARPU_NMAXWORKERS, [$nmaxworkers], [Maximum number of workers])
  1860. # Computes the maximun number of combined worker
  1861. nmaxcombinedworkers=`expr $maxcpus + $nmaxmicthreads`
  1862. AC_MSG_CHECKING(Maximum number of workers combinations)
  1863. AC_MSG_RESULT($nmaxcombinedworkers)
  1864. AC_DEFINE_UNQUOTED(STARPU_NMAX_COMBINEDWORKERS,
  1865. [$nmaxcombinedworkers], [Maximum number of worker combinations])
  1866. # Computes the maximum number of implementations per arch
  1867. AC_MSG_CHECKING(maximum number of implementations)
  1868. AC_ARG_ENABLE(maximplementations, [AS_HELP_STRING([--enable-maximplementations=<number>],
  1869. [maximum number of implementations])],
  1870. maximplementations=$enableval, maximplementations=4)
  1871. AC_MSG_RESULT($maximplementations)
  1872. AC_DEFINE_UNQUOTED(STARPU_MAXIMPLEMENTATIONS, [$maximplementations],
  1873. [maximum number of implementations])
  1874. # Enable LevelDB support if requested and the lib is found
  1875. AC_ARG_ENABLE(leveldb, [AS_HELP_STRING([--enable-leveldb],
  1876. [Enable linking with LevelDB if available])],
  1877. enable_leveldb=$enableval, enable_leveldb=no)
  1878. if test x$enable_leveldb = xyes; then
  1879. AC_LANG_PUSH([C++])
  1880. AC_CHECK_HEADERS([leveldb/db.h], [AC_DEFINE([STARPU_HAVE_LEVELDB], [1], [Define to 1 if you have the <leveldb/db.h> header file.])])
  1881. STARPU_HAVE_LIBRARY(LEVELDB, [leveldb])
  1882. AC_LANG_POP([C++])
  1883. fi
  1884. AM_CONDITIONAL(STARPU_HAVE_LEVELDB, test "x$enable_leveldb" = "xyes" -a "x$ac_cv_lib_leveldb_main" = "xyes")
  1885. # Defines the calibration heuristic for the history-based calibration of StarPU
  1886. AC_MSG_CHECKING(calibration heuristic of history-based StarPU calibrator)
  1887. AC_ARG_ENABLE(calibration-heuristic, [AS_HELP_STRING([--enable-calibration-heuristic=<number>],
  1888. [Define the maximum authorized deviation of StarPU history-based calibrator.])],
  1889. calibration_heuristic=$enableval, calibration_heuristic=50)
  1890. AC_MSG_RESULT($calibration_heuristic)
  1891. AC_DEFINE_UNQUOTED(STARPU_HISTORYMAXERROR, [$calibration_heuristic], [calibration heuristic value])
  1892. ###############################################################################
  1893. # #
  1894. # MP Common settings #
  1895. # #
  1896. ###############################################################################
  1897. AM_CONDITIONAL([STARPU_USE_MP], [test "x$enable_mic" = "xyes" -o "x$build_mpi_master_slave" = "xyes" -o "x$enable_rcce" = "xyes"])
  1898. AC_ARG_ENABLE([export-dynamic], [AS_HELP_STRING([--disable-export-dynamic],
  1899. [Prevent the linker from adding all symbols to the dynamic symbol table])], [], [])
  1900. if test x$enable_mic = xyes -o x$build_mpi_master_slave = xyes -o x$enable_rcce = xyes ; then
  1901. AC_DEFINE(STARPU_USE_MP, [1], [Message-passing SINKs support
  1902. is enabled])
  1903. if test x$enable_export_dynamic != xno ; then
  1904. STARPU_EXPORT_DYNAMIC="-rdynamic"
  1905. fi
  1906. fi
  1907. AC_SUBST(STARPU_EXPORT_DYNAMIC)
  1908. # Computes the maximum number of different kernels a message-passing sink
  1909. # can lookup for and launch.
  1910. AC_MSG_CHECKING(Maximum number of message-passing kernels)
  1911. AC_ARG_ENABLE(maxmpkernels, [AS_HELP_STRING([
  1912. -enable-maxmpkernels=<number>],
  1913. [maximum number of kernels a message-passing sink can lookup
  1914. for and execute])],
  1915. maxmpkernels=$enableval, maxmpkernels=10)
  1916. AC_MSG_RESULT($maxmpkernels)
  1917. AC_DEFINE_UNQUOTED(STARPU_MAXMPKERNELS, [$maxmpkernels],
  1918. [maximum number of message-passing kernels])
  1919. ###############################################################################
  1920. ###############################################################################
  1921. # #
  1922. # StarPU-Top #
  1923. # #
  1924. ###############################################################################
  1925. AC_ARG_ENABLE([starpu-top],
  1926. [AS_HELP_STRING([--disable-starpu-top],
  1927. [build StarPU-Top])],
  1928. [enable_starpu_top="$enableval"],
  1929. [enable_starpu_top="maybe"])
  1930. # Check whether StarPU-Top can be built
  1931. AC_MSG_CHECKING(for StarPU-Top)
  1932. if test "x$enable_starpu_top" != "xno" ; then
  1933. can_build_starpu_top=no
  1934. AC_PATH_PROGS([QMAKE], [qmake-qt4 qmake], [not-found])
  1935. if test x$QMAKE != xnot-found; then
  1936. QMAKE_VERSION=`$QMAKE --version 2>&1 | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 3`
  1937. if test $QMAKE_VERSION -ge 2 ; then
  1938. PKG_CHECK_EXISTS([QtGui QtNetwork QtOpenGL QtSql], [
  1939. QT_MAJVERSION=`$PKG_CONFIG --modversion QtGui | cut -d '.' -f 1`
  1940. QT_MINVERSION=`$PKG_CONFIG --modversion QtGui | cut -d '.' -f 2`
  1941. if test $QT_MAJVERSION -gt 4 -o \( $QT_MAJVERSION -eq 4 -a $QT_MINVERSION -ge 7 \) ; then
  1942. can_build_starpu_top=yes
  1943. fi
  1944. QWT_PRI=embed
  1945. AC_ARG_WITH(qwt-include-dir,
  1946. [AS_HELP_STRING([--with-qwt-include-dir=<path>],
  1947. [specify installed libqwt include path])],
  1948. [
  1949. STARPU_QWT_INCLUDE="$withval"
  1950. AC_SUBST(STARPU_QWT_INCLUDE)
  1951. QWT_PRI=system
  1952. ])
  1953. AC_ARG_WITH(qwt-lib-dir,
  1954. [AS_HELP_STRING([--with-qwt-lib-dir=<path>],
  1955. [specify installed libqwt library path])],
  1956. [
  1957. STARPU_QWT_LDFLAGS="-L$withval"
  1958. QWT_PRI=system
  1959. ])
  1960. AC_ARG_WITH(qwt-lib,
  1961. [AS_HELP_STRING([--with-qwt-lib=<name>],
  1962. [specify installed libqwt library name])],
  1963. [
  1964. STARPU_QWT_LDFLAGS="${STARPU_QWT_LDFLAGS} -l$withval"
  1965. QWT_PRI=system
  1966. ])
  1967. AC_SUBST(STARPU_QWT_LDFLAGS)
  1968. AC_SUBST(QWT_PRI)
  1969. ])
  1970. fi
  1971. fi
  1972. fi
  1973. if test "x$enable_starpu_top" != "xno" ; then
  1974. build_starpu_top=$can_build_starpu_top
  1975. else
  1976. build_starpu_top=no
  1977. fi
  1978. AC_SUBST(STARPU_USE_TOP, $build_starpu_top)
  1979. AM_CONDITIONAL(BUILD_STARPU_TOP, test "x$build_starpu_top" = "xyes")
  1980. if test "x$build_starpu_top" = "xyes"; then
  1981. AC_DEFINE(STARPU_USE_TOP, [1], [StarPU-Top is activated])
  1982. fi
  1983. ###############################################################################
  1984. # #
  1985. # Flags for C Compiler #
  1986. # #
  1987. ###############################################################################
  1988. # IS_SUPPORTED_CFLAG(flag)
  1989. # ------------------------
  1990. # Check if the CFLAGS `flag' is supported by the compiler
  1991. AC_DEFUN([IS_SUPPORTED_CFLAG],
  1992. [
  1993. AC_REQUIRE([AC_PROG_CC])
  1994. AC_MSG_CHECKING([whether compiler support $1])
  1995. SAVED_CFLAGS="$CFLAGS"
  1996. CFLAGS="$1" # -we10006"
  1997. AC_LINK_IFELSE(
  1998. AC_LANG_PROGRAM(
  1999. [[]],
  2000. [[
  2001. AC_LANG_SOURCE([
  2002. const char *hello = "Hello World";
  2003. ])
  2004. ]]
  2005. ),
  2006. [
  2007. m4_default_nblank([$2], [GLOBAL_AM_CFLAGS="$GLOBAL_AM_CFLAGS $1"])
  2008. AC_MSG_RESULT(yes)
  2009. option_available=1
  2010. ],
  2011. [
  2012. AC_MSG_RESULT(no)
  2013. option_available=0
  2014. ]
  2015. )
  2016. CFLAGS="$SAVED_CFLAGS"
  2017. ])
  2018. IS_SUPPORTED_CFLAG(-Wall)
  2019. IS_SUPPORTED_CFLAG(-Werror=implicit)
  2020. IS_SUPPORTED_CFLAG(-Werror=implicit-function-declaration)
  2021. if test "x$STARPU_DEVEL" != x; then
  2022. AC_DEFINE(STARPU_DEVEL, [1], [enable developer warnings])
  2023. IS_SUPPORTED_CFLAG(-Wextra)
  2024. IS_SUPPORTED_CFLAG(-Wunused)
  2025. IS_SUPPORTED_CFLAG(-Wundef)
  2026. IS_SUPPORTED_CFLAG(-Wshadow)
  2027. IS_SUPPORTED_CFLAG(-Werror=pointer-arith)
  2028. fi
  2029. AM_CONDITIONAL([STARPU_DEVEL],[test "x$STARPU_DEVEL" != x])
  2030. AC_SUBST(GLOBAL_AM_CFLAGS)
  2031. # Same value as Automake's, for use in other places.
  2032. pkglibdir="\${libdir}/$PACKAGE"
  2033. AC_SUBST([pkglibdir])
  2034. ###############################################################################
  2035. # #
  2036. # Fortran #
  2037. # #
  2038. ###############################################################################
  2039. AC_ARG_ENABLE(fortran, [AS_HELP_STRING([--disable-fortran],
  2040. [disable build of fortran examples])],
  2041. enable_build_fortran=$enableval, enable_build_fortran=yes)
  2042. if test "x$FC" != "x"; then
  2043. if $FC --version|grep -q 'GNU Fortran'; then
  2044. gfortran_fc_version=`$FC --version|head -1|sed 's/.*)//;s/^.*\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1.\2.\3/'`
  2045. gfortran_maj_version=`echo $gfortran_fc_version|cut -d. -f1`
  2046. gfortran_min_version=`echo $gfortran_fc_version|cut -d. -f2`
  2047. if test $gfortran_maj_version -lt 4 -o \( $gfortran_maj_version -eq 4 -a $gfortran_min_version -lt 9 \) ; then
  2048. AC_MSG_WARN([GFortran $gfortran_fc_version too old, version >= 4.9.x needed, Fortran examples will not be built])
  2049. enable_build_fortran="no"
  2050. fi
  2051. else
  2052. if $FC -V 2>&1|grep -q 'Intel(R) Fortran'; then
  2053. ifort_fc_version=`$FC -V 2>&1 |head -1|sed 's/.*Version //;s/ Build.*//'`
  2054. ifort_maj_version=`echo $ifort_fc_version|cut -d. -f1`
  2055. if test $ifort_maj_version -lt 16; then
  2056. AC_MSG_WARN([Intel Fortran compiler $ifort_fc_version too old, version >= 2016.x needed, Fortran examples will not be built])
  2057. enable_build_fortran="no"
  2058. fi
  2059. else
  2060. if $FC -qversion 2>&1|grep -q 'IBM XL Fortran'; then
  2061. xlf_fc_version=`$FC -V 2>&1 |tail -1|sed 's/.*Version: //'`
  2062. xlf_maj_version=`echo $xlf_fc_version|cut -d. -f1`
  2063. AC_MSG_WARN([IBM Fortran compiler $xlf_fc_version not validated with the native StarPU Fortran API, Fortran examples will not be built])
  2064. enable_build_fortran="no"
  2065. else
  2066. AC_MSG_WARN(Fortran compiler has not been tested for StarPU native Fortran support)
  2067. fi
  2068. fi
  2069. fi
  2070. if test "x$enable_build_fortran" = "xyes" ; then
  2071. AC_DEFINE(STARPU_HAVE_FC, [1], [Define this if a Fortran compiler is available])
  2072. if test x$build_mpi_lib = xyes -o x$build_mpi_master_slave = xyes ; then
  2073. AC_ARG_WITH(mpifort, [AS_HELP_STRING([--with-mpifort[=<path to mpifort>]],
  2074. [Path of the mpifort compiler])],
  2075. [
  2076. if test x$withval = xyes; then
  2077. AC_MSG_ERROR(--with-mpifort must be given a pathname)
  2078. else
  2079. mpifort_path=$withval
  2080. fi
  2081. ],
  2082. [
  2083. if test x$enable_simgrid = xyes ; then
  2084. DEFAULT_MPIFORT=smpifort
  2085. else
  2086. DEFAULT_MPIFORT=mpif90
  2087. fi
  2088. # nothing was specified: default value is used
  2089. AC_PATH_PROG(mpifort_path, $DEFAULT_MPIFORT, [no], [$(dirname $mpicc_path):$simgrid_dir/bin:$PATH])
  2090. ])
  2091. # We test if the MPIFORT compiler exists
  2092. if test ! -x $mpifort_path; then
  2093. #MPIFORT does not exists or is not executable
  2094. AC_MSG_RESULT(The mpifort compiler '$mpifort_path' does not have the execute permission)
  2095. use_mpi_fort=no
  2096. else
  2097. OLD_CC=$CC
  2098. CC=$mpicc_path
  2099. AC_LINK_IFELSE(
  2100. AC_LANG_PROGRAM(
  2101. [[#include <mpi.h>]],
  2102. [[AC_LANG_SOURCE([return MPI_Comm_f2c(0);])]]
  2103. ),
  2104. [use_mpi_fort=yes],
  2105. [use_mpi_fort=no]
  2106. )
  2107. CC=$OLD_CC
  2108. if test "x$use_mpi_fort" = xyes; then
  2109. AC_DEFINE([HAVE_MPI_COMM_F2C], [1], [Function MPI_Comm_f2c is available])
  2110. AC_MSG_CHECKING(mpifort path)
  2111. AC_MSG_RESULT($mpifort_path)
  2112. AC_SUBST(MPIFORT, $mpifort_path)
  2113. fi
  2114. fi
  2115. fi
  2116. fi
  2117. fi
  2118. if test "x$enable_build_fortran" = "xyes" ; then
  2119. if test "x$FC" = "x" ; then
  2120. enable_build_fortran="no"
  2121. fi
  2122. fi
  2123. #We have MPI C/C++ compiler
  2124. if test x$build_mpi_master_slave = xyes; then
  2125. #Check if we can compile fortran cases
  2126. if test x$use_mpi_fort = xyes ; then
  2127. F77LD=$mpifort_path
  2128. FCLD=$mpifort_path
  2129. F77=$mpifort_path
  2130. FC=$mpifort_path
  2131. else
  2132. enable_build_fortran=no
  2133. fi
  2134. fi
  2135. AM_CONDITIONAL([STARPU_HAVE_FC], [test "x$FC" != "x" -a "x$enable_build_fortran" = "xyes"])
  2136. AM_CONDITIONAL([STARPU_HAVE_F77], [test "x$F77" != "x" -a "x$enable_build_fortran" = "xyes"])
  2137. AM_CONDITIONAL([STARPU_HAVE_MPIFORT], [test "x$use_mpi_fort" = "xyes"])
  2138. ###############################################################################
  2139. # #
  2140. # GCC extensions #
  2141. # #
  2142. ###############################################################################
  2143. AC_ARG_ENABLE([gcc-extensions],
  2144. [AS_HELP_STRING([--enable-gcc-extensions],
  2145. [build the GCC plug-in that provides C language extensions (experimental)])],
  2146. [enable_gcc_plugin="$enableval"],
  2147. [enable_gcc_plugin="maybe"])
  2148. if test "x$enable_gcc_plugin" = "xyes" -o "x$enable_gcc_plugin" = "xmaybe" ; then
  2149. STARPU_GCC_PLUGIN_SUPPORT
  2150. if test "x$ac_cv_have_gcc_plugins" = "xno" ; then
  2151. if test "x$enable_gcc_plugin" = "xyes" ; then
  2152. # Since this was explicitly asked for, error out.
  2153. AC_MSG_ERROR([This compiler lacks GCC plug-in support.])
  2154. else
  2155. AC_MSG_WARN([GCC plug-ins not supported; StarPU's GCC plug-in will not be built])
  2156. fi
  2157. else
  2158. # What GCC version are we using?
  2159. STARPU_GCC_VERSION
  2160. # The `.so' itself cannot be called `starpu-gcc.so' (because
  2161. # `-fplugin-arg-' option names and such must match the `.so'
  2162. # name), so use a meaningful directory name.
  2163. gccplugindir="\${pkglibdir}/${STARPU_EFFECTIVE_VERSION}/gcc/${STARPU_GCC_VERSION_MAJOR}.${STARPU_GCC_VERSION_MINOR}"
  2164. AC_SUBST([gccplugindir])
  2165. # Lines to be inserted in the `.pc' file.
  2166. GCC_PLUGIN_DIR_PKGCONFIG="gccplugindir=$gccplugindir"
  2167. GCC_PLUGIN_PKGCONFIG="gccplugin=\${gccplugindir}/starpu.so"
  2168. AC_SUBST([GCC_PLUGIN_DIR_PKGCONFIG])
  2169. AC_SUBST([GCC_PLUGIN_PKGCONFIG])
  2170. fi
  2171. fi
  2172. AM_CONDITIONAL([HAVE_PTR_DEREFS_MAY_ALIAS_P],
  2173. [test "x$ac_cv_have_decl_ptr_derefs_may_alias_p" = "xyes"])
  2174. if test "x$ac_cv_have_gcc_plugins" = "xyes" ; then
  2175. build_gcc_plugin="yes"
  2176. # GNU Guile 1.8/2.0 is used to run the test suite.
  2177. AC_PATH_PROG([GUILE], [guile])
  2178. if test "x$GUILE" != "x"; then
  2179. if test "x$enable_cpu" = "xyes"; then
  2180. run_gcc_plugin_test_suite="yes"
  2181. else
  2182. AC_MSG_WARN([CPU back-end disabled; GCC plug-in test suite will not be run])
  2183. run_gcc_plugin_test_suite="no"
  2184. fi
  2185. else
  2186. run_gcc_plugin_test_suite="no"
  2187. fi
  2188. else
  2189. build_gcc_plugin="no"
  2190. run_gcc_plugin_test_suite="no"
  2191. fi
  2192. # Bison is used to generate the C expression parser. The generated
  2193. # parser is part of the distribution, though.
  2194. AM_MISSING_PROG([YACC], [bison])
  2195. AM_CONDITIONAL([BUILD_GCC_PLUGIN], [test "x$build_gcc_plugin" = "xyes"])
  2196. AM_CONDITIONAL([RUN_GCC_PLUGIN_TESTS],
  2197. [test "x$run_gcc_plugin_test_suite" = "xyes"])
  2198. ###############################################################################
  2199. # #
  2200. # OpenMP runtime support #
  2201. # #
  2202. ###############################################################################
  2203. AC_ARG_ENABLE(openmp, [AS_HELP_STRING([--enable-openmp],
  2204. [build the OpenMP runtime support])],
  2205. enable_openmp=$enableval, enable_openmp=no)
  2206. AC_MSG_CHECKING(for OpenMP runtime support)
  2207. if test x$enable_openmp = xyes; then
  2208. AC_DEFINE(STARPU_OPENMP, [1], [Define this to enable OpenMP runtime support])
  2209. fi
  2210. AM_CONDITIONAL([STARPU_OPENMP], [test "x$enable_openmp" = "xyes"])
  2211. AC_MSG_RESULT($enable_openmp)
  2212. AM_CONDITIONAL([STARPU_HAVE_OPENMP],[test -n "$OPENMP_CFLAGS"])
  2213. if test -n "{OPENMP_CFLAGS}"; then
  2214. CFLAGS="${CFLAGS} ${OPENMP_CFLAGS}"
  2215. STARPU_OMP_LDFLAGS="${OPENMP_CFLAGS}"
  2216. fi
  2217. ###############################################################################
  2218. # #
  2219. # SOCL interface #
  2220. # #
  2221. ###############################################################################
  2222. AC_ARG_ENABLE([socl],
  2223. [AS_HELP_STRING([--enable-socl],
  2224. [build the OpenCL interface (experimental)])],
  2225. [enable_socl="$enableval"],
  2226. [enable_socl="maybe"])
  2227. AC_MSG_CHECKING(for SOCL)
  2228. # in case SOCL was explicitely required, but is not available, this is an error
  2229. if test "x$enable_socl" = "xyes" -a "$have_valid_opencl" = "no" ; then
  2230. AC_MSG_ERROR([SOCL cannot be enabled without OpenCL])
  2231. fi
  2232. # now we enable SOCL if and only if a proper setup is available
  2233. if test "x$enable_socl" = "xyes" -o "x$enable_socl" = "xmaybe" ; then
  2234. build_socl=$have_valid_opencl
  2235. else
  2236. build_socl=no
  2237. fi
  2238. AC_MSG_RESULT($build_socl)
  2239. AM_CONDITIONAL([BUILD_SOCL], [test "x$build_socl" = "xyes"])
  2240. AM_CONDITIONAL([STARPU_USE_SOCL], [test "x$build_socl" = "xyes"])
  2241. if test "$build_socl" = "yes" ; then
  2242. AC_CHECK_FUNCS([clGetExtensionFunctionAddressForPlatform])
  2243. if test -n "$SOCL_OCL_LIB_OPENCL" -a -f "$SOCL_OCL_LIB_OPENCL" ; then
  2244. run_socl_check=yes
  2245. SOCL_OCL_LIB_OPENCL_DIR=$(dirname $SOCL_OCL_LIB_OPENCL)
  2246. AC_SUBST(SOCL_OCL_LIB_OPENCL_DIR)
  2247. else
  2248. run_socl_check=no
  2249. fi
  2250. else
  2251. run_socl_check=no
  2252. fi
  2253. ###############################################################################
  2254. # #
  2255. # Debugging #
  2256. # #
  2257. ###############################################################################
  2258. AC_PATH_PROG([GDB], [gdb], [not-found])
  2259. if test "x$GDB" != "xnot-found"; then
  2260. AC_DEFINE_UNQUOTED([STARPU_GDB_PATH], ["$GDB"],
  2261. [Path to the GNU debugger.])
  2262. fi
  2263. ###############################################################################
  2264. # #
  2265. # Examples #
  2266. # #
  2267. ###############################################################################
  2268. AC_ARG_ENABLE(build-tests, [AS_HELP_STRING([--disable-build-tests],
  2269. [disable building of tests])],
  2270. enable_build_tests=$enableval, enable_build_tests=yes)
  2271. # check stuff for tests (todo)
  2272. AM_CONDITIONAL(BUILD_TESTS, [test x$enable_build_tests != xno])
  2273. AC_ARG_ENABLE(build-examples, [AS_HELP_STRING([--disable-build-examples],
  2274. [disable building of examples])],
  2275. enable_build_examples=$enableval, enable_build_examples=yes)
  2276. # check stuff for examples (todo)
  2277. AM_CONDITIONAL(BUILD_EXAMPLES, [test x$enable_build_examples != xno])
  2278. AC_ARG_ENABLE(opengl-render, [AS_HELP_STRING([--enable-opengl-render],
  2279. [enable OpenGL rendering of some examples])],
  2280. enable_opengl_render=$enableval, enable_opengl_render=no)
  2281. if test x$enable_opengl_render = xyes; then
  2282. STARPU_CHECK_LIB(OPENGL_RENDER, glut, glutInit,,AC_MSG_ERROR([cannot find glut]))
  2283. STARPU_CHECK_LIB(OPENGL_RENDER, GL, glXCreateContext,,AC_MSG_ERROR([cannot find GL]))
  2284. STARPU_CHECK_LIB(OPENGL_RENDER, GLU, gluLookAt,,AC_MSG_ERROR([cannot find GLU]))
  2285. AC_DEFINE(STARPU_OPENGL_RENDER, [1], [enable OpenGL rendering of some examples])
  2286. fi
  2287. AC_MSG_CHECKING(whether OpenGL rendering is enabled)
  2288. AC_SUBST(STARPU_OPENGL_RENDER, $enable_opengl_render)
  2289. AC_MSG_RESULT($enable_opengl_render)
  2290. AM_CONDITIONAL([HAVE_OPENGL], [test "x$enable_opengl_render" = xyes])
  2291. AC_PATH_XTRA
  2292. if test "x$no_x" != "xyes"; then
  2293. AC_DEFINE(STARPU_HAVE_X11, [1], [enable X11])
  2294. fi
  2295. AM_CONDITIONAL([HAVE_X11], [test "x$no_x" != "xyes"])
  2296. # In case there are BLAS kernels that are used by the example applications
  2297. # we may specify which library to use. Note that this is not used for StarPU
  2298. # itself.
  2299. blas_lib=maybe
  2300. AC_ARG_ENABLE(blas-lib,
  2301. [ --enable-blas-lib[=blaslibname]:
  2302. none [default]: no BLAS lib is used
  2303. atlas: use ATLAS library
  2304. goto: use GotoBLAS library
  2305. mkl: use MKL library (you may need to set specific CFLAGS and LDFLAGS with --with-mkl-cflags and --with-mkl-ldflags)],
  2306. [
  2307. if test "x$enableval" = "xatlas" ; then
  2308. blas_lib=atlas
  2309. elif test "x$enableval" = "xgoto" ; then
  2310. blas_lib=goto
  2311. elif test "x$enableval" = "xnone" ; then
  2312. blas_lib=none
  2313. elif test "x$enableval" = "xmkl" ; then
  2314. blas_lib=mkl
  2315. elif test x$enableval = xno; then
  2316. blas_lib=none
  2317. else
  2318. echo
  2319. echo "Error!"
  2320. echo "Unknown BLAS library"
  2321. exit -1
  2322. fi
  2323. ])
  2324. if test x$blas_lib = xmaybe -o x$blas_lib = xgoto; then
  2325. AC_ARG_WITH(goto-dir, [AS_HELP_STRING([--with-goto-dir=<dir>], [specify GotoBLAS lib location])],
  2326. [
  2327. blas_lib=goto
  2328. gotodir=$withval
  2329. AC_SUBST(GOTODIR, $gotodir)
  2330. CPPFLAGS="${CPPFLAGS} -I$gotodir/ "
  2331. LDFLAGS="${LDFLAGS} -L$gotodir/ "
  2332. ]
  2333. )
  2334. if test x$blas_lib = xgoto; then
  2335. STARPU_CHECK_LIB(BLAS, gfortran, main,,)
  2336. STARPU_CHECK_LIB(BLAS, ifcore, main,,)
  2337. # Perhaps that GotoBLAS2 is available instead (so that we have libgotoblas2.{so,a})
  2338. STARPU_CHECK_LIB(BLAS, goto2, sgemm_,, [havegoto2=no], [$STARPU_BLAS_LDFLAGS])
  2339. if test x$havegoto2 = xno; then
  2340. STARPU_CHECK_LIB(BLAS, goto, sgemm_,,AC_MSG_ERROR([cannot find goto lib]), [$STARPU_BLAS_LDFLAGS])
  2341. fi
  2342. AC_DEFINE(STARPU_GOTO, [1], [use STARPU_GOTO library])
  2343. fi
  2344. fi
  2345. if test x$blas_lib = xmaybe -o x$blas_lib = xatlas; then
  2346. AC_ARG_WITH(atlas-dir, [AS_HELP_STRING([--with-atlas-dir=<dir>], [specify ATLAS lib location])],
  2347. [
  2348. AC_MSG_CHECKING(STARPU_ATLAS location)
  2349. blas_lib=atlas
  2350. atlasdir=$withval
  2351. AC_MSG_RESULT($atlasdir)
  2352. AC_SUBST(ATLASDIR, $atlasdir)
  2353. CPPFLAGS="${CPPFLAGS} -I$atlasdir/include/ "
  2354. LDFLAGS="${LDFLAGS} -L$atlasdir/lib/ "
  2355. ]
  2356. )
  2357. if test x$blas_lib = xatlas; then
  2358. # test whether STARPU_ATLAS is actually available
  2359. AC_CHECK_HEADER([cblas.h],,AC_MSG_ERROR([cannot find atlas headers]))
  2360. STARPU_CHECK_LIB(BLAS, atlas, ATL_sgemm,,AC_MSG_ERROR([cannot find atlas lib]),)
  2361. STARPU_CHECK_LIB(BLAS, cblas, cblas_sgemm,,AC_MSG_ERROR([cannot find atlas lib]),[-latlas])
  2362. AC_DEFINE(STARPU_ATLAS, [1], [use STARPU_ATLAS library])
  2363. fi
  2364. fi
  2365. if test x$blas_lib = xmaybe -o x$blas_lib = xmkl; then
  2366. # Should we use MKL ?
  2367. if test -n "$MKLROOT"
  2368. then
  2369. CPPFLAGS="${CPPFLAGS} -I$MKLROOT/include"
  2370. case $host_vendor in
  2371. *1om) mkl_plat=mic ;;
  2372. *) mkl_plat=intel64 ;;
  2373. esac
  2374. SAVED_LIBS=$LIBS
  2375. STARPU_BLAS_LDFLAGS="-L$MKLROOT/lib/$mkl_plat -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm -lpthread -ldl"
  2376. LIBS="$LIBS $STARPU_BLAS_LDFLAGS"
  2377. AC_LINK_IFELSE(
  2378. [AC_LANG_PROGRAM([[
  2379. #include <mkl.h>
  2380. ]], [[ ]])],
  2381. [ blas_lib=mkl ],
  2382. [ STARPU_BLAS_LDFLAGS="" ],
  2383. )
  2384. LIBS=$SAVED_LIBS
  2385. fi
  2386. AC_ARG_WITH(mkl-cflags, [AS_HELP_STRING([--with-mkl-cflags], [specify MKL compilation flags])],
  2387. [
  2388. CPPFLAGS="${CPPFLAGS} $withval"
  2389. blas_lib=mkl
  2390. ])
  2391. AC_ARG_WITH(mkl-ldflags, [AS_HELP_STRING([--with-mkl-ldflags], [specify MKL linking flags])],
  2392. [
  2393. STARPU_BLAS_LDFLAGS="$withval"
  2394. blas_lib=mkl
  2395. ])
  2396. if test x$blas_lib = xmkl; then
  2397. AC_DEFINE(STARPU_MKL, [1], [use MKL library])
  2398. fi
  2399. fi
  2400. if test x$blas_lib = xmaybe; then
  2401. #perhaps it is possible to use some BLAS lib from the system
  2402. use_system_blas=no
  2403. STARPU_SEARCH_LIBS(BLAS,[sgemm_],[blas],use_system_blas=yes,,)
  2404. if test x$use_system_blas = xyes; then
  2405. AC_DEFINE(STARPU_SYSTEM_BLAS, [1], [use refblas library])
  2406. blas_lib=system
  2407. elif test x"$BLAS_LIBS" != x; then
  2408. AC_DEFINE(STARPU_SYSTEM_BLAS, [1], [use user defined library])
  2409. STARPU_BLAS_LDFLAGS="$BLAS_LIBS"
  2410. blas_lib=system
  2411. AC_ARG_VAR([BLAS_LIBS], [linker flags for blas])
  2412. else
  2413. blas_lib=none
  2414. fi
  2415. fi
  2416. AM_CONDITIONAL(ATLAS_BLAS_LIB, test x$blas_lib = xatlas)
  2417. AM_CONDITIONAL(GOTO_BLAS_LIB, test x$blas_lib = xgoto)
  2418. AM_CONDITIONAL(MKL_BLAS_LIB, test x$blas_lib = xmkl)
  2419. AM_CONDITIONAL(SYSTEM_BLAS_LIB, test x$blas_lib = xsystem)
  2420. AM_CONDITIONAL(NO_BLAS_LIB, test x$blas_lib = xnone -a x$enable_simgrid = xno)
  2421. AC_SUBST(STARPU_BLAS_LDFLAGS)
  2422. AC_MSG_CHECKING(which BLAS lib should be used)
  2423. AC_MSG_RESULT($blas_lib)
  2424. AC_SUBST(BLAS_LIB,$blas_lib)
  2425. ##########################################
  2426. # FFT #
  2427. ##########################################
  2428. have_fftw=no
  2429. have_fftwf=no
  2430. have_fftwl=no
  2431. fft_support=no
  2432. AC_ARG_ENABLE(starpufft, [AS_HELP_STRING([--disable-starpufft],
  2433. [Disable build of StarPU-FFT])],
  2434. enable_starpufft=$enableval,enable_starpufft=yes)
  2435. PKG_CHECK_MODULES([FFTW], [fftw3], [
  2436. AC_DEFINE([STARPU_HAVE_FFTW], [1], [Define to 1 if you have the libfftw3 library.])
  2437. AC_SUBST([STARPU_HAVE_FFTW], [1])
  2438. have_fftw=yes
  2439. ], [:])
  2440. AM_CONDITIONAL(STARPU_HAVE_FFTW, [test x$have_fftw = xyes])
  2441. PKG_CHECK_MODULES([FFTWF], [fftw3f], [
  2442. AC_DEFINE([STARPU_HAVE_FFTWF], [1], [Define to 1 if you have the libfftw3f library.])
  2443. AC_SUBST([STARPU_HAVE_FFTWF], [1])
  2444. have_fftwf=yes
  2445. ], [:])
  2446. AM_CONDITIONAL(STARPU_HAVE_FFTWF, [test x$have_fftwf = xyes])
  2447. PKG_CHECK_MODULES([FFTWL], [fftw3l], [
  2448. AC_DEFINE([STARPU_HAVE_FFTWL], [1], [Define to 1 if you have the libfftw3l library.])
  2449. AC_SUBST([HAVE_FFTWFL], [1])
  2450. have_fftwl=yes
  2451. ], [:])
  2452. AM_CONDITIONAL(STARPU_HAVE_FFTWL, [test x$have_fftwl = xyes])
  2453. if test x$enable_starpufft = xyes -a \( \( x$enable_cpu = xyes -a x$have_fftw = xyes -a x$have_fftwf = xyes \) -o x$have_cufftdoublecomplex = xyes \); then
  2454. fft_support=yes
  2455. fi
  2456. AM_CONDITIONAL(BUILD_STARPUFFT, [test x$fft_support = xyes])
  2457. AC_ARG_ENABLE(starpufft-examples, [AS_HELP_STRING([--enable-starpufft-examples],
  2458. [disable execution of StarPU FFT examples])],
  2459. enable_starpufft_examples=$enableval, enable_starpufft_examples=no)
  2460. AM_CONDITIONAL(BUILD_STARPUFFT_EXAMPLES, [test x$enable_starpufft_examples = xyes])
  2461. ##########################################
  2462. # hwloc #
  2463. ##########################################
  2464. have_valid_hwloc=no
  2465. SAVED_LDFLAGS="${LDFLAGS}"
  2466. SAVED_CPPFLAGS="${CPPFLAGS}"
  2467. SAVED_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
  2468. AC_ARG_WITH([hwloc],
  2469. [AS_HELP_STRING([--without-hwloc], [Disable hwloc (enabled by default)])],
  2470. [
  2471. if test x$withval != xno; then
  2472. if test "$withval" = "yes" ; then
  2473. use_hwloc=yes
  2474. else
  2475. # use specified path
  2476. if test ! -d "$withval" ; then
  2477. AC_MSG_ERROR("Directory specified for hwloc <$withval> does not exist")
  2478. fi
  2479. if test ! -d "$withval/lib/pkgconfig" ; then
  2480. AC_MSG_ERROR("Hwloc directory <$withval> does not have a subdirectory lib/pkgconfig")
  2481. fi
  2482. export PKG_CONFIG_PATH=$withval/lib/pkgconfig:$PKG_CONFIG_PATH
  2483. use_hwloc=yes
  2484. fi
  2485. else
  2486. use_hwloc=no
  2487. fi
  2488. ],
  2489. [
  2490. use_hwloc=maybe
  2491. ])
  2492. AS_IF([test "$use_hwloc" != "no"],
  2493. [PKG_CHECK_MODULES([HWLOC],[hwloc], [have_valid_hwloc=yes], [have_valid_hwloc=no])]
  2494. )
  2495. AM_CONDITIONAL(STARPU_HAVE_HWLOC, test "x$have_valid_hwloc" = "xyes")
  2496. # in case hwloc was explicitely required, but is not available, this is an error
  2497. AS_IF([test "$use_hwloc" = "yes" -a "$have_valid_hwloc" = "no"],
  2498. [AC_MSG_ERROR([cannot find hwloc])]
  2499. )
  2500. # in case hwloc is not available but was not explicitely disabled, this is an error
  2501. AS_IF([test "$have_valid_hwloc" = "no" -a "$use_hwloc" != "no"],
  2502. [AC_MSG_ERROR([libhwloc was not found on your system. If the target machine is hyperthreaded the performance may be impacted a lot. It is strongly recommended to install libhwloc. However, if you really want to use StarPU without enabling libhwloc, please restart configure by specifying the option '--without-hwloc'.])]
  2503. )
  2504. LDFLAGS="${HWLOC_LIBS} ${SAVED_LDFLAGS}"
  2505. CPPFLAGS="${HWLOC_CFLAGS} ${SAVED_CPPFLAGS}"
  2506. AS_IF([test "$have_valid_hwloc" = "yes"],
  2507. [AC_DEFINE([STARPU_HAVE_HWLOC], [1], [Define to 1 if you have the hwloc library.])
  2508. HWLOC_REQUIRES=hwloc
  2509. AC_SUBST([STARPU_HAVE_HWLOC], [1])
  2510. AC_CHECK_DECLS([hwloc_cuda_get_device_osdev_by_index], [], [], [[#include <hwloc/cuda.h>]])
  2511. ])
  2512. AC_CHECK_FUNCS([hwloc_topology_dup])
  2513. AM_CONDITIONAL(STARPU_HWLOC_HAVE_TOPOLOGY_DUP, test $ac_cv_func_hwloc_topology_dup = yes)
  2514. LDFLAGS="${SAVED_LDFLAGS}"
  2515. CPPFLAGS="${SAVED_CPPFLAGS}"
  2516. export PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
  2517. AC_MSG_CHECKING(whether hwloc should be used)
  2518. AC_MSG_RESULT($have_valid_hwloc)
  2519. AC_SUBST(HWLOC_REQUIRES)
  2520. # is the header file f77.h available ?
  2521. AC_CHECK_HEADER([f77.h], [have_f77_h=yes], [have_f77_h=no])
  2522. AC_SUBST(STARPU_HAVE_F77_H, $have_f77_h)
  2523. AM_CONDITIONAL(STARPU_HAVE_F77_H, test x$have_f77_h = xyes)
  2524. if test x$have_f77_h = xyes; then
  2525. AC_DEFINE([STARPU_HAVE_F77_H], [1], [Define to 1 if you have the <f77.h> header file.])
  2526. fi
  2527. # Check if icc is available
  2528. AC_CHECK_PROGS([ICC], [icc])
  2529. # If cuda and icc are both available, check they are compatible
  2530. if test "$enable_cuda" = "yes" -a "$ICC" != ""; then
  2531. AC_MSG_CHECKING(whether CUDA and ICC are compatible)
  2532. OLD_CC="$CC"
  2533. CC="$ICC"
  2534. OLD_CFLAGS="$CFLAGS"
  2535. CFLAGS="-I$PWD/include -I$srcdir/include"
  2536. AC_COMPILE_IFELSE(
  2537. [AC_LANG_PROGRAM(
  2538. [[#include <cuda.h>
  2539. #include <starpu.h>]],
  2540. [[]]
  2541. )],
  2542. AC_MSG_RESULT(yes),
  2543. [ICC=""
  2544. AC_MSG_RESULT(no)]
  2545. )
  2546. CC="$OLD_CC"
  2547. CFLAGS="$OLD_CFLAGS"
  2548. fi
  2549. # Disable ICC on windows
  2550. if test "x$ICC" != "x" -a "$starpu_windows" = "yes" ; then
  2551. ICC=""
  2552. fi
  2553. if test "x$ICC" != "x"; then
  2554. AC_DEFINE(STARPU_HAVE_ICC, [1], [Define this if icc is available])
  2555. fi
  2556. AM_CONDITIONAL([STARPU_HAVE_ICC], [test "x$ICC" != "x"])
  2557. # Do not generate manpages for the tools if we do not have help2man
  2558. AC_CHECK_PROGS([HELP2MAN], [help2man])
  2559. # Disable on windows
  2560. if test "$starpu_windows" = "yes" ; then
  2561. HELP2MAN=""
  2562. fi
  2563. AM_CONDITIONAL([STARPU_HAVE_HELP2MAN], [test "x$HELP2MAN" != "x"])
  2564. AC_CHECK_MEMBER([struct cudaDeviceProp.pciDomainID],
  2565. AC_DEFINE([STARPU_HAVE_DOMAINID],[1],[Define to 1 if CUDA device properties include DomainID]),
  2566. , [[#include <cuda_runtime_api.h>]])
  2567. AC_CHECK_MEMBER([struct cudaDeviceProp.pciBusID],
  2568. AC_DEFINE([STARPU_HAVE_BUSID],[1],[Define to 1 if CUDA device properties include BusID]),
  2569. , [[#include <cuda_runtime_api.h>]])
  2570. dnl Set this condition when Automake 1.11 or later is being used.
  2571. dnl Automake 1.11 introduced `silent-rules', hence the check.
  2572. m4_ifdef([AM_SILENT_RULES],
  2573. AM_CONDITIONAL([STARPU_HAVE_AM111], [true]),
  2574. AM_CONDITIONAL([STARPU_HAVE_AM111], [false]))
  2575. ##########################################
  2576. # Documentation #
  2577. ##########################################
  2578. AC_ARG_ENABLE(build-doc, [AS_HELP_STRING([--disable-build-doc],
  2579. [disable building of documentation])],
  2580. enable_build_doc=$enableval, enable_build_doc=yes)
  2581. if test "$enable_build_doc" = "yes" ; then
  2582. # Check whether doxygen needed tools are installed
  2583. AC_PATH_PROG(doxygencommand, doxygen)
  2584. if test "$doxygencommand" = "" ; then
  2585. enable_build_doc="no"
  2586. fi
  2587. AC_PATH_PROG(pdflatexcommand, pdflatex)
  2588. if test "$pdflatexcommand" = "" ; then
  2589. enable_build_doc="no"
  2590. fi
  2591. AC_PATH_PROG(epstopdfcommand, epstopdf)
  2592. if test "$epstopdfcommand" = "" ; then
  2593. enable_build_doc="no"
  2594. fi
  2595. if test -f "$srcdir/doc/doxygen/starpu.pdf"
  2596. then
  2597. enable_build_doc="no"
  2598. fi
  2599. fi
  2600. AC_MSG_CHECKING(whether documentation should be compiled)
  2601. AC_MSG_RESULT($enable_build_doc)
  2602. AM_CONDITIONAL(BUILD_DOC, [test x$enable_build_doc != xno])
  2603. ###############################################################################
  2604. # #
  2605. # Final settings #
  2606. # #
  2607. ###############################################################################
  2608. # these are the flags needed for linking libstarpu (and thus also for static linking)
  2609. LIBSTARPU_LDFLAGS="$HWLOC_LIBS $FXT_LIBS $STARPU_COI_LDFLAGS $STARPU_SCIF_LDFLAGS $STARPU_RCCE_LDFLAGS $STARPU_LEVELDB_LDFLAGS $STARPU_GLPK_LDFLAGS $STARPU_LEVELDB_LDFLAGS $SIMGRID_LIBS $STARPU_BLAS_LDFLAGS $STARPU_OMP_LDFLAGS $DGELS_LIBS"
  2610. AC_SUBST([LIBSTARPU_LDFLAGS])
  2611. LIBSTARPU_LINK=libstarpu-$STARPU_EFFECTIVE_VERSION.la
  2612. if test x$enable_perf_debug = xyes; then
  2613. # For gperf to work, we need to link statically our tests
  2614. LIBSTARPU_LINK=".libs/libstarpu-$STARPU_EFFECTIVE_VERSION.a $LIBSTARPU_LDFLAGS $STARPU_CUDA_LDFLAGS $STARPU_OPENCL_LDFLAGS"
  2615. fi
  2616. AC_SUBST([LIBSTARPU_LINK])
  2617. if test "x$enable_shared" = xno; then
  2618. # No .so, so application will unexpected have to know which -l to
  2619. # use. Give them in .pc file.
  2620. STARPU_EXPORTED_LIBS="$LDFLAGS $LIBS $LIBSTARPU_LDFLAGS"
  2621. fi
  2622. AC_SUBST(STARPU_EXPORTED_LIBS)
  2623. # File configuration
  2624. AC_CONFIG_COMMANDS([executable-scripts], [
  2625. chmod +x tests/regression/regression.sh
  2626. chmod +x tests/loader-cross.sh
  2627. chmod +x examples/loader-cross.sh
  2628. chmod +x examples/stencil/loader-cross.sh
  2629. chmod +x gcc-plugin/tests/run-test
  2630. chmod +x tools/starpu_codelet_profile
  2631. chmod +x tools/starpu_codelet_histo_profile
  2632. chmod +x tools/starpu_workers_activity
  2633. chmod +x tools/starpu_paje_draw_histogram
  2634. chmod +x tools/starpu_paje_state_stats
  2635. chmod +x tools/starpu_paje_summary
  2636. chmod +x tools/starpu_mlr_analysis
  2637. chmod +x tools/starpu_paje_sort
  2638. chmod +x tools/starpu_smpirun
  2639. chmod +x doc/doxygen/doxygen_filter.sh
  2640. mkdir -p tests/microbenchs
  2641. test -e tests/microbenchs/tasks_size_overhead.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/tasks_size_overhead.sh tests/microbenchs/
  2642. test -e tests/microbenchs/tasks_size_overhead_sched.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/tasks_size_overhead_sched.sh tests/microbenchs/
  2643. test -e tests/microbenchs/tasks_size_overhead_scheds.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/tasks_size_overhead_scheds.sh tests/microbenchs/
  2644. test -e tests/microbenchs/tasks_size_overhead.gp || ln -sf $ac_abs_top_srcdir/tests/microbenchs/tasks_size_overhead.gp tests/microbenchs/
  2645. test -e tests/microbenchs/microbench.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/microbench.sh tests/microbenchs/
  2646. test -e tests/microbenchs/parallel_dependent_homogeneous_tasks_data.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/parallel_dependent_homogeneous_tasks_data.sh tests/microbenchs/
  2647. test -e tests/microbenchs/parallel_independent_heterogeneous_tasks_data.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/parallel_independent_heterogeneous_tasks_data.sh tests/microbenchs/
  2648. test -e tests/microbenchs/parallel_independent_heterogeneous_tasks.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/parallel_independent_heterogeneous_tasks.sh tests/microbenchs/
  2649. test -e tests/microbenchs/parallel_independent_homogeneous_tasks_data.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/parallel_independent_homogeneous_tasks_data.sh tests/microbenchs/
  2650. test -e tests/microbenchs/parallel_independent_homogeneous_tasks.sh || ln -sf $ac_abs_top_srcdir/tests/microbenchs/parallel_independent_homogeneous_tasks.sh tests/microbenchs/
  2651. ])
  2652. # Create links to ICD files in build/socl/vendors directory. SOCL will use this
  2653. # directory as the OCL_ICD_VENDORS directory
  2654. SOCL_VENDORS="vendors/install/socl.icd"
  2655. for icd in /etc/OpenCL/vendors/*.icd ; do
  2656. if test -f $icd ; then
  2657. if test "$(basename $icd)" != "socl.icd" ; then
  2658. new_icd=$(basename $icd)
  2659. AC_CONFIG_LINKS([socl/vendors/$new_icd:$icd])
  2660. SOCL_VENDORS="$SOCL_VENDORS vendors/$new_icd"
  2661. fi
  2662. fi
  2663. done
  2664. AC_SUBST(SOCL_VENDORS)
  2665. AC_CONFIG_FILES(tests/regression/regression.sh tests/regression/profiles tests/regression/profiles.build.only)
  2666. AC_CONFIG_HEADER(src/common/config.h include/starpu_config.h gcc-plugin/include/starpu-gcc/config.h starpu-top/config.h)
  2667. AH_BOTTOM([
  2668. #if defined(STARPU_DEVEL) && defined(BUILDING_STARPU)
  2669. # ifndef STARPU_CHECKED_UNISTD_H
  2670. # define STARPU_CHECKED_UNISTD_H
  2671. # ifdef _UNISTD_H
  2672. # define _UNISTD_H PLEASE_DONT_INCLUDE_IT
  2673. # error Please do not unconditionally include unistd.h, it is not available on Windows, include config.h and test for HAVE_UNISTD_H
  2674. # endif
  2675. # endif
  2676. #endif
  2677. ])
  2678. SANITIZE=$(echo $CFLAGS | grep sanitize)
  2679. AM_CONDITIONAL(STARPU_SANITIZE, test -n "$SANITIZE")
  2680. AC_OUTPUT([
  2681. Makefile
  2682. src/Makefile
  2683. tools/Makefile
  2684. tools/starpu_codelet_profile
  2685. tools/starpu_codelet_histo_profile
  2686. tools/starpu_workers_activity
  2687. tools/starpu_paje_draw_histogram
  2688. tools/starpu_paje_state_stats
  2689. tools/starpu_paje_summary
  2690. tools/starpu_mlr_analysis
  2691. tools/starpu_paje_sort
  2692. tools/starpu_smpirun
  2693. socl/Makefile
  2694. socl/src/Makefile
  2695. socl/examples/Makefile
  2696. socl/vendors/socl.icd
  2697. socl/vendors/install/socl.icd
  2698. libstarpu.pc
  2699. starpu-1.0.pc
  2700. starpu-1.1.pc
  2701. starpu-1.2.pc
  2702. starpu-1.3.pc
  2703. mpi/libstarpumpi.pc
  2704. mpi/starpumpi-1.0.pc
  2705. mpi/starpumpi-1.1.pc
  2706. mpi/starpumpi-1.2.pc
  2707. mpi/starpumpi-1.3.pc
  2708. starpufft/Makefile
  2709. starpufft/src/Makefile
  2710. starpufft/tests/Makefile
  2711. starpufft/libstarpufft.pc
  2712. starpufft/starpufft-1.0.pc
  2713. starpufft/starpufft-1.1.pc
  2714. starpufft/starpufft-1.2.pc
  2715. starpufft/starpufft-1.3.pc
  2716. examples/Makefile
  2717. examples/stencil/Makefile
  2718. tests/Makefile
  2719. tests/loader-cross.sh
  2720. examples/loader-cross.sh
  2721. examples/stencil/loader-cross.sh
  2722. mpi/Makefile
  2723. mpi/src/Makefile
  2724. mpi/tests/Makefile
  2725. mpi/examples/Makefile
  2726. starpu-top/StarPU-Top.pro
  2727. starpu-top/StarPU-Top-qwt-embed.pri
  2728. starpu-top/StarPU-Top-qwt-system.pri
  2729. gcc-plugin/Makefile
  2730. gcc-plugin/src/Makefile
  2731. gcc-plugin/tests/Makefile
  2732. gcc-plugin/tests/run-test
  2733. gcc-plugin/examples/Makefile
  2734. sc_hypervisor/Makefile
  2735. sc_hypervisor/src/Makefile
  2736. sc_hypervisor/examples/Makefile
  2737. doc/Makefile
  2738. doc/doxygen/Makefile
  2739. doc/doxygen/doxygen-config.cfg
  2740. doc/doxygen/doxygen_filter.sh
  2741. tools/msvc/starpu_var.bat
  2742. min-dgels/Makefile
  2743. ])
  2744. AC_MSG_NOTICE([
  2745. CPUs enabled: $enable_cpu
  2746. CUDA enabled: $enable_cuda
  2747. OpenCL enabled: $enable_opencl
  2748. SCC enabled: $enable_rcce
  2749. MIC enabled: $enable_mic
  2750. Compile-time limits
  2751. (change these with --enable-maxcpus, --enable-maxcudadev,
  2752. --enable-maxopencldev, --enable-maxmicdev, --enable-maxnodes,
  2753. --enable-maxbuffers)
  2754. (Note these numbers do not represent the number of detected
  2755. devices, but the maximum number of devices StarPU can manage)
  2756. Maximum number of CPUs: $maxcpus
  2757. Maximum number of CUDA devices: $nmaxcudadev
  2758. Maximum number of OpenCL devices: $nmaxopencldev
  2759. Maximum number of SCC devices: $nmaxsccdev
  2760. Maximum number of MIC threads: $nmaxmicthreads
  2761. Maximum number of MPI master-slave devices: $nmaxmpidev
  2762. Maximum number of memory nodes: $maxnodes
  2763. Maximum number of task buffers: $nmaxbuffers
  2764. GPU-GPU transfers: $have_cuda_memcpy_peer
  2765. Allocation cache: $enable_allocation_cache
  2766. Magma enabled: $have_magma
  2767. BLAS library: $blas_lib
  2768. hwloc: $have_valid_hwloc
  2769. FxT trace enabled: $use_fxt
  2770. StarPU-Top: $build_starpu_top
  2771. Documentation: $enable_build_doc
  2772. Examples: $enable_build_examples
  2773. StarPU Extensions:
  2774. StarPU MPI enabled: $build_mpi_lib
  2775. MPI test suite: $running_mpi_check
  2776. Master-Slave MPI enabled: $use_mpi_master_slave
  2777. FFT Support: $fft_support
  2778. GCC plug-in: $build_gcc_plugin
  2779. GCC plug-in test suite (requires GNU Guile): $run_gcc_plugin_test_suite
  2780. OpenMP runtime support enabled: $enable_openmp
  2781. SOCL enabled: $build_socl
  2782. SOCL test suite: $run_socl_check
  2783. Scheduler Hypervisor: $build_sc_hypervisor
  2784. simgrid enabled: $enable_simgrid
  2785. ayudame enabled: $ayu_msg
  2786. Native fortran support: $enable_build_fortran
  2787. Native MPI fortran support: $use_mpi_fort
  2788. ])
  2789. if test "$build_socl" = "yes" -a "$run_socl_check" = "no" ; then
  2790. AC_MSG_NOTICE([
  2791. WARNING: SOCL test suite will not be run as the environment variable SOCL_OCL_LIB_OPENCL is not defined.
  2792. To run the tests, you need to install the OCL implementation of ICD
  2793. (https://forge.imag.fr/projects/ocl-icd/ or Debian package ocl-icd-libopencl1)
  2794. and set the variable SOCL_OCL_LIB_OPENCL to the location of the libOpenCL.so.])
  2795. fi
  2796. if test x"$have_valid_hwloc" = xno -a "$enable_simgrid" = "no"
  2797. then
  2798. AC_MSG_NOTICE([
  2799. WARNING: hwloc was not enabled. If the target machine is hyperthreaded the
  2800. performance may be impacted a lot. It is strongly recommended to install
  2801. hwloc])
  2802. fi