###################################################################################
# H. Moulinec
# LMA
# february 2 2011
#
# J. Boisse
# LEMTA
# february 24 2021
#
# options for craft Makefile
###################################################################################
# which compiler?
#
# 2 cases have been provided:
# eiter intel (icc and ifort)
# or gnu (gcc and gfortran)
#
COMPILERS=gnu
#COMPILERS=intel
#
# use OpenMP?
# enter yes if you want to compile with OpenMP options:
OPENMP=yes
#OPENMP=no
#
# debug mode?
# enter yes if you want to compile with debug options:
DEBUG=no
#DEBUG=yes
#
# static executable?
# enter yes if you want to compile a static version
STATIC_LIBRARIES=no
#STATIC_LIBRARIES=yes
#
#----------------------------------------------------------------------------------
# which FFT?
FFTOPTION=FFTW3
#
#----------------------------------------------------------------------------------
# added for harmonic implementation 2017/07/05 J. Boisse
# compile harmonic version ?
# enter yes if you want to compile the harmonic version
HARMONIC=yes
#HARMONIC=no
#----------------------------------------------------------------------------------
# link editor otions to use FFT library:
#FFTLIBOPTIONS=-lfftw3 -llapack -L/usr/lib/libblas/ -lblas -L/usr/lib/atlas-base/ -latlas -lm
FFTLIBOPTIONS=-lfftw3 -lm
# directory containing FFT header file :
FFTINCDIR=/usr/include
# directory containing FFT library or librariies :
FFTLIBDIR=/usr/lib
#FFTLIBDIR=/usr/lib/x86_64-linux-gnu
#
# where are Lapack and Blas libraries?
# ATTENTION: in debian squeeze linux distribution, it is necessary to delete
# module xerbla.o in Lapack static library: liblapack.a
LAPACKLIBDIR=/usr/lib/
BLASLIBDIR=/usr/lib/libblas/
ATLASLIBDIR=/usr/lib/atlas-base
LAPACKOPTIONS=-L $(LAPACKLIBDIR) -llapack -L $(BLASLIBDIR) -lblas -L $(ATLASLIBDIR) -latlas
# enter yes if HDF5 format is preferred to save intermediate results
# ( HDF5 version > 1.8.0 is required )
use_HDF5=no
#
#----------------------------------------------------------------------------------
# compile xhmv? (yes or not)
XHMV=yes
#XHMV=no
#----------------------------------------------------------------------------------
# build PyCraft? (yes or not)
#PYCRAFT=yes
PYCRAFT=no
#----------------------------------------------------------------------------------
# build microstructures generator? (yes or no)
MICROSTRUCTURES=yes
#MICROSTRUCTURES=no
#----------------------------------------------------------------------------------
# build miscellaneous? (yes or no)
MISCELLANEOUS=yes
#MISCELLANEOUS=no
#----------------------------------------------------------------------------------
# YOU SHOULD NOT NEED TO MODIFY ANYTHING ELSE IN THIS FILE
# AFTER THIS LINE.
#----------------------------------------------------------------------------------
#
###################################################################################
# Directories:
#
#----------------------------------------------------------------------------------
# TOP directory is the current directory (i.e. the directory
# containing this file)
ifeq (0,$(MAKELEVEL))
TOPDIR := $(shell pwd)
endif
#----------------------------------------------------------------------------------
MANDIR = $(TOPDIR)/man
BINDIR = $(TOPDIR)/bin
LIBDIR = $(TOPDIR)/lib
DOCDIR = $(TOPDIR)/documentation
#----------------------------------------------------------------------------------
# CRAFT directories:
#
CRAFTDIR := $(TOPDIR)/craft
#
CRAFTSRCDIR=$(CRAFTDIR)/src
CRAFTUTILDIR=$(CRAFTDIR)/utils
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# location of directory containing constitutive laws:
BHVDIR=$(CRAFTSRCDIR)/behavior
# name of the library to be containing constitutive laws:
BHVLIB=bhv
#---------------------------------------------------------------------
# I3D
#
I3DDIR := $(TOPDIR)/i3d-2.2
# directory containing i3d header file :
I3DINCDIR=$(I3DDIR)/include
#
# directory containg i3d library :
I3DLIBDIR=$(LIBDIR)
#---------------------------------------------------------------------
# HDF5
#
ifeq ($(use_HDF5),yes)
HDF5INCDIR=/usr/include/hdf5/serial/
HDF5LIBDIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/
IOLIB=-L$(HDF5LIBDIR) -lhdf5 -lz -ldl
IOOPT=-Dhdf5 -DH5_NO_DEPRECATED_SYMBOLS -I$(HDF5INCDIR)
else
IOLIB=
IOOPT=
endif
#---------------------------------------------------------------------
# XHMV
XHMVDIR := $(TOPDIR)/xhmv-3.3c
#---------------------------------------------------------------------
# PYCRAFT
PYCRAFTDIR := $(TOPDIR)/python
#---------------------------------------------------------------------
# microstructures generator directory:
MICRODIR=$(TOPDIR)/microstructures
#---------------------------------------------------------------------
# miscellaneous directory:
MISCDIR=$(TOPDIR)/miscellaneous
###################################################################################
# Compilers and compiling options:
#
#----------------------------------------------------------------------------------
# Intel compilers
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ifeq ($(COMPILERS),intel)
CC=icc
FC=ifort
CPP=icc
LD=ifort
ifeq ($(DEBUG),yes)
LDFLAGS=-g -O0
CFLAGS=-g -Wall -O0 -pedantic -std=c99
CPPFLAGS=-g -Wall -O0
FFLAGS=-g -Wall -O0
else
#CFLAGS=-xSSE4.1 -O2 -finline
#CFLAGS=-xSSSE3 -O2 -finline
CFLAGS=-O2 -finline -pedantic -std=c99
FFLAGS=-O2 -finline
LDFLAGS=-O2
CPPFLAGS= -O2
endif
# some options
LD_OPTION1=-nofor_main
CC_OPTION=-Wunknown-pragmas
FC_OPTION=
# static libraries or not:
ifeq ($(STATIC_LIBRARIES),yes)
#LD_OPTION2=-static -Wl,--allow-multiple-definition -L /usr/lib/gcc/x86_64-linux-gnu/4.8/ -lgfortran -lquadmath
LD_OPTION2=-static -lgfortran -lquadmath
else
LD_OPTION2=#-static
endif
# Intel compiler option for openmp:
ifeq ($(OPENMP),yes)
CC_OPTIONS=$(CC_OPTION) -openmp
FC_OPTIONS=$(FC_OPTION) -openmp
ifeq ($(STATIC_LIBRARIES),yes)
LD_OPTIONS=$(LD_OPTION1) $(LD_OPTION2) -openmp -openmp-link static
else
LD_OPTIONS=$(LD_OPTION1) $(LD_OPTION2) -openmp -openmp-link dynamic
endif
else
CC_OPTIONS=$(CC_OPTION)
FC_OPTIONS=$(FC_OPTION)
LD_OPTIONS=$(LD_OPTION1) $(LD_OPTION2)
endif
endif
#----------------------------------------------------------------------------------
# gnu compilers (gcc etc.)
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ifeq ($(COMPILERS),gnu)
CC=gcc
FC=gfortran
CPP=g++
LD=gfortran
LDFLAGS=-Wno-deprecated
ifeq ($(DEBUG),yes)
#CFLAGS=-g -Wall -O0 -pedantic -std=c99 -fdump-rtl-expand
CFLAGS=-g -Wall -O0 -pedantic -std=c99 -DDEBUG
FFLAGS=-g -Wall -O0
CPPFLAGS=-g -Wall -O0
else
CFLAGS=-O2 -fsignaling-nans -pedantic -std=c99
FFLAGS=-O2
CPPFLAGS=-O2
endif
# some options
CC_OPTION=
FC_OPTION=
# added for harmonic implementation 2017/07/05 J. Boisse
ifeq ($(HARMONIC),yes)
CC_OPTION=-DHARMONIC
else
CC_OPTION=
endif
# static libraries or not:
ifeq ($(STATIC_LIBRARIES),yes)
LD_OPTION=-static -Wl,--allow-multiple-definition -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
#LD_OPTION=-static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -Wl
#LD_OPTION=-static -Wl,--whole-archive -Wl,--no-whole-archive
# see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176 for explanations
else
LD_OPTION=
endif
# gcc compiler option for openmp:
ifeq ($(OPENMP),yes)
CC_OPTIONS=$(CC_OPTION) -fopenmp
FC_OPTIONS=$(FC_OPTION) -fopenmp
LD_OPTIONS=$(LD_OPTION) -fopenmp
else
CC_OPTIONS=$(CC_OPTION)
FC_OPTIONS=$(FC_OPTION)
LD_OPTIONS=$(LD_OPTION)
endif
endif
###################################################################################
# archive program
AR = ar
ARFLAGS =
###################################################################################
export