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