1#=============================================================================== 2# SuiteSparse_config.mk: common configuration file for the SuiteSparse 3#=============================================================================== 4 5# This file contains all configuration settings for all packages authored or 6# co-authored by Tim Davis: 7# 8# Package Version Description 9# ------- ------- ----------- 10# AMD 1.2 or later approximate minimum degree ordering 11# COLAMD 2.4 or later column approximate minimum degree ordering 12# CCOLAMD 1.0 or later constrained column approximate minimum degree ordering 13# CAMD any constrained approximate minimum degree ordering 14# UMFPACK 4.5 or later sparse LU factorization, with the BLAS 15# CHOLMOD any sparse Cholesky factorization, update/downdate 16# KLU 0.8 or later sparse LU factorization, BLAS-free 17# BTF 0.8 or later permutation to block triangular form 18# LDL 1.2 or later concise sparse LDL' 19# CXSparse any extended version of CSparse (int/long, real/complex) 20# SuiteSparseQR any sparse QR factorization 21# RBio 2.0 or later read/write sparse matrices in Rutherford-Boeing format 22# 23# By design, this file is NOT included in the CSparse makefile. 24# That package is fully stand-alone. CSparse is primarily for teaching; 25# production code should use CXSparse. 26# 27# The SuiteSparse_config directory and the above packages should all appear in 28# a single directory, in order for the Makefile's within each package to find 29# this file. 30# 31# To enable an option of the form "# OPTION = ...", edit this file and 32# delete the "#" in the first column of the option you wish to use. 33# 34# The use of METIS 4.0.1 is optional. To exclude METIS, you must compile with 35# CHOLMOD_CONFIG set to -DNPARTITION. See below for details. However, if you 36# do not have a metis-4.0 directory inside the SuiteSparse directory, the 37# */Makefile's that optionally rely on METIS will automatically detect this 38# and compile without METIS. 39 40#------------------------------------------------------------------------------ 41# Generic configuration 42#------------------------------------------------------------------------------ 43 44# Using standard definitions from the make environment, typically: 45# 46# CC cc C compiler 47# CXX g++ C++ compiler 48# CFLAGS [ ] flags for C and C++ compiler 49# CPPFLAGS [ ] flags for C and C++ compiler 50# TARGET_ARCH [ ] target architecture 51# FFLAGS [ ] flags for Fortran compiler 52# RM rm -f delete a file 53# AR ar create a static *.a library archive 54# ARFLAGS rv flags for ar 55# MAKE make make itself (sometimes called gmake) 56# 57# You can redefine them here, but by default they are used from the 58# default make environment. 59 60# C and C++ compiler flags. The first three are standard for *.c and *.cpp 61# Add -DNTIMER if you do use any timing routines (otherwise -lrt is required). 62# CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER 63 CF = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -O3 -fexceptions -fPIC 64 65# ranlib, and ar, for generating libraries. If you don't need ranlib, 66# just change it to RANLAB = echo 67RANLIB = ranlib 68ARCHIVE = $(AR) $(ARFLAGS) 69 70# copy and delete a file 71CP = cp -f 72MV = mv -f 73 74# Fortran compiler (not required for 'make' or 'make library') 75F77 = gfortran 76F77FLAGS = $(FFLAGS) -O 77F77LIB = 78 79# C and Fortran libraries. Remove -lrt if you don't have it. 80 LIB = -lm -lrt 81# Using the following requires CF = ... -DNTIMER on POSIX C systems. 82# LIB = -lm 83 84# For "make install" 85INSTALL_LIB = /usr/local/lib 86INSTALL_INCLUDE = /usr/local/include 87 88# Which version of MAKE you are using (default is "make") 89# MAKE = make 90# MAKE = gmake 91 92#------------------------------------------------------------------------------ 93# BLAS and LAPACK configuration: 94#------------------------------------------------------------------------------ 95 96# UMFPACK and CHOLMOD both require the BLAS. CHOLMOD also requires LAPACK. 97# See Kazushige Goto's BLAS at http://www.cs.utexas.edu/users/flame/goto/ or 98# http://www.tacc.utexas.edu/~kgoto/ for the best BLAS to use with CHOLMOD. 99# LAPACK is at http://www.netlib.org/lapack/ . You can use the standard 100# Fortran LAPACK along with Goto's BLAS to obtain very good performance. 101# CHOLMOD gets a peak numeric factorization rate of 3.6 Gflops on a 3.2 GHz 102# Pentium 4 (512K cache, 4GB main memory) with the Goto BLAS, and 6 Gflops 103# on a 2.5Ghz dual-core AMD Opteron. 104 105# These settings will probably not work, since there is no fixed convention for 106# naming the BLAS and LAPACK library (*.a or *.so) files. 107 108# This is probably slow ... it might connect to the Standard Reference BLAS: 109BLAS = -lblas -lgfortran 110LAPACK = -llapack 111 112# NOTE: this next option for the "Goto BLAS" has nothing to do with a "goto" 113# statement. Rather, the Goto BLAS is written by Dr. Kazushige Goto. 114# Using the Goto BLAS: 115# BLAS = -lgoto -lgfortran -lgfortranbegin 116# BLAS = -lgoto2 -lgfortran -lgfortranbegin -lpthread 117 118# Using non-optimized versions: 119# BLAS = -lblas_plain -lgfortran -lgfortranbegin 120# LAPACK = -llapack_plain 121 122# BLAS = -lblas_plain -lgfortran -lgfortranbegin 123# LAPACK = -llapack 124 125# The BLAS might not contain xerbla, an error-handling routine for LAPACK and 126# the BLAS. Also, the standard xerbla requires the Fortran I/O library, and 127# stops the application program if an error occurs. A C version of xerbla 128# distributed with this software (SuiteSparse_config/xerbla/libcerbla.a) 129# includes a Fortran-callable xerbla routine that prints nothing and does not 130# stop the application program. This is optional. 131 132# XERBLA = ../../SuiteSparse_config/xerbla/libcerbla.a 133 134# If you wish to use the XERBLA in LAPACK and/or the BLAS instead, 135# use this option: 136XERBLA = 137 138# If you wish to use the Fortran SuiteSparse_config/xerbla/xerbla.f instead, 139# use this: 140 141# XERBLA = ../../SuiteSparse_config/xerbla/libxerbla.a 142 143#------------------------------------------------------------------------------ 144# GPU configuration for CHOLMOD, using the CUDA BLAS 145#------------------------------------------------------------------------------ 146 147# no cuda 148# GPU_BLAS_PATH = 149# GPU_CONFIG = 150 151# with cuda BLAS acceleration for CHOLMOD 152 GPU_BLAS_PATH=/usr/local/cuda 153 GPU_CONFIG=-DGPU_BLAS -I$(GPU_BLAS_PATH)/include 154 155#------------------------------------------------------------------------------ 156# METIS, optionally used by CHOLMOD 157#------------------------------------------------------------------------------ 158 159# If you do not have METIS, or do not wish to use it in CHOLMOD, you must 160# compile CHOLMOD with the -DNPARTITION flag. 161 162# The path is relative to where it is used, in CHOLMOD/Lib, CHOLMOD/MATLAB, etc. 163# You may wish to use an absolute path. METIS is optional. Compile 164# CHOLMOD with -DNPARTITION if you do not wish to use METIS. 165METIS_PATH = ../../metis-4.0 166METIS = ../../metis-4.0/libmetis.a 167 168#------------------------------------------------------------------------------ 169# UMFPACK configuration: 170#------------------------------------------------------------------------------ 171 172# Configuration flags for UMFPACK. See UMFPACK/Source/umf_config.h for details. 173# 174# -DNBLAS do not use the BLAS. UMFPACK will be very slow. 175# -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by 176# LAPACK and the BLAS (defaults to 'int') 177# -DNSUNPERF do not use the Sun Perf. Library (default is use it on Solaris) 178# -DNRECIPROCAL do not multiply by the reciprocal 179# -DNO_DIVIDE_BY_ZERO do not divide by zero 180# -DNCHOLMOD do not use CHOLMOD as a ordering method. If -DNCHOLMOD is 181# included in UMFPACK_CONFIG, then UMFPACK does not rely on 182# CHOLMOD, CAMD, CCOLAMD, COLAMD, and METIS. 183 184UMFPACK_CONFIG = 185 186# uncomment this line to compile UMFPACK without CHOLMOD: 187# UMFPACK_CONFIG = -DNCHOLMOD 188 189#------------------------------------------------------------------------------ 190# CHOLMOD configuration 191#------------------------------------------------------------------------------ 192 193# CHOLMOD Library Modules, which appear in libcholmod.a: 194# Core requires: none 195# Check requires: Core 196# Cholesky requires: Core, AMD, COLAMD. optional: Partition, Supernodal 197# MatrixOps requires: Core 198# Modify requires: Core 199# Partition requires: Core, CCOLAMD, METIS. optional: Cholesky 200# Supernodal requires: Core, BLAS, LAPACK 201# 202# CHOLMOD test/demo Modules (all are GNU GPL, do not appear in libcholmod.a): 203# Tcov requires: Core, Check, Cholesky, MatrixOps, Modify, Supernodal 204# optional: Partition 205# Valgrind same as Tcov 206# Demo requires: Core, Check, Cholesky, MatrixOps, Supernodal 207# optional: Partition 208# 209# Configuration flags: 210# -DNCHECK do not include the Check module. License GNU LGPL 211# -DNCHOLESKY do not include the Cholesky module. License GNU LGPL 212# -DNPARTITION do not include the Partition module. License GNU LGPL 213# also do not include METIS. 214# -DNCAMD do not use CAMD, etc from Partition module. GNU LGPL 215# -DNGPL do not include any GNU GPL Modules in the CHOLMOD library: 216# -DNMATRIXOPS do not include the MatrixOps module. License GNU GPL 217# -DNMODIFY do not include the Modify module. License GNU GPL 218# -DNSUPERNODAL do not include the Supernodal module. License GNU GPL 219# 220# -DNPRINT do not print anything. 221# -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by 222# LAPACK and the BLAS (defaults to 'int') 223# -DNSUNPERF for Solaris only. If defined, do not use the Sun 224# Performance Library 225 226CHOLMOD_CONFIG = $(GPU_CONFIG) 227 228# uncomment this line to compile CHOLMOD without METIS: 229# CHOLMOD_CONFIG = -DNPARTITION 230 231#------------------------------------------------------------------------------ 232# SuiteSparseQR configuration: 233#------------------------------------------------------------------------------ 234 235# The SuiteSparseQR library can be compiled with the following options: 236# 237# -DNPARTITION do not include the CHOLMOD partition module 238# -DNEXPERT do not include the functions in SuiteSparseQR_expert.cpp 239# -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB) 240 241# default, without timing, without TBB: 242SPQR_CONFIG = 243# with TBB: 244# SPQR_CONFIG = -DHAVE_TBB 245 246# This is needed for IBM AIX: (but not for and C codes, just C++) 247# SPQR_CONFIG = -DBLAS_NO_UNDERSCORE 248 249# with TBB, you must select this: 250# TBB = -ltbb 251# without TBB: 252TBB = 253 254#------------------------------------------------------------------------------ 255# Linux 256#------------------------------------------------------------------------------ 257 258# Using default compilers: 259# CC = gcc 260# CF = $(CFLAGS) -O3 -fexceptions 261 262# alternatives: 263# CF = $(CFLAGS) -g -fexceptions \ 264 -Wall -W -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ 265 -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi \ 266 -funit-at-a-time 267# CF = $(CFLAGS) -O3 -fexceptions \ 268 -Wall -W -Werror -Wshadow -Wmissing-prototypes -Wstrict-prototypes \ 269 -Wredundant-decls -Wnested-externs -Wdisabled-optimization -ansi 270# CF = $(CFLAGS) -O3 -fexceptions -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 271# CF = $(CFLAGS) -O3 272# CF = $(CFLAGS) -O3 -g -fexceptions 273# CF = $(CFLAGS) -g -fexceptions \ 274 -Wall -W -Wshadow \ 275 -Wredundant-decls -Wdisabled-optimization -ansi 276 277# consider: 278# -fforce-addr -fmove-all-movables -freduce-all-givs -ftsp-ordering 279# -frename-registers -ffast-math -funroll-loops 280 281# Using the Goto BLAS: 282# BLAS = -lgoto -lfrtbegin -lg2c $(XERBLA) -lpthread 283 284# Using Intel's icc and ifort compilers: 285# (does not work for mexFunctions unless you add a mexopts.sh file) 286# F77 = ifort 287# CC = icc 288# CF = $(CFLAGS) -O3 -xN -vec_report=0 289# CF = $(CFLAGS) -g 290 291# 64bit: 292# F77FLAGS = -O -m64 293# CF = $(CFLAGS) -O3 -fexceptions -m64 294# BLAS = -lgoto64 -lfrtbegin -lg2c -lpthread $(XERBLA) 295# LAPACK = -llapack64 296 297# SUSE Linux 10.1, AMD Opteron, with GOTO Blas 298# F77 = gfortran 299# BLAS = -lgoto_opteron64 -lgfortran 300 301# SUSE Linux 10.1, Intel Pentium, with GOTO Blas 302# F77 = gfortran 303# BLAS = -lgoto -lgfortran 304 305#------------------------------------------------------------------------------ 306# Mac 307#------------------------------------------------------------------------------ 308 309# As recommended by macports, http://suitesparse.darwinports.com/ 310# I've tested them myself on Mac OSX 10.6.1 and 10.6.8 (Snow Leopard), 311# on my MacBook Air, and they work fine. 312 313# F77 = gfortran 314# CF = $(CFLAGS) -O3 -fno-common -fexceptions -DNTIMER 315# BLAS = -framework Accelerate 316# LAPACK = -framework Accelerate 317# LIB = -lm 318 319#------------------------------------------------------------------------------ 320# Solaris 321#------------------------------------------------------------------------------ 322 323# 32-bit 324# CF = $(CFLAGS) -KPIC -dalign -xc99=%none -Xc -xlibmieee -xO5 -xlibmil -m32 325 326# 64-bit 327# CF = $(CFLAGS) -fast -KPIC -xc99=%none -xlibmieee -xlibmil -m64 -Xc 328 329# FFLAGS = -fast -KPIC -dalign -xlibmil -m64 330 331# The Sun Performance Library includes both LAPACK and the BLAS: 332# BLAS = -xlic_lib=sunperf 333# LAPACK = 334 335 336#------------------------------------------------------------------------------ 337# Compaq Alpha 338#------------------------------------------------------------------------------ 339 340# 64-bit mode only 341# CF = $(CFLAGS) -O2 -std1 342# BLAS = -ldxml 343# LAPACK = 344 345#------------------------------------------------------------------------------ 346# IBM RS 6000 347#------------------------------------------------------------------------------ 348 349# BLAS = -lessl 350# LAPACK = 351 352# 32-bit mode: 353# CF = $(CFLAGS) -O4 -qipa -qmaxmem=16384 -qproto 354# F77FLAGS = -O4 -qipa -qmaxmem=16384 355 356# 64-bit mode: 357# CF = $(CFLAGS) -O4 -qipa -qmaxmem=16384 -q64 -qproto 358# F77FLAGS = -O4 -qipa -qmaxmem=16384 -q64 359 360#------------------------------------------------------------------------------ 361# SGI IRIX 362#------------------------------------------------------------------------------ 363 364# BLAS = -lscsl 365# LAPACK = 366 367# 32-bit mode 368# CF = $(CFLAGS) -O 369 370# 64-bit mode (32 bit int's and 64-bit long's): 371# CF = $(CFLAGS) -64 372# F77FLAGS = -64 373 374# SGI doesn't have ranlib 375# RANLIB = echo 376 377#------------------------------------------------------------------------------ 378# AMD Opteron (64 bit) 379#------------------------------------------------------------------------------ 380 381# BLAS = -lgoto_opteron64 -lg2c 382# LAPACK = -llapack_opteron64 383 384# SUSE Linux 10.1, AMD Opteron 385# F77 = gfortran 386# BLAS = -lgoto_opteron64 -lgfortran 387# LAPACK = -llapack_opteron64 388 389#------------------------------------------------------------------------------ 390# remove object files and profile output 391#------------------------------------------------------------------------------ 392 393CLEAN = *.o *.obj *.ln *.bb *.bbg *.da *.tcov *.gcov gmon.out *.bak *.d *.gcda *.gcno 394