1 2# This is an example site-level customization file for cado-nfs. It is 3# the recommended way of setting parameters to the build system. The same 4# effect can be achieved with environment variables. 5# 6# This file is sourced as a bourne shell script within the build process 7# (by scripts/call_cmake.sh, precisely). Therefore, all variables setting 8# must obey the normal quoting construct for shell variables, e.g. 9# CFLAGS="-g -O2" 10# Note also that for the same reason, you may use conditional variable 11# setting in the syntax recognized by most shells, which is 12# : ${CFLAGS:="-g -O2"} 13# This means ``set CFLAGS to "-g -O2" unless it is already set to something 14# (by an environment variable, that is). 15# 16# The flags recognized by the build process are a restrictive list. Don't 17# even hope for something to be recognized if it's neither documented 18# here nor mentioned in any of the scripts/call_cmake.sh or 19# */CMakeLists.txt files. 20 21# It is perfectly normal to leave most values undefined here, as it is 22# hoped that the default settings work correctly. The intent of the 23# variable settings here is to accomodate special needs. 24# 25# Setting a variable to an empty value or leaving it unset are equivalent 26# here. 27# 28# Example values are given for all flags. The first example corresponds 29# to the default setting. 30 31############################################################ 32# build_tree: where do the object files go. 33# 34# Example values: 35# build_tree="${up_path}/build/`hostname`" 36# build_tree="${up_path}/build/`uname -m`" 37# build_tree=/tmp/cado-nfs-build 38# 39# up_path, amongst other variables, is defined from the caller script 40# which is scripts/call_cmake.sh. 41# 42# build_tree must be set unconditionally (that is, in contrast to the 43# other variables, you can't do : ${build_tree:=blah blah blah) 44# 45# It is possible, in local.sh, to vary the build tree depending on the 46# environment variables (when you pass such variables in an external 47# fashion, as in: MPI=1 DEBUG=1 make). By default cado-nfs does so if MPI 48# is defined (it makes sure that $build_tree contains .mpi). More 49# generally, you may do within local.sh: 50# if [ "$CLANG" ] ; then 51# CC=clang 52# CXX=clang++ 53# build_tree="${build_tree}.clang" 54# fi 55# 56# Other suggestions: 57# 58# if [ "$MPI" ] ; then 59# # build_tree already contains a ".mpi" suffix in that case, added 60# # by scripts/call_cmake.sh ; but we can add more. 61# case "$MPI" in 62# *mvapich2*) build_tree="${build_tree}.mvapich2";; 63# *openmpi*) build_tree="${build_tree}.openmpi";; 64# esac 65# fi 66# if [ "$DEBUG" ] ; then 67# build_tree="${build_tree}.debug" 68# # Dangerous pitfall -- mpicc has the nasty habit of forcing -O2 ! 69# CFLAGS="-O0 -g" 70# CXXFLAGS="-O0 -g" 71# fi 72 73############################################################ 74# CC: C Compiler 75# 76# Example values: 77# CC= 78# CC=gcc 79# CC=/usr/local/bin/gcc 80# CC=icc 81# CC="$HOME/bin/cc" 82# 83# The user is advised against setting $CC as a path + some switches, such 84# as "gcc -m64". This may or may not work. 85 86############################################################ 87# CXX: C++ Compiler (cado-nfs contains a few C++ programs) 88# 89# Example values: 90# CXX= 91# CXX=/usr/local/bin/g++ 92 93############################################################ 94# CFLAGS: Flags for compiling C programs 95# 96# Example values: 97# CFLAGS=-O2 98# CFLAGS="-O3 -march=native -funroll-loops -DNDEBUG" 99# CFLAGS=-g 100# CFLAGS="-O2 -DNDEBUG" 101# 102# Note: the default value of CFLAGS is "-O2". If you want to disable 103# the ASSERT() tests, define CFLAGS="-O2 -DNDEBUG". This should provide a 104# small speed-up (don't expect too much improvement, though). 105# 106# Note that some flags, and some compile-time definitions are added 107# anyway and cannot be overridden. For example, one cannot remove 108# -std=c99 for CFLAGS if GNU C is being used, because its use is 109# mandatory. We also do this for the Intel compiler icc. 110 111############################################################ 112# CXXFLAGS: Flags for compiling C++ programs 113# 114# Example values: 115# CXXFLAGS=-O2 116# CXXFLAGS=-g 117# CXXFLAGS="-O2 -DNDEBUG" 118# CXXFLAGS="-O3 -march=native -funroll-loops -DNDEBUG" 119# CXXFLAGS="-O3 -funroll-loops -DNDEBUG -Wno-empty-body" 120# 121# Important note: CXXFLAGS lives totally independently of CFLAGS. 122# Therefore if some flag is relevant to both, you have to set both. 123 124############################################################ 125# ENABLE_SHARED: Disable shared libraries 126# Setting this to 1 causes CADO to use shared libraries for CADO convenience 127# libraries and for the BWC arithmetic functions. This decreases build time 128# and binary file size, but the resulting binaries are less portable. 129# Mostly meant for development purposes. 130# ENABLE_SHARED=0 131 132############################################################ 133# PREFIX: Installation path 134# 135# Example values: 136# PREFIX=<path-to-source-tree>/installed 137# PREFIX=/usr/local/cado 138# 139# This is for ``make install'': binaries will be installed in $PREFIX/bin. 140 141############################################################ 142# CADO_VERSION_STRING: set package version 143# 144# This is relevant only for the development tree. It is documented here 145# for completeness, but cado-nfs tarballs lack the scripts which 146# understand this variable. 147 148############################################################ 149# GF2X_CONFIGURE_FLAGS: pass flags to gf2x's ./configure script. 150# 151# Example values: 152# GF2X_CONFIGURE_FLAGS="--silent --disable-shared" 153 154 155############################################################ 156# GMP: prefix to installed GMP, or path to built GMP source tree. 157# 158# (GMP is a requirement) 159# 160# Example values: 161# GMP= 162# GMP=/usr/local/gmp-5.1.0 163# GMP=$HOME/gmp-5.1.0 164# 165# It does not matter whether $GMP points to the ``prefix'' where some GMP 166# version has been installed (with make install), or whether $GMP points 167# to a built source tree. The build system is supposed to correctly 168# locate include files and libraries in both cases. However, to 169# accomodate special configurations, one may also use the two extra 170# variables: 171# 172# GMP_LIBDIR=/some/directory 173# GMP_INCDIR=/some/directory 174 175############################################################ 176# HWLOC: prefix to installed hwloc 177# 178# (HWLOC is optional) 179# 180# Example values: 181# HWLOC=$HOME/Packages/hwloc-1.11.1 182# 183# To accomodate special configurations, one may also use the two extra 184# variables: 185# HWLOC_LIBDIR=/some/directory 186# HWLOC_INCDIR=/some/directory 187 188############################################################ 189# GMPECM: prefix to installed gmp-ecm 190# 191# (GMPECM is optional, but required for JL selection polynomial dlp) 192# 193# Example values: 194# GMPECM=$HOME/Packages/ecm-42.17.0 195# 196# To accomodate special configurations, one may also use the two extra 197# variables: 198# GMPECM_LIBDIR=/some/directory 199# GMPECM_INCDIR=/some/other/directory 200 201############################################################ 202# CURL: prefix to installed Curl 203# 204# (Curl is optional) 205# 206# Example values: 207# curl=/usr/local 208# 209# To accomodate special configurations, one may also use the two extra 210# variables: 211# CURL_LIBDIR=/some/directory 212# CURL_INCDIR=/some/directory 213 214############################################################ 215# MPI: Whether to use MPI (Message Passing Interface) or not 216# 217# (MPI is optional) 218# 219# Example values: 220# MPI=0 221# MPI=1 222# MPI=/usr/local/mpich2-1.0.8p1/ 223# MPI=/usr/local/openmpi-1.3.0/ 224# MPI=$HOME/mpich2-1.0.8p1 225# OMPI_CC=gcc44 226# OMPI_CXX=g++44 227# 228# Some cado-nfs programs can work with MPI. To build MPI-enabled tools, 229# set $MPI to 1. The default value is unset, which effectively disables 230# MPI (and activate stubs for the corresponding functions). 231# 232# Setting $MPI to 1 means to enable an MPI build, using the system-level 233# default MPI compiler (the one pointed to by `which mpicc`). 234# 235# Setting $MPI to a path instructs the build process to look for the 236# compiler $MPI/mpicc, or $MPI/bin/mpicc. 237# 238# Note that in any case, for the MPI build to be enabled, it is necessary 239# for an MPI C compiler AND an MPI C++ compiler AND an mpiexec program to 240# be found. 241# 242# ``MPI=1'', ``MPI=yes'', ``MPI=on'', are equivalent. 243# ``MPI=0'', ``MPI=no'', ``MPI=off'', are equivalent. 244# 245# By default, mpicc calls the default compiler (gcc or g++) installed on your 246# computer. If this default compiler is too old or buggy, you might want to use 247# OMPI_CC and/or OMPI_CXX to specify a newer compiler (this is for Open MPI). 248 249############################################################ 250# Python: Whether to test for a Python 3 interpreter or not 251# 252# The cado-nfs.py script needs Python 3 and the sqlite3 253# module. If you do not wish to use cado-nfs.py, set 254# NO_PYTHON_CHECK to a non-empty string to disable testing 255# for Python 3 and sqlite in the CMake configuration 256# 257# NO_PYTHON_CHECK="foo" 258 259############################################################ 260# For big factorizations, increase the size of variable. 261# If you want to use large prime bound > 32, uncomment the following line 262# FLAGS_SIZE="-DSIZEOF_P_R_VALUES=8" 263# If you want to be able to handle more than 2^32 ideals in your factor base or 264# have more than 2^32 relations (for large prime bound > 35 or 36), uncomment 265# the following line 266# FLAGS_SIZE="-DSIZEOF_P_R_VALUES=8 -DSIZEOF_INDEX=8" 267