autoconfiscate.diff 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. diff --git a/Demo/Makefile.am b/Demo/Makefile.am
  2. new file mode 100644
  3. --- /dev/null
  4. +++ b/Demo/Makefile.am
  5. @@ -0,0 +1,115 @@
  6. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(CHOLMOD_CFLAGS) $(SUITESPARSECONFIG_CFLAGS)
  7. +
  8. +EXTRA_DIST = \
  9. + README.txt \
  10. + qrdemo_out.txt \
  11. + qrdemoc_out.txt
  12. +
  13. +check_PROGRAMS = \
  14. + qrsimple \
  15. + qrsimplec \
  16. + qrdemo \
  17. + qrdemoc
  18. +
  19. +qrsimple_SOURCES = qrsimple.cpp
  20. +qrsimple_LDADD = $(top_builddir)/Source/libspqr.la $(CHOLMOD_LIBS)
  21. +
  22. +qrsimplec_SOURCES = qrsimplec.c
  23. +qrsimplec_LDADD = $(top_builddir)/Source/libspqr.la $(CHOLMOD_LIBS)
  24. +
  25. +qrdemo_SOURCES = qrdemo.cpp
  26. +qrdemo_LDADD = $(top_builddir)/Source/libspqr.la $(CHOLMOD_LIBS)
  27. +
  28. +qrdemoc_SOURCES = qrdemoc.c
  29. +qrdemoc_LDADD = $(top_builddir)/Source/libspqr.la $(CHOLMOD_LIBS)
  30. +
  31. +MATRICES = \
  32. + $(top_srcdir)/Matrix/GD01_b.mtx \
  33. + $(top_srcdir)/Matrix/GD06_theory.mtx \
  34. + $(top_srcdir)/Matrix/GD98_a.mtx \
  35. + $(top_srcdir)/Matrix/LFAT5.mtx \
  36. + $(top_srcdir)/Matrix/Ragusa16.mtx \
  37. + $(top_srcdir)/Matrix/Tina_AskCal.mtx \
  38. + $(top_srcdir)/Matrix/Tina_AskCal_perm.mtx \
  39. + $(top_srcdir)/Matrix/a0.mtx \
  40. + $(top_srcdir)/Matrix/a04.mtx \
  41. + $(top_srcdir)/Matrix/a1.mtx \
  42. + $(top_srcdir)/Matrix/a2.mtx \
  43. + $(top_srcdir)/Matrix/a4.mtx \
  44. + $(top_srcdir)/Matrix/ash219.mtx \
  45. + $(top_srcdir)/Matrix/b1_ss.mtx \
  46. + $(top_srcdir)/Matrix/bcspwr01.mtx \
  47. + $(top_srcdir)/Matrix/bfwa62.mtx \
  48. + $(top_srcdir)/Matrix/c2.mtx \
  49. + $(top_srcdir)/Matrix/c32.mtx \
  50. + $(top_srcdir)/Matrix/lfat5b.mtx \
  51. + $(top_srcdir)/Matrix/lp_share1b.mtx \
  52. + $(top_srcdir)/Matrix/lpi_galenet.mtx \
  53. + $(top_srcdir)/Matrix/lpi_itest6.mtx \
  54. + $(top_srcdir)/Matrix/r2.mtx \
  55. + $(top_srcdir)/Matrix/s32.mtx \
  56. + $(top_srcdir)/Matrix/west0067.mtx \
  57. + $(top_srcdir)/Matrix/young1c.mtx \
  58. + $(top_srcdir)/Matrix/lp_e226_transposed.mtx
  59. +
  60. +check-local: $(check_PROGRAMS) $(MATRICES)
  61. + -./qrsimple < $(top_srcdir)/Matrix/ash219.mtx
  62. + -./qrsimplec < $(top_srcdir)/Matrix/ash219.mtx
  63. + -./qrsimple < $(top_srcdir)/Matrix/west0067.mtx
  64. + -./qrsimplec < $(top_srcdir)/Matrix/west0067.mtx
  65. + -./qrdemo < $(top_srcdir)/Matrix/a2.mtx
  66. + -./qrdemo < $(top_srcdir)/Matrix/r2.mtx
  67. + -./qrdemo < $(top_srcdir)/Matrix/a04.mtx
  68. + -./qrdemo < $(top_srcdir)/Matrix/a2.mtx
  69. + -./qrdemo < $(top_srcdir)/Matrix/west0067.mtx
  70. + -./qrdemo < $(top_srcdir)/Matrix/c2.mtx
  71. + -./qrdemo < $(top_srcdir)/Matrix/a0.mtx
  72. + -./qrdemo < $(top_srcdir)/Matrix/lfat5b.mtx
  73. + -./qrdemo < $(top_srcdir)/Matrix/bfwa62.mtx
  74. + -./qrdemo < $(top_srcdir)/Matrix/LFAT5.mtx
  75. + -./qrdemo < $(top_srcdir)/Matrix/b1_ss.mtx
  76. + -./qrdemo < $(top_srcdir)/Matrix/bcspwr01.mtx
  77. + -./qrdemo < $(top_srcdir)/Matrix/lpi_galenet.mtx
  78. + -./qrdemo < $(top_srcdir)/Matrix/lpi_itest6.mtx
  79. + -./qrdemo < $(top_srcdir)/Matrix/ash219.mtx
  80. + -./qrdemo < $(top_srcdir)/Matrix/a4.mtx
  81. + -./qrdemo < $(top_srcdir)/Matrix/s32.mtx
  82. + -./qrdemo < $(top_srcdir)/Matrix/c32.mtx
  83. + -./qrdemo < $(top_srcdir)/Matrix/lp_share1b.mtx
  84. + -./qrdemo < $(top_srcdir)/Matrix/a1.mtx
  85. + -./qrdemo < $(top_srcdir)/Matrix/GD06_theory.mtx
  86. + -./qrdemo < $(top_srcdir)/Matrix/GD01_b.mtx
  87. + -./qrdemo < $(top_srcdir)/Matrix/Tina_AskCal_perm.mtx
  88. + -./qrdemo < $(top_srcdir)/Matrix/Tina_AskCal.mtx
  89. + -./qrdemo < $(top_srcdir)/Matrix/GD98_a.mtx
  90. + -./qrdemo < $(top_srcdir)/Matrix/Ragusa16.mtx
  91. + -./qrdemo < $(top_srcdir)/Matrix/young1c.mtx
  92. + -./qrdemo < $(top_srcdir)/Matrix/lp_e226_transposed.mtx
  93. + -./qrdemoc < $(top_srcdir)/Matrix/a2.mtx
  94. + -./qrdemoc < $(top_srcdir)/Matrix/r2.mtx
  95. + -./qrdemoc < $(top_srcdir)/Matrix/a04.mtx
  96. + -./qrdemoc < $(top_srcdir)/Matrix/a2.mtx
  97. + -./qrdemoc < $(top_srcdir)/Matrix/west0067.mtx
  98. + -./qrdemoc < $(top_srcdir)/Matrix/c2.mtx
  99. + -./qrdemoc < $(top_srcdir)/Matrix/a0.mtx
  100. + -./qrdemoc < $(top_srcdir)/Matrix/lfat5b.mtx
  101. + -./qrdemoc < $(top_srcdir)/Matrix/bfwa62.mtx
  102. + -./qrdemoc < $(top_srcdir)/Matrix/LFAT5.mtx
  103. + -./qrdemoc < $(top_srcdir)/Matrix/b1_ss.mtx
  104. + -./qrdemoc < $(top_srcdir)/Matrix/bcspwr01.mtx
  105. + -./qrdemoc < $(top_srcdir)/Matrix/lpi_galenet.mtx
  106. + -./qrdemoc < $(top_srcdir)/Matrix/lpi_itest6.mtx
  107. + -./qrdemoc < $(top_srcdir)/Matrix/ash219.mtx
  108. + -./qrdemoc < $(top_srcdir)/Matrix/a4.mtx
  109. + -./qrdemoc < $(top_srcdir)/Matrix/s32.mtx
  110. + -./qrdemoc < $(top_srcdir)/Matrix/c32.mtx
  111. + -./qrdemoc < $(top_srcdir)/Matrix/lp_share1b.mtx
  112. + -./qrdemoc < $(top_srcdir)/Matrix/a1.mtx
  113. + -./qrdemoc < $(top_srcdir)/Matrix/GD06_theory.mtx
  114. + -./qrdemoc < $(top_srcdir)/Matrix/GD01_b.mtx
  115. + -./qrdemoc < $(top_srcdir)/Matrix/Tina_AskCal_perm.mtx
  116. + -./qrdemoc < $(top_srcdir)/Matrix/Tina_AskCal.mtx
  117. + -./qrdemoc < $(top_srcdir)/Matrix/GD98_a.mtx
  118. + -./qrdemoc < $(top_srcdir)/Matrix/Ragusa16.mtx
  119. + -./qrdemoc < $(top_srcdir)/Matrix/young1c.mtx
  120. + -./qrdemoc < $(top_srcdir)/Matrix/lp_e226_transposed.mtx
  121. diff --git a/Doc/Makefile.am b/Doc/Makefile.am
  122. new file mode 100644
  123. --- /dev/null
  124. +++ b/Doc/Makefile.am
  125. @@ -0,0 +1,29 @@
  126. +EXTRA_DIST = \
  127. + ChangeLog \
  128. + License.txt \
  129. + README.txt \
  130. + gpl.txt
  131. +
  132. +dist_noinst_DATA = \
  133. + spqr_user_guide.tex \
  134. + spqr_user_guide.bib
  135. +
  136. +dist_pdf_DATA = \
  137. + spqr_user_guide.pdf \
  138. + algo_spqr.pdf \
  139. + spqr.pdf
  140. +
  141. +TEX = TEXINPUTS="$(srcdir):" pdflatex -interaction nonstopmode -file-line-error
  142. +BIB = BIBINPUTS="$(srcdir):" bibtex
  143. +%.pdf: %.tex %.bbl
  144. + $(TEX) $*
  145. + while grep -q "Rerun to get cross-references right" $*.log; do \
  146. + $(TEX) $*; \
  147. + done
  148. +%.bbl: %.aux %.bib
  149. + $(BIB) $*
  150. +%.aux: %.tex
  151. + $(TEX) $*
  152. +
  153. +CLEANFILES = *.aux *.bbl *.blg *.log *.toc
  154. +MAINTAINERCLEANFILES = $(dist_pdf_DATA)
  155. diff --git a/Include/Makefile.am b/Include/Makefile.am
  156. new file mode 100644
  157. --- /dev/null
  158. +++ b/Include/Makefile.am
  159. @@ -0,0 +1,5 @@
  160. +pkginclude_HEADERS = \
  161. + SuiteSparseQR.hpp \
  162. + SuiteSparseQR_C.h \
  163. + SuiteSparseQR_definitions.h \
  164. + spqr.hpp
  165. diff --git a/Makefile.am b/Makefile.am
  166. new file mode 100644
  167. --- /dev/null
  168. +++ b/Makefile.am
  169. @@ -0,0 +1,9 @@
  170. +ACLOCAL_AMFLAGS = -I m4
  171. +
  172. +SUBDIRS = Include Source Matrix Demo Tcov Doc
  173. +EXTRA_DIST = README.txt
  174. +
  175. +pkgconfig_DATA = spqr.pc
  176. +
  177. +CODE_COVERAGE_BRANCH_COVERAGE = 1
  178. +@CODE_COVERAGE_RULES@
  179. diff --git a/Matrix/Makefile.am b/Matrix/Makefile.am
  180. new file mode 100644
  181. --- /dev/null
  182. +++ b/Matrix/Makefile.am
  183. @@ -0,0 +1,36 @@
  184. +EXTRA_DIST = \
  185. + README.txt
  186. +
  187. +dist_noinst_DATA = \
  188. + GD01_b.mtx \
  189. + GD06_theory.mtx \
  190. + GD98_a.mtx \
  191. + LFAT5.mtx \
  192. + Ragusa16.mtx \
  193. + Tina_AskCal.mtx \
  194. + Tina_AskCal_perm.mtx \
  195. + a0.mtx \
  196. + a04.mtx \
  197. + a1.mtx \
  198. + a2.mtx \
  199. + a4.mtx \
  200. + arrow.mtx \
  201. + ash219.mtx \
  202. + b1_ss.mtx \
  203. + bcspwr01.mtx \
  204. + bfwa62.mtx \
  205. + c2.mtx \
  206. + c32.mtx \
  207. + lfat5b.mtx \
  208. + lp_share1b.mtx \
  209. + lpi_galenet.mtx \
  210. + lpi_itest6.mtx \
  211. + pwr01b.mtx \
  212. + r2.mtx \
  213. + s32.mtx \
  214. + west0067.mtx \
  215. + young1c.mtx \
  216. + Franz6_id1959_aug.mtx \
  217. + Groebner_id2003_aug.mtx \
  218. + lp_e226.mtx \
  219. + lp_e226_transposed.mtx
  220. diff --git a/Source/Makefile.am b/Source/Makefile.am
  221. new file mode 100644
  222. --- /dev/null
  223. +++ b/Source/Makefile.am
  224. @@ -0,0 +1,56 @@
  225. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(TBB_CFLAGS) $(CHOLMOD_CFLAGS) $(SUITESPARSECONFIG_CFLAGS)
  226. +if !EXPERT
  227. +AM_CPPFLAGS += -DNEXPERT
  228. +endif
  229. +if TBB
  230. +AM_CPPFLAGS += -DHAVE_TBB
  231. +endif
  232. +
  233. +lib_LTLIBRARIES = libspqr.la
  234. +
  235. +libspqr_la_SOURCES = \
  236. + SuiteSparseQR.cpp \
  237. + SuiteSparseQR_C.cpp \
  238. + SuiteSparseQR_expert.cpp \
  239. + SuiteSparseQR_qmult.cpp \
  240. + spqr_1colamd.cpp \
  241. + spqr_1factor.cpp \
  242. + spqr_1fixed.cpp \
  243. + spqr_analyze.cpp \
  244. + spqr_append.cpp \
  245. + spqr_assemble.cpp \
  246. + spqr_cpack.cpp \
  247. + spqr_csize.cpp \
  248. + spqr_cumsum.cpp \
  249. + spqr_debug.cpp \
  250. + spqr_factorize.cpp \
  251. + spqr_fcsize.cpp \
  252. + spqr_freefac.cpp \
  253. + spqr_freenum.cpp \
  254. + spqr_freesym.cpp \
  255. + spqr_front.cpp \
  256. + spqr_fsize.cpp \
  257. + spqr_happly.cpp \
  258. + spqr_happly_work.cpp \
  259. + spqr_hpinv.cpp \
  260. + spqr_kernel.cpp \
  261. + spqr_larftb.cpp \
  262. + spqr_maxcolnorm.cpp \
  263. + spqr_panel.cpp \
  264. + spqr_parallel.cpp \
  265. + spqr_rconvert.cpp \
  266. + spqr_rcount.cpp \
  267. + spqr_rhpack.cpp \
  268. + spqr_rmap.cpp \
  269. + spqr_rsolve.cpp \
  270. + spqr_shift.cpp \
  271. + spqr_stranspose1.cpp \
  272. + spqr_stranspose2.cpp \
  273. + spqr_tol.cpp \
  274. + spqr_trapezoidal.cpp \
  275. + spqr_type.cpp
  276. +
  277. +libspqr_la_LIBADD = $(TBB_LIBS) $(CHOLMOD_LIBS) $(SUITESPARSECONFIG_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) -lm $(CODE_COVERAGE_LIBS)
  278. +libspqr_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS)
  279. +libspqr_la_CXXFLAGS = $(AM_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS)
  280. +libspqr_la_LDFLAGS = -no-undefined -release $(PACKAGE_VERSION)
  281. diff --git a/Tcov/Makefile.am b/Tcov/Makefile.am
  282. new file mode 100644
  283. --- /dev/null
  284. +++ b/Tcov/Makefile.am
  285. @@ -0,0 +1,52 @@
  286. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(CHOLMOD_CFLAGS) $(SUITESPARSECONFIG_CFLAGS)
  287. +
  288. +EXTRA_DIST = \
  289. + README.txt
  290. +
  291. +dist_noinst_DATA = \
  292. + matrix1.txt \
  293. + matrixlist.txt
  294. +
  295. +if CODE_COVERAGE_ENABLED
  296. +check_PROGRAMS = \
  297. + qrtest
  298. +
  299. +qrtest_SOURCES = qrtestc.c qrtest.cpp
  300. +qrtest_LDADD = $(top_builddir)/Source/libspqr.la $(CHOLMOD_LIBS) $(SUITESPARSECONFIG_LIBS)
  301. +
  302. +MATRICES = \
  303. + $(srcdir)/matrix1.txt \
  304. + $(srcdir)/matrixlist.txt \
  305. + $(top_srcdir)/Matrix/GD01_b.mtx \
  306. + $(top_srcdir)/Matrix/GD06_theory.mtx \
  307. + $(top_srcdir)/Matrix/GD98_a.mtx \
  308. + $(top_srcdir)/Matrix/LFAT5.mtx \
  309. + $(top_srcdir)/Matrix/Ragusa16.mtx \
  310. + $(top_srcdir)/Matrix/Tina_AskCal.mtx \
  311. + $(top_srcdir)/Matrix/Tina_AskCal_perm.mtx \
  312. + $(top_srcdir)/Matrix/a0.mtx \
  313. + $(top_srcdir)/Matrix/a04.mtx \
  314. + $(top_srcdir)/Matrix/a1.mtx \
  315. + $(top_srcdir)/Matrix/a2.mtx \
  316. + $(top_srcdir)/Matrix/a4.mtx \
  317. + $(top_srcdir)/Matrix/arrow.mtx \
  318. + $(top_srcdir)/Matrix/ash219.mtx \
  319. + $(top_srcdir)/Matrix/b1_ss.mtx \
  320. + $(top_srcdir)/Matrix/bcspwr01.mtx \
  321. + $(top_srcdir)/Matrix/bfwa62.mtx \
  322. + $(top_srcdir)/Matrix/c2.mtx \
  323. + $(top_srcdir)/Matrix/c32.mtx \
  324. + $(top_srcdir)/Matrix/lfat5b.mtx \
  325. + $(top_srcdir)/Matrix/lp_share1b.mtx \
  326. + $(top_srcdir)/Matrix/lpi_galenet.mtx \
  327. + $(top_srcdir)/Matrix/lpi_itest6.mtx \
  328. + $(top_srcdir)/Matrix/r2.mtx \
  329. + $(top_srcdir)/Matrix/s32.mtx \
  330. + $(top_srcdir)/Matrix/west0067.mtx
  331. +
  332. +check-local: $(check_PROGRAMS) $(MATRICES)
  333. + ./qrtest $(srcdir)/matrixlist.txt > qrtest_out.txt
  334. + ./qrtest $(srcdir)/matrix1.txt > qrtest_out1.txt
  335. +endif
  336. +
  337. +CLEANFILES = qrtest_out.txt qrtest_out1.txt
  338. diff --git a/configure.ac b/configure.ac
  339. new file mode 100644
  340. --- /dev/null
  341. +++ b/configure.ac
  342. @@ -0,0 +1,119 @@
  343. +# -*- Autoconf -*-
  344. +# Process this file with autoconf to produce a configure script.
  345. +
  346. +AC_PREREQ([2.69])
  347. +AC_INIT([SPQR],[2.0.9],[https://github.com/DrTimothyAldenDavis/SuiteSparse],[spqr],[http://www.suitesparse.com/])
  348. +AC_CONFIG_SRCDIR([Source/spqr_kernel.cpp])
  349. +AC_CONFIG_AUX_DIR([build-aux])
  350. +AC_CONFIG_MACRO_DIR([m4])
  351. +AC_CONFIG_HEADERS([config.h])
  352. +AM_INIT_AUTOMAKE([foreign])
  353. +AM_SILENT_RULES([yes])
  354. +LT_INIT([disable-static])
  355. +
  356. +# Checks for programs.
  357. +PKG_PROG_PKG_CONFIG
  358. +AC_PROG_INSTALL
  359. +AC_PROG_F77
  360. +AC_PROG_CC
  361. +AC_PROG_CXX
  362. +AC_LANG([C++])
  363. +AX_CODE_COVERAGE
  364. +
  365. +AC_ARG_ENABLE([expert],
  366. + [AS_HELP_STRING(
  367. + [--disable-expert],
  368. + [compile without the min 2-norm solution option])],
  369. + [],
  370. + [AS_VAR_SET([enable_expert], [yes])])
  371. +
  372. +AC_ARG_WITH([tbb],
  373. + [AS_HELP_STRING(
  374. + [--without-tbb],
  375. + [do not use Intel Threading Building Blocks for multithreading])],
  376. + [],
  377. + [AS_VAR_SET([with_tbb], [yes])])
  378. +
  379. +AS_VAR_SET([LIBS_SAVED], [$LIBS])
  380. +
  381. +# Checks for libraries.
  382. +AC_CHECK_LIB([m], [sqrt])
  383. +
  384. +AX_BLAS(
  385. + [],
  386. + [AC_MSG_ERROR([cannot find BLAS])])
  387. +
  388. +AX_LAPACK(
  389. + [],
  390. + [AC_MSG_ERROR([cannot find LAPACK])])
  391. +
  392. +PKG_CHECK_MODULES([SUITESPARSECONFIG], [suitesparseconfig])
  393. +PKG_CHECK_MODULES([CHOLMOD], [cholmod])
  394. +
  395. +# Checks for header files.
  396. +AC_CHECK_HEADERS([float.h stdlib.h])
  397. +
  398. +AS_IF([test "x$with_tbb" = "xyes"], [
  399. + AC_CHECK_HEADERS([tbb/task_scheduler_init.h tbb/task.h])
  400. +])
  401. +
  402. +# Checks for typedefs, structures, and compiler characteristics.
  403. +AC_TYPE_SIZE_T
  404. +
  405. +# Checks for library functions.
  406. +AC_CHECK_FUNCS([sqrt])
  407. +
  408. +AS_VAR_SET([LIBS], [$LIBS_SAVED])
  409. +
  410. +AS_IF([test "x$with_tbb" = "xyes"], [
  411. + AC_SUBST([TBB_CFLAGS], [""])
  412. + AC_SUBST([TBB_LIBS], ["-ltbb"])
  413. +])
  414. +
  415. +AC_MSG_CHECKING([whether to use expert routines])
  416. +AC_MSG_RESULT([$enable_expert])
  417. +AM_CONDITIONAL([EXPERT], [test "x$enable_expert" = "xyes"])
  418. +
  419. +AC_MSG_CHECKING([whether to use Intel Threading Building Blocks])
  420. +AC_MSG_RESULT([$with_tbb])
  421. +AM_CONDITIONAL([TBB], [test "x$with_tbb" = "xyes"])
  422. +
  423. +m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
  424. +AC_CONFIG_FILES([
  425. + spqr.pc
  426. + Makefile
  427. + Demo/Makefile
  428. + Doc/Makefile
  429. + Include/Makefile
  430. + Matrix/Makefile
  431. + Source/Makefile
  432. + Tcov/Makefile
  433. +])
  434. +#AC_CONFIG_LINKS([Matrix:Matrix]) # Can't link an entire directory?
  435. +AC_CONFIG_LINKS([Matrix/GD01_b.mtx:Matrix/GD01_b.mtx])
  436. +AC_CONFIG_LINKS([Matrix/GD06_theory.mtx:Matrix/GD06_theory.mtx])
  437. +AC_CONFIG_LINKS([Matrix/GD98_a.mtx:Matrix/GD98_a.mtx])
  438. +AC_CONFIG_LINKS([Matrix/LFAT5.mtx:Matrix/LFAT5.mtx])
  439. +AC_CONFIG_LINKS([Matrix/Ragusa16.mtx:Matrix/Ragusa16.mtx])
  440. +AC_CONFIG_LINKS([Matrix/Tina_AskCal.mtx:Matrix/Tina_AskCal.mtx])
  441. +AC_CONFIG_LINKS([Matrix/Tina_AskCal_perm.mtx:Matrix/Tina_AskCal_perm.mtx])
  442. +AC_CONFIG_LINKS([Matrix/a0.mtx:Matrix/a0.mtx])
  443. +AC_CONFIG_LINKS([Matrix/a04.mtx:Matrix/a04.mtx])
  444. +AC_CONFIG_LINKS([Matrix/a1.mtx:Matrix/a1.mtx])
  445. +AC_CONFIG_LINKS([Matrix/a2.mtx:Matrix/a2.mtx])
  446. +AC_CONFIG_LINKS([Matrix/a4.mtx:Matrix/a4.mtx])
  447. +AC_CONFIG_LINKS([Matrix/arrow.mtx:Matrix/arrow.mtx])
  448. +AC_CONFIG_LINKS([Matrix/ash219.mtx:Matrix/ash219.mtx])
  449. +AC_CONFIG_LINKS([Matrix/b1_ss.mtx:Matrix/b1_ss.mtx])
  450. +AC_CONFIG_LINKS([Matrix/bcspwr01.mtx:Matrix/bcspwr01.mtx])
  451. +AC_CONFIG_LINKS([Matrix/bfwa62.mtx:Matrix/bfwa62.mtx])
  452. +AC_CONFIG_LINKS([Matrix/c2.mtx:Matrix/c2.mtx])
  453. +AC_CONFIG_LINKS([Matrix/c32.mtx:Matrix/c32.mtx])
  454. +AC_CONFIG_LINKS([Matrix/lfat5b.mtx:Matrix/lfat5b.mtx])
  455. +AC_CONFIG_LINKS([Matrix/lp_share1b.mtx:Matrix/lp_share1b.mtx])
  456. +AC_CONFIG_LINKS([Matrix/lpi_galenet.mtx:Matrix/lpi_galenet.mtx])
  457. +AC_CONFIG_LINKS([Matrix/lpi_itest6.mtx:Matrix/lpi_itest6.mtx])
  458. +AC_CONFIG_LINKS([Matrix/r2.mtx:Matrix/r2.mtx])
  459. +AC_CONFIG_LINKS([Matrix/s32.mtx:Matrix/s32.mtx])
  460. +AC_CONFIG_LINKS([Matrix/west0067.mtx:Matrix/west0067.mtx])
  461. +AC_OUTPUT
  462. diff --git a/m4/ax_blas.m4 b/m4/ax_blas.m4
  463. new file mode 100644
  464. --- /dev/null
  465. +++ b/m4/ax_blas.m4
  466. @@ -0,0 +1,241 @@
  467. +# ===========================================================================
  468. +# https://www.gnu.org/software/autoconf-archive/ax_blas.html
  469. +# ===========================================================================
  470. +#
  471. +# SYNOPSIS
  472. +#
  473. +# AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
  474. +#
  475. +# DESCRIPTION
  476. +#
  477. +# This macro looks for a library that implements the BLAS linear-algebra
  478. +# interface (see http://www.netlib.org/blas/). On success, it sets the
  479. +# BLAS_LIBS output variable to hold the requisite library linkages.
  480. +#
  481. +# To link with BLAS, you should link with:
  482. +#
  483. +# $BLAS_LIBS $LIBS $FLIBS
  484. +#
  485. +# in that order. FLIBS is the output variable of the
  486. +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is
  487. +# sometimes necessary in order to link with F77 libraries. Users will also
  488. +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
  489. +# reason.
  490. +#
  491. +# Many libraries are searched for, from ATLAS to CXML to ESSL. The user
  492. +# may also use --with-blas=<lib> in order to use some specific BLAS
  493. +# library <lib>. In order to link successfully, however, be aware that you
  494. +# will probably need to use the same Fortran compiler (which can be set
  495. +# via the F77 env. var.) as was used to compile the BLAS library.
  496. +#
  497. +# ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is
  498. +# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
  499. +# not found. If ACTION-IF-FOUND is not specified, the default action will
  500. +# define HAVE_BLAS.
  501. +#
  502. +# LICENSE
  503. +#
  504. +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
  505. +# Copyright (c) 2019 Geoffrey M. Oxberry <goxberry@gmail.com>
  506. +#
  507. +# This program is free software: you can redistribute it and/or modify it
  508. +# under the terms of the GNU General Public License as published by the
  509. +# Free Software Foundation, either version 3 of the License, or (at your
  510. +# option) any later version.
  511. +#
  512. +# This program is distributed in the hope that it will be useful, but
  513. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  514. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  515. +# Public License for more details.
  516. +#
  517. +# You should have received a copy of the GNU General Public License along
  518. +# with this program. If not, see <https://www.gnu.org/licenses/>.
  519. +#
  520. +# As a special exception, the respective Autoconf Macro's copyright owner
  521. +# gives unlimited permission to copy, distribute and modify the configure
  522. +# scripts that are the output of Autoconf when processing the Macro. You
  523. +# need not follow the terms of the GNU General Public License when using
  524. +# or distributing such scripts, even though portions of the text of the
  525. +# Macro appear in them. The GNU General Public License (GPL) does govern
  526. +# all other use of the material that constitutes the Autoconf Macro.
  527. +#
  528. +# This special exception to the GPL applies to versions of the Autoconf
  529. +# Macro released by the Autoconf Archive. When you make and distribute a
  530. +# modified version of the Autoconf Macro, you may extend this special
  531. +# exception to the GPL to apply to your modified version as well.
  532. +
  533. +#serial 17
  534. +
  535. +AU_ALIAS([ACX_BLAS], [AX_BLAS])
  536. +AC_DEFUN([AX_BLAS], [
  537. +AC_PREREQ([2.55])
  538. +AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
  539. +AC_REQUIRE([AC_CANONICAL_HOST])
  540. +ax_blas_ok=no
  541. +
  542. +AC_ARG_WITH(blas,
  543. + [AS_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
  544. +case $with_blas in
  545. + yes | "") ;;
  546. + no) ax_blas_ok=disable ;;
  547. + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o)
  548. + BLAS_LIBS="$with_blas"
  549. + ;;
  550. + *) BLAS_LIBS="-l$with_blas" ;;
  551. +esac
  552. +
  553. +# Get fortran linker names of BLAS functions to check for.
  554. +AC_F77_FUNC(sgemm)
  555. +AC_F77_FUNC(dgemm)
  556. +
  557. +ax_blas_save_LIBS="$LIBS"
  558. +LIBS="$LIBS $FLIBS"
  559. +
  560. +# First, check BLAS_LIBS environment variable
  561. +if test $ax_blas_ok = no; then
  562. +if test "x$BLAS_LIBS" != x; then
  563. + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
  564. + AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
  565. + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes], [BLAS_LIBS=""])
  566. + AC_MSG_RESULT($ax_blas_ok)
  567. + LIBS="$save_LIBS"
  568. +fi
  569. +fi
  570. +
  571. +# BLAS linked to by default? (happens on some supercomputers)
  572. +if test $ax_blas_ok = no; then
  573. + save_LIBS="$LIBS"; LIBS="$LIBS"
  574. + AC_MSG_CHECKING([if $sgemm is being linked in already])
  575. + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes])
  576. + AC_MSG_RESULT($ax_blas_ok)
  577. + LIBS="$save_LIBS"
  578. +fi
  579. +
  580. +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/)
  581. +if test $ax_blas_ok = no; then
  582. + AC_CHECK_LIB(openblas, $sgemm, [ax_blas_ok=yes
  583. + BLAS_LIBS="-lopenblas"])
  584. +fi
  585. +
  586. +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
  587. +if test $ax_blas_ok = no; then
  588. + AC_CHECK_LIB(atlas, ATL_xerbla,
  589. + [AC_CHECK_LIB(f77blas, $sgemm,
  590. + [AC_CHECK_LIB(cblas, cblas_dgemm,
  591. + [ax_blas_ok=yes
  592. + BLAS_LIBS="-lcblas -lf77blas -latlas"],
  593. + [], [-lf77blas -latlas])],
  594. + [], [-latlas])])
  595. +fi
  596. +
  597. +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
  598. +if test $ax_blas_ok = no; then
  599. + AC_CHECK_LIB(blas, $sgemm,
  600. + [AC_CHECK_LIB(dgemm, $dgemm,
  601. + [AC_CHECK_LIB(sgemm, $sgemm,
  602. + [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
  603. + [], [-lblas])],
  604. + [], [-lblas])])
  605. +fi
  606. +
  607. +# BLAS in Intel MKL library?
  608. +if test $ax_blas_ok = no; then
  609. + # MKL for gfortran
  610. + if test x"$ac_cv_fc_compiler_gnu" = xyes; then
  611. + # 64 bit
  612. + if test $host_cpu = x86_64; then
  613. + AC_CHECK_LIB(mkl_gf_lp64, $sgemm,
  614. + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread"],,
  615. + [-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread])
  616. + # 32 bit
  617. + elif test $host_cpu = i686; then
  618. + AC_CHECK_LIB(mkl_gf, $sgemm,
  619. + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread"],,
  620. + [-lmkl_gf -lmkl_sequential -lmkl_core -lpthread])
  621. + fi
  622. + # MKL for other compilers (Intel, PGI, ...?)
  623. + else
  624. + # 64-bit
  625. + if test $host_cpu = x86_64; then
  626. + AC_CHECK_LIB(mkl_intel_lp64, $sgemm,
  627. + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"],,
  628. + [-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread])
  629. + # 32-bit
  630. + elif test $host_cpu = i686; then
  631. + AC_CHECK_LIB(mkl_intel, $sgemm,
  632. + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread"],,
  633. + [-lmkl_intel -lmkl_sequential -lmkl_core -lpthread])
  634. + fi
  635. + fi
  636. +fi
  637. +# Old versions of MKL
  638. +if test $ax_blas_ok = no; then
  639. + AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread])
  640. +fi
  641. +
  642. +# BLAS in Apple vecLib library?
  643. +if test $ax_blas_ok = no; then
  644. + save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
  645. + AC_MSG_CHECKING([for $sgemm in -framework vecLib])
  646. + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
  647. + AC_MSG_RESULT($ax_blas_ok)
  648. + LIBS="$save_LIBS"
  649. +fi
  650. +
  651. +# BLAS in Alpha CXML library?
  652. +if test $ax_blas_ok = no; then
  653. + AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"])
  654. +fi
  655. +
  656. +# BLAS in Alpha DXML library? (now called CXML, see above)
  657. +if test $ax_blas_ok = no; then
  658. + AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"])
  659. +fi
  660. +
  661. +# BLAS in Sun Performance library?
  662. +if test $ax_blas_ok = no; then
  663. + if test "x$GCC" != xyes; then # only works with Sun CC
  664. + AC_CHECK_LIB(sunmath, acosp,
  665. + [AC_CHECK_LIB(sunperf, $sgemm,
  666. + [BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
  667. + ax_blas_ok=yes],[],[-lsunmath])])
  668. + fi
  669. +fi
  670. +
  671. +# BLAS in SCSL library? (SGI/Cray Scientific Library)
  672. +if test $ax_blas_ok = no; then
  673. + AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"])
  674. +fi
  675. +
  676. +# BLAS in SGIMATH library?
  677. +if test $ax_blas_ok = no; then
  678. + AC_CHECK_LIB(complib.sgimath, $sgemm,
  679. + [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
  680. +fi
  681. +
  682. +# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
  683. +if test $ax_blas_ok = no; then
  684. + AC_CHECK_LIB(blas, $sgemm,
  685. + [AC_CHECK_LIB(essl, $sgemm,
  686. + [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
  687. + [], [-lblas $FLIBS])])
  688. +fi
  689. +
  690. +# Generic BLAS library?
  691. +if test $ax_blas_ok = no; then
  692. + AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"])
  693. +fi
  694. +
  695. +AC_SUBST(BLAS_LIBS)
  696. +
  697. +LIBS="$ax_blas_save_LIBS"
  698. +
  699. +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
  700. +if test x"$ax_blas_ok" = xyes; then
  701. + ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])
  702. + :
  703. +else
  704. + ax_blas_ok=no
  705. + $2
  706. +fi
  707. +])dnl AX_BLAS
  708. diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
  709. new file mode 100644
  710. --- /dev/null
  711. +++ b/m4/ax_code_coverage.m4
  712. @@ -0,0 +1,271 @@
  713. +# ===========================================================================
  714. +# https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
  715. +# ===========================================================================
  716. +#
  717. +# SYNOPSIS
  718. +#
  719. +# AX_CODE_COVERAGE()
  720. +#
  721. +# DESCRIPTION
  722. +#
  723. +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
  724. +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
  725. +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
  726. +# build target (program or library) which should be built with code
  727. +# coverage support. Also defines CODE_COVERAGE_RULES which should be
  728. +# substituted in your Makefile; and $enable_code_coverage which can be
  729. +# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
  730. +# and substituted, and corresponds to the value of the
  731. +# --enable-code-coverage option, which defaults to being disabled.
  732. +#
  733. +# Test also for gcov program and create GCOV variable that could be
  734. +# substituted.
  735. +#
  736. +# Note that all optimization flags in CFLAGS must be disabled when code
  737. +# coverage is enabled.
  738. +#
  739. +# Usage example:
  740. +#
  741. +# configure.ac:
  742. +#
  743. +# AX_CODE_COVERAGE
  744. +#
  745. +# Makefile.am:
  746. +#
  747. +# @CODE_COVERAGE_RULES@
  748. +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
  749. +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
  750. +# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
  751. +# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
  752. +#
  753. +# This results in a "check-code-coverage" rule being added to any
  754. +# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
  755. +# has been configured with --enable-code-coverage). Running `make
  756. +# check-code-coverage` in that directory will run the module's test suite
  757. +# (`make check`) and build a code coverage report detailing the code which
  758. +# was touched, then print the URI for the report.
  759. +#
  760. +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
  761. +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
  762. +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
  763. +# deprecated. They have the same value.
  764. +#
  765. +# This code was derived from Makefile.decl in GLib, originally licenced
  766. +# under LGPLv2.1+.
  767. +#
  768. +# LICENSE
  769. +#
  770. +# Copyright (c) 2012, 2016 Philip Withnall
  771. +# Copyright (c) 2012 Xan Lopez
  772. +# Copyright (c) 2012 Christian Persch
  773. +# Copyright (c) 2012 Paolo Borelli
  774. +# Copyright (c) 2012 Dan Winship
  775. +# Copyright (c) 2015 Bastien ROUCARIES
  776. +#
  777. +# This library is free software; you can redistribute it and/or modify it
  778. +# under the terms of the GNU Lesser General Public License as published by
  779. +# the Free Software Foundation; either version 2.1 of the License, or (at
  780. +# your option) any later version.
  781. +#
  782. +# This library is distributed in the hope that it will be useful, but
  783. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  784. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
  785. +# General Public License for more details.
  786. +#
  787. +# You should have received a copy of the GNU Lesser General Public License
  788. +# along with this program. If not, see <https://www.gnu.org/licenses/>.
  789. +
  790. +#serial 27
  791. +
  792. +AC_DEFUN([_AX_CODE_COVERAGE_ENABLED],[
  793. + # check for gcov
  794. + AC_CHECK_TOOL([GCOV],
  795. + [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
  796. + [:])
  797. + AS_IF([test "X$GCOV" = "X:"],
  798. + [AC_MSG_ERROR([gcov is needed to do coverage])])
  799. + AC_SUBST([GCOV])
  800. +
  801. + dnl Check if gcc is being used
  802. + AS_IF([ test "$GCC" = "no" ], [
  803. + AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
  804. + ])
  805. +
  806. + AC_CHECK_PROG([LCOV], [lcov], [lcov])
  807. + AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
  808. +
  809. + AS_IF([ test x"$LCOV" = x ], [
  810. + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
  811. + ])
  812. +
  813. + AS_IF([ test x"$GENHTML" = x ], [
  814. + AC_MSG_ERROR([Could not find genhtml from the lcov package])
  815. + ])
  816. +
  817. + dnl Build the code coverage flags
  818. + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
  819. + CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
  820. + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  821. + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  822. + CODE_COVERAGE_LIBS="-lgcov"
  823. + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
  824. +
  825. + AC_SUBST([CODE_COVERAGE_CPPFLAGS])
  826. + AC_SUBST([CODE_COVERAGE_CFLAGS])
  827. + AC_SUBST([CODE_COVERAGE_CXXFLAGS])
  828. + AC_SUBST([CODE_COVERAGE_LIBS])
  829. + AC_SUBST([CODE_COVERAGE_LDFLAGS])
  830. +
  831. + [CODE_COVERAGE_RULES_CHECK='
  832. + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
  833. + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
  834. +']
  835. + [CODE_COVERAGE_RULES_CAPTURE='
  836. + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
  837. + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
  838. + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
  839. + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
  840. + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
  841. +']
  842. + [CODE_COVERAGE_RULES_CLEAN='
  843. +clean: code-coverage-clean
  844. +distclean: code-coverage-clean
  845. +code-coverage-clean:
  846. + -$(LCOV) --directory $(top_builddir) -z
  847. + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  848. + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
  849. +']
  850. +])
  851. +
  852. +AC_DEFUN([_AX_CODE_COVERAGE_DISABLED],[
  853. + [CODE_COVERAGE_RULES_CHECK='
  854. + @echo "Need to reconfigure with --enable-code-coverage"
  855. + ']
  856. + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
  857. + CODE_COVERAGE_RULES_CLEAN=''
  858. +])
  859. +
  860. +AC_DEFUN([AX_CODE_COVERAGE],[
  861. + dnl Check for --enable-code-coverage
  862. +
  863. + # allow to override gcov location
  864. + AC_ARG_WITH([gcov],
  865. + [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
  866. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
  867. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
  868. +
  869. + AC_MSG_CHECKING([whether to build with code coverage support])
  870. + AC_ARG_ENABLE([code-coverage],
  871. + AS_HELP_STRING([--enable-code-coverage],
  872. + [Whether to enable code coverage support]),,
  873. + enable_code_coverage=no)
  874. +
  875. + AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test "x$enable_code_coverage" = xyes])
  876. + AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
  877. + AC_MSG_RESULT($enable_code_coverage)
  878. +
  879. + AS_IF([ test "x$enable_code_coverage" = xyes ], [
  880. + _AX_CODE_COVERAGE_ENABLED
  881. + ], [
  882. + _AX_CODE_COVERAGE_DISABLED
  883. + ])
  884. +
  885. +[CODE_COVERAGE_RULES='
  886. +# Code coverage
  887. +#
  888. +# Optional:
  889. +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
  890. +# Multiple directories may be specified, separated by whitespace.
  891. +# (Default: $(top_builddir))
  892. +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
  893. +# by lcov for code coverage. (Default:
  894. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
  895. +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
  896. +# reports to be created. (Default:
  897. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
  898. +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
  899. +# set to 0 to disable it and leave empty to stay with the default.
  900. +# (Default: empty)
  901. +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
  902. +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  903. +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
  904. +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  905. +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
  906. +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
  907. +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  908. +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
  909. +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  910. +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
  911. +# lcov instance. (Default: empty)
  912. +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
  913. +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  914. +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
  915. +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  916. +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
  917. +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  918. +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
  919. +#
  920. +# The generated report will be titled using the $(PACKAGE_NAME) and
  921. +# $(PACKAGE_VERSION). In order to add the current git hash to the title,
  922. +# use the git-version-gen script, available online.
  923. +
  924. +# Optional variables
  925. +CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
  926. +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
  927. +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
  928. +CODE_COVERAGE_BRANCH_COVERAGE ?=
  929. +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  930. +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  931. +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  932. +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
  933. +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  934. +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  935. +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
  936. +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  937. +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
  938. +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  939. +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  940. +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  941. +CODE_COVERAGE_IGNORE_PATTERN ?=
  942. +
  943. +GITIGNOREFILES ?=
  944. +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  945. +
  946. +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
  947. +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
  948. +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
  949. + $(CODE_COVERAGE_OUTPUT_FILE);
  950. +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
  951. +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
  952. +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
  953. + $(CODE_COVERAGE_IGNORE_PATTERN);
  954. +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
  955. +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
  956. +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
  957. +code_coverage_quiet = $(code_coverage_quiet_$(V))
  958. +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
  959. +code_coverage_quiet_0 = --quiet
  960. +
  961. +# sanitizes the test-name: replaces with underscores: dashes and dots
  962. +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
  963. +
  964. +# Use recursive makes in order to ignore errors during check
  965. +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
  966. +
  967. +# Capture code coverage data
  968. +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
  969. +
  970. +# Hook rule executed before code-coverage-capture, overridable by the user
  971. +code-coverage-capture-hook:
  972. +
  973. +'"$CODE_COVERAGE_RULES_CLEAN"'
  974. +
  975. +A''M_DISTCHECK_CONFIGURE_FLAGS ?=
  976. +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
  977. +
  978. +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
  979. +']
  980. +
  981. + AC_SUBST([CODE_COVERAGE_RULES])
  982. + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
  983. +])
  984. diff --git a/m4/ax_lapack.m4 b/m4/ax_lapack.m4
  985. new file mode 100644
  986. --- /dev/null
  987. +++ b/m4/ax_lapack.m4
  988. @@ -0,0 +1,134 @@
  989. +# ===========================================================================
  990. +# https://www.gnu.org/software/autoconf-archive/ax_lapack.html
  991. +# ===========================================================================
  992. +#
  993. +# SYNOPSIS
  994. +#
  995. +# AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
  996. +#
  997. +# DESCRIPTION
  998. +#
  999. +# This macro looks for a library that implements the LAPACK linear-algebra
  1000. +# interface (see http://www.netlib.org/lapack/). On success, it sets the
  1001. +# LAPACK_LIBS output variable to hold the requisite library linkages.
  1002. +#
  1003. +# To link with LAPACK, you should link with:
  1004. +#
  1005. +# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS
  1006. +#
  1007. +# in that order. BLAS_LIBS is the output variable of the AX_BLAS macro,
  1008. +# called automatically. FLIBS is the output variable of the
  1009. +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is
  1010. +# sometimes necessary in order to link with F77 libraries. Users will also
  1011. +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
  1012. +# reason.
  1013. +#
  1014. +# The user may also use --with-lapack=<lib> in order to use some specific
  1015. +# LAPACK library <lib>. In order to link successfully, however, be aware
  1016. +# that you will probably need to use the same Fortran compiler (which can
  1017. +# be set via the F77 env. var.) as was used to compile the LAPACK and BLAS
  1018. +# libraries.
  1019. +#
  1020. +# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library
  1021. +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
  1022. +# is not found. If ACTION-IF-FOUND is not specified, the default action
  1023. +# will define HAVE_LAPACK.
  1024. +#
  1025. +# LICENSE
  1026. +#
  1027. +# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
  1028. +# Copyright (c) 2019 Geoffrey M. Oxberry <goxberry@gmail.com>
  1029. +#
  1030. +# This program is free software: you can redistribute it and/or modify it
  1031. +# under the terms of the GNU General Public License as published by the
  1032. +# Free Software Foundation, either version 3 of the License, or (at your
  1033. +# option) any later version.
  1034. +#
  1035. +# This program is distributed in the hope that it will be useful, but
  1036. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  1037. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  1038. +# Public License for more details.
  1039. +#
  1040. +# You should have received a copy of the GNU General Public License along
  1041. +# with this program. If not, see <https://www.gnu.org/licenses/>.
  1042. +#
  1043. +# As a special exception, the respective Autoconf Macro's copyright owner
  1044. +# gives unlimited permission to copy, distribute and modify the configure
  1045. +# scripts that are the output of Autoconf when processing the Macro. You
  1046. +# need not follow the terms of the GNU General Public License when using
  1047. +# or distributing such scripts, even though portions of the text of the
  1048. +# Macro appear in them. The GNU General Public License (GPL) does govern
  1049. +# all other use of the material that constitutes the Autoconf Macro.
  1050. +#
  1051. +# This special exception to the GPL applies to versions of the Autoconf
  1052. +# Macro released by the Autoconf Archive. When you make and distribute a
  1053. +# modified version of the Autoconf Macro, you may extend this special
  1054. +# exception to the GPL to apply to your modified version as well.
  1055. +
  1056. +#serial 10
  1057. +
  1058. +AU_ALIAS([ACX_LAPACK], [AX_LAPACK])
  1059. +AC_DEFUN([AX_LAPACK], [
  1060. +AC_REQUIRE([AX_BLAS])
  1061. +ax_lapack_ok=no
  1062. +
  1063. +AC_ARG_WITH(lapack,
  1064. + [AS_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])])
  1065. +case $with_lapack in
  1066. + yes | "") ;;
  1067. + no) ax_lapack_ok=disable ;;
  1068. + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o)
  1069. + LAPACK_LIBS="$with_lapack"
  1070. + ;;
  1071. + *) LAPACK_LIBS="-l$with_lapack" ;;
  1072. +esac
  1073. +
  1074. +# Get fortran linker name of LAPACK function to check for.
  1075. +AC_F77_FUNC(cheev)
  1076. +
  1077. +# We cannot use LAPACK if BLAS is not found
  1078. +if test "x$ax_blas_ok" != xyes; then
  1079. + ax_lapack_ok=noblas
  1080. + LAPACK_LIBS=""
  1081. +fi
  1082. +
  1083. +# First, check LAPACK_LIBS environment variable
  1084. +if test "x$LAPACK_LIBS" != x; then
  1085. + save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
  1086. + AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS])
  1087. + AC_LINK_IFELSE([AC_LANG_CALL([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""])
  1088. + AC_MSG_RESULT($ax_lapack_ok)
  1089. + LIBS="$save_LIBS"
  1090. + if test $ax_lapack_ok = no; then
  1091. + LAPACK_LIBS=""
  1092. + fi
  1093. +fi
  1094. +
  1095. +# LAPACK linked to by default? (is sometimes included in BLAS lib)
  1096. +if test $ax_lapack_ok = no; then
  1097. + save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS"
  1098. + AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes])
  1099. + LIBS="$save_LIBS"
  1100. +fi
  1101. +
  1102. +# Generic LAPACK library?
  1103. +for lapack in lapack lapack_rs6k; do
  1104. + if test $ax_lapack_ok = no; then
  1105. + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
  1106. + AC_CHECK_LIB($lapack, $cheev,
  1107. + [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS])
  1108. + LIBS="$save_LIBS"
  1109. + fi
  1110. +done
  1111. +
  1112. +AC_SUBST(LAPACK_LIBS)
  1113. +
  1114. +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
  1115. +if test x"$ax_lapack_ok" = xyes; then
  1116. + ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1])
  1117. + :
  1118. +else
  1119. + ax_lapack_ok=no
  1120. + $2
  1121. +fi
  1122. +])dnl AX_LAPACK
  1123. diff --git a/spqr.pc.in b/spqr.pc.in
  1124. new file mode 100644
  1125. --- /dev/null
  1126. +++ b/spqr.pc.in
  1127. @@ -0,0 +1,13 @@
  1128. +prefix=@prefix@
  1129. +exec_prefix=@exec_prefix@
  1130. +libdir=@libdir@
  1131. +includedir=@includedir@
  1132. +
  1133. +Name: @PACKAGE_NAME@
  1134. +Description: Multifrontal sparse QR factorization
  1135. +Version: @PACKAGE_VERSION@
  1136. +URL: @PACKAGE_URL@
  1137. +Requires.private: cholmod suitesparseconfig
  1138. +Libs: -L${libdir} -lspqr
  1139. +Libs.private: @TBB_LIBS@ @LAPACK_LIBS@ @BLAS_LIBS@ -lm
  1140. +Cflags: -I${includedir}/spqr