1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
#===============================================================================
# SuiteSparse_config.mk: common configuration file for the SuiteSparse
#===============================================================================
# This file contains all configuration settings for all packages in SuiteSparse,
# except for CSparse (which is stand-alone), the packages in MATLAB_Tools,
# and GraphBLAS. The configuration settings for GraphBLAS are determined by
# GraphBLAS/CMakeLists.txt
SUITESPARSE_VERSION =
#---------------------------------------------------------------------------
# determine what system we are on
#---------------------------------------------------------------------------
# To disable these auto configurations, use 'make UNAME=custom'
# Cygwin Make on Windows has an $(OS) variable, but not uname.
# Note that this option is untested.
UNAME =
else
# Linux and Darwin (Mac OSX) have been tested.
UNAME :=
endif
endif
#===============================================================================
# Options you can change without editing this file:
#===============================================================================
# To list the options you can modify at the 'make' command line, type
# 'make config', which also lists their default values. You can then
# change them with 'make OPTION=value'. For example, to use an INSTALL
# path of /my/path, and to use your own BLAS and LAPACK libraries, do:
#
# make install INSTALL=/my/path BLAS=-lmyblas LAPACK=-lmylapackgoeshere
#
# which will install the package into /my/path/lib and /my/path/include,
# and use -lmyblas -lmylapackgoes here when building the demo program.
#===============================================================================
# Defaults for any system
#===============================================================================
#---------------------------------------------------------------------------
# SuiteSparse root directory
#---------------------------------------------------------------------------
# Most Makefiles are in SuiteSparse/Pkg/Lib or SuiteSparse/Pkg/Demo, so
# the top-level of SuiteSparse is in ../.. unless otherwise specified.
# This is true for all but the SuiteSparse_config package.
SUITESPARSE ?=
#---------------------------------------------------------------------------
# installation location
#---------------------------------------------------------------------------
# For "make install" and "make uninstall", the default location is
# SuiteSparse/lib, SuiteSparse/include, and
# SuiteSparse/share/doc/suitesparse-x.y.z
# If you do this:
# make install INSTALL=/usr/local
# then the libraries are installed in /usr/local/lib, include files in
# /usr/local/include, and documentation in
# /usr/local/share/doc/suitesparse-x.y.z.
# You can instead specify the install location of each of these 3 components
# separately, via (for example):
# make install INSTALL_LIB=/yada/mylibs INSTALL_INCLUDE=/yoda/myinc \
# INSTALL_DOC=/solo/mydox
# which puts the libraries in /yada/mylibs, include files in /yoda/myinc,
# and documentation in /solo/mydox.
INSTALL ?=
INSTALL_LIB ?=
INSTALL_INCLUDE ?=
INSTALL_DOC ?=
#---------------------------------------------------------------------------
# parallel make
#---------------------------------------------------------------------------
# use 8 jobs by default
JOBS ?=
CMAKE_OPTIONS ?=
#---------------------------------------------------------------------------
# optimization level
#---------------------------------------------------------------------------
OPTIMIZATION ?=
#---------------------------------------------------------------------------
# statement coverage for */Tcov
#---------------------------------------------------------------------------
# Each package has a */Tcov directory for extensive testing, including
# statement coverage. The Tcov tests require Linux and gcc, and use
# the vanilla BLAS. For those tests, the packages use 'make TCOV=yes',
# which overrides the following settings:
# MKLROOT =
AUTOCC =
CC =
CXX =
# BLAS = -lrefblas -lgfortran -lstdc++
# LAPACK = -llapack
CFLAGS +=
OPTIMIZATION =
LDFLAGS +=
endif
#---------------------------------------------------------------------------
# OpenMP is used in CHOLMOD
#---------------------------------------------------------------------------
# with gcc, enable OpenMP directives via -fopenmp
# This is not supported on Darwin, so this string is cleared, below.
CFOPENMP ?=
#---------------------------------------------------------------------------
# compiler
#---------------------------------------------------------------------------
# If AUTOCCC is yes, look for the Intel compilers. If present, they are
# used instead of $(CC), $(CXX), and $(F77). To disable this feature and
# use the $(CC), $(CXX), and $(F77) compilers, use 'make AUTOCC=no'
# AUTOCC ?= yes
AUTOCC ?=
# use the Intel icc compiler for C codes, and -qopenmp for OpenMP
CC =
CFLAGS +=
CXX =
CFOPENMP =
LDFLAGS +=
LDLIBS +=
endif
# use the Intel ifort compiler for Fortran codes
F77 =
endif
endif
CMAKE_OPTIONS +=
#---------------------------------------------------------------------------
# CFLAGS for the C/C++ compiler
#---------------------------------------------------------------------------
# The CF macro is used by SuiteSparse Makefiles as a combination of
# CFLAGS, CPPFLAGS, TARGET_ARCH, and system-dependent settings.
CF ?=
#---------------------------------------------------------------------------
# code formatting (for Tcov on Linux only)
#---------------------------------------------------------------------------
PRETTY ?=
#---------------------------------------------------------------------------
# required libraries
#---------------------------------------------------------------------------
# SuiteSparse requires the BLAS, LAPACK, and -lm (Math) libraries.
# It places its shared *.so libraries in SuiteSparse/lib.
# Linux also requires the -lrt library (see below)
LDLIBS ?=
LDFLAGS +=
# NOTE: Use of the Intel MKL BLAS is strongly recommended. The OpenBLAS can
# result in severe performance degradation, in CHOLMOD in particular.
# This script can also detect if the Intel MKL BLAS is installed.
# use the Intel MKL for BLAS and LAPACK
# using static linking:
# BLAS = -Wl,--start-group \
# $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a \
# $(MKLROOT)/lib/intel64/libmkl_core.a \
# $(MKLROOT)/lib/intel64/libmkl_intel_thread.a \
# -Wl,--end-group -lpthread -lm
# using dynamic linking:
BLAS ?=
LAPACK ?=
endif
else
BLAS ?=
LAPACK ?=
endif
endif
# For ACML, use this instead:
# make BLAS='-lacml -lgfortran'
#---------------------------------------------------------------------------
# shell commands
#---------------------------------------------------------------------------
# ranlib, and ar, for generating libraries. If you don't need ranlib,
# just change it to RANLAB = echo
RANLIB ?=
ARCHIVE ?=
CP ?=
MV ?=
#---------------------------------------------------------------------------
# Fortran compiler (not required for 'make' or 'make library')
#---------------------------------------------------------------------------
# A Fortran compiler is optional. Only required for the optional Fortran
# interfaces to AMD and UMFPACK. Not needed by 'make' or 'make install'
F77 ?=
F77FLAGS ?=
#---------------------------------------------------------------------------
# NVIDIA CUDA configuration for CHOLMOD and SPQR
#---------------------------------------------------------------------------
# CUDA is detected automatically, and used if found. To disable CUDA,
# use CUDA=no
CUDA =
CUDA_PATH =
endif
# CUDA is not present
CUDA_PATH =
GPU_BLAS_PATH =
GPU_CONFIG =
CUDART_LIB =
CUBLAS_LIB =
CUDA_INC_PATH =
CUDA_INC =
NVCC =
NVCCFLAGS =
else
# with CUDA for CHOLMOD and SPQR
GPU_BLAS_PATH =
# GPU_CONFIG must include -DGPU_BLAS to compile SuiteSparse for the
# GPU. You can add additional GPU-related flags to it as well.
# with 4 cores (default):
GPU_CONFIG =
# For example, to compile CHOLMOD for 10 CPU cores when using the GPU:
# GPU_CONFIG = -DGPU_BLAS -DCHOLMOD_OMP_NUM_THREADS=10
CUDART_LIB =
CUBLAS_LIB =
CUDA_INC_PATH =
CUDA_INC =
MAGMA_INC =
MAGMA_LIB =
NVCC =
NVCCFLAGS =
endif
#---------------------------------------------------------------------------
# UMFPACK configuration:
#---------------------------------------------------------------------------
# Configuration for UMFPACK. See UMFPACK/Source/umf_config.h for details.
#
# -DNBLAS do not use the BLAS. UMFPACK will be very slow.
# -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by
# LAPACK and the BLAS (defaults to 'int')
# -DNSUNPERF do not use the Sun Perf. Library on Solaris
# -DNRECIPROCAL do not multiply by the reciprocal
# -DNO_DIVIDE_BY_ZERO do not divide by zero
# -DNCHOLMOD do not use CHOLMOD as a ordering method. If -DNCHOLMOD is
# included in UMFPACK_CONFIG, then UMFPACK does not rely on
# CHOLMOD, CAMD, CCOLAMD, COLAMD, and METIS.
UMFPACK_CONFIG ?=
# For example, uncomment this line to compile UMFPACK without CHOLMOD:
# UMFPACK_CONFIG = -DNCHOLMOD
# or use 'make UMFPACK_CONFIG=-DNCHOLMOD'
#---------------------------------------------------------------------------
# CHOLMOD configuration
#---------------------------------------------------------------------------
# CHOLMOD Library Modules, which appear in -lcholmod
# Core requires: none
# Check requires: Core
# Cholesky requires: Core, AMD, COLAMD. optional: Partition, Supernodal
# MatrixOps requires: Core
# Modify requires: Core
# Partition requires: Core, CCOLAMD, METIS. optional: Cholesky
# Supernodal requires: Core, BLAS, LAPACK
#
# CHOLMOD test/demo Modules (these do not appear in -lcholmod):
# Tcov requires: Core, Check, Cholesky, MatrixOps, Modify, Supernodal
# optional: Partition
# Valgrind same as Tcov
# Demo requires: Core, Check, Cholesky, MatrixOps, Supernodal
# optional: Partition
#
# Configuration flags:
# -DNCHECK do not include the Check module.
# -DNCHOLESKY do not include the Cholesky module.
# -DNPARTITION do not include the Partition module.
# also do not include METIS.
# -DNCAMD do not use CAMD & CCOLAMD in Parition Module.
# -DNMATRIXOPS do not include the MatrixOps module.
# -DNMODIFY do not include the Modify module.
# -DNSUPERNODAL do not include the Supernodal module.
#
# -DNPRINT do not print anything.
# -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by
# LAPACK and the BLAS (defaults to 'int')
# -DNSUNPERF for Solaris only. If defined, do not use the Sun
# Performance Library
# -DGPU_BLAS enable the use of the CUDA BLAS
CHOLMOD_CONFIG ?=
#---------------------------------------------------------------------------
# SuiteSparseQR configuration:
#---------------------------------------------------------------------------
# The SuiteSparseQR library can be compiled with the following options:
#
# -DNPARTITION do not include the CHOLMOD partition module
# -DNEXPERT do not include the functions in SuiteSparseQR_expert.cpp
# -DHAVE_TBB enable the use of Intel's Threading Building Blocks
# -DGPU_BLAS enable the use of the CUDA BLAS
SPQR_CONFIG ?=
# to compile with Intel's TBB, use TBB=-ltbb -DSPQR_CONFIG=-DHAVE_TBB
TBB ?=
# TBB = -ltbb -DSPQR_CONFIG=-DHAVE_TBB
# TODO: this *mk file should auto-detect the presence of Intel's TBB,
# and set the compiler flags accordingly.
#===============================================================================
# System-dependent configurations
#===============================================================================
#---------------------------------------------------------------------------
# Linux
#---------------------------------------------------------------------------
# add the realtime library, librt, and SuiteSparse/lib
LDLIBS +=
endif
#---------------------------------------------------------------------------
# Mac
#---------------------------------------------------------------------------
# To compile on the Mac, you must install Xcode. Then do this at the
# command line in the Terminal, before doing 'make':
# xcode-select --install
CF +=
BLAS ?=
LAPACK ?=
# OpenMP is not yet supported by default in clang
CFOPENMP =
LDLIBS +=
endif
#---------------------------------------------------------------------------
# Solaris
#---------------------------------------------------------------------------
# Using the Sun compiler and the Sun Performance Library
# This hasn't been tested recently.
# I leave it here in case you need it. It likely needs updating.
CF +=
F77FLAGS =
BLAS ?=
LAPACK ?=
# Using the GCC compiler and the reference BLAS
## CC = gcc
## CXX = g++
## MAKE = gmake
## BLAS = -lrefblas -lgfortran
## LAPACK = -llapack
endif
#---------------------------------------------------------------------------
# IBM AIX
#---------------------------------------------------------------------------
# hasn't been tested for a very long time...
# I leave it here in case you need it. It likely needs updating.
CF +=
F77FLAGS ?=
BLAS ?=
LAPACK ?=
endif
#===============================================================================
# finalize the CF compiler flags
#===============================================================================
CF +=
#===============================================================================
# internal configuration
#===============================================================================
# The user should not have to change these definitions, and they are
# not displayed by 'make config'
#---------------------------------------------------------------------------
# for removing files not in the distribution
#---------------------------------------------------------------------------
# remove object files, but keep compiled libraries via 'make clean'
CLEAN =
# also remove compiled libraries, via 'make distclean'
PURGE =
# location of TCOV test output
TCOV_TMP ?=
#===============================================================================
# Building the shared and static libraries
#===============================================================================
# How to build/install shared and static libraries for Mac and Linux/Unix.
# This assumes that LIBRARY and VERSION have already been defined by the
# Makefile that includes this file.
SO_OPTS =
# Cygwin Make on Windows (untested)
AR_TARGET =
SO_PLAIN =
SO_MAIN =
SO_TARGET =
SO_INSTALL_NAME =
else
# Mac or Linux/Unix
AR_TARGET =
# Mac
SO_PLAIN =
SO_MAIN =
SO_TARGET =
SO_OPTS +=
# When a Mac *.dylib file is moved, this command is required
# to change its internal name to match its location in the filesystem:
SO_INSTALL_NAME =
else
# Linux and other variants of Unix
SO_PLAIN =
SO_MAIN =
SO_TARGET =
SO_OPTS +=
# Linux/Unix *.so files can be moved without modification:
SO_INSTALL_NAME =
endif
endif
#===============================================================================
# Configure CHOLMOD/Partition module with METIS, CAMD, and CCOLAMD
#===============================================================================
# By default, SuiteSparse uses METIS 5.1.0 in the SuiteSparse/metis-5.1.0
# directory. SuiteSparse's interface to METIS is only through the
# SuiteSparse/CHOLMOD/Partition module, which also requires SuiteSparse/CAMD
# and SuiteSparse/CCOLAMD.
#
# If you wish to use your own pre-installed copy of METIS, use the MY_METIS_LIB
# and MY_METIS_INC options passed to 'make'. For example:
# make MY_METIS_LIB=-lmetis
# make MY_METIS_LIB=/home/myself/mylibraries/libmetis.so
# make MY_METIS_LIB='-L/home/myself/mylibraries -lmetis'
# If you need to tell the compiler where to find the metis.h include file,
# then add MY_METIS_INC=/home/myself/metis-5.1.0/include as well, which points
# to the directory containing metis.h. If metis.h is already installed in
# a location known to the compiler (/usr/local/include/metis.h for example)
# then you do not need to add MY_METIS_INC.
I_WITH_PARTITION =
LIB_WITH_PARTITION =
CONFIG_PARTITION =
# check if CAMD/CCOLAMD and METIS are requested and available
# CAMD and CCOLAMD are requested. See if they are available in
# SuiteSparse/CAMD and SuiteSparse/CCOLAMD
# CAMD and CCOLAMD are requested and available
LIB_WITH_PARTITION =
I_WITH_PARTITION =
CONFIG_PARTITION =
# check if METIS is requested and available
# METIS is requested. See if it is available.
# METIS 5.1.0 is provided elsewhere, and we are not using
# SuiteSparse/metis-5.1.0. To do so, we link with
# $(MY_METIS_LIB) and add the -I$(MY_METIS_INC) option for
# the compiler. The latter can be empty if you have METIS
# installed in a place where the compiler can find the
# metis.h include file by itself without any -I option
# (/usr/local/include/metis.h for example).
LIB_WITH_PARTITION +=
I_WITH_PARTITION +=
endif
CONFIG_PARTITION =
else
# see if METIS is in SuiteSparse/metis-5.1.0
# SuiteSparse/metis5.1.0 is available
LIB_WITH_PARTITION +=
else
LIB_WITH_PARTITION +=
endif
I_WITH_PARTITION +=
CONFIG_PARTITION =
endif
endif
endif
endif
endif
endif
#===============================================================================
# display configuration
#===============================================================================
# placeholders, for 'make config' in the top-level SuiteSparse
LIBRARY=
VERSION=
SO_VERSION=
endif
# 'make config' lists the primary installation options
: