configure.ac 135 KB

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