Page MenuHomec4science

Makefile
No OneTemporary

File Metadata

Created
Fri, May 3, 11:42

Makefile

#
# @file Makefile
#
# @brief Makefile for futils library
#
# @copyright
# Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
# SPC (Swiss Plasma Center)
#
# futils is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# futils is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# @authors
# (in alphabetical order)
# @author Paolo Angelino <paolo.angelino@epfl.ch>
# @author Claudio Gheller <claudio.gheller@epfl.ch>
# @author Sébastien Jolliet <sebastien.jolliet@epfl.ch>
# @author Ben McMillan <B.F.McMillan@warwick.ac.uk>
# @author Nicolas Richart <nicolas.richart@epfl.ch>
# @author Trach-Minh Tran <trach-minh.tran@epfl.ch>
#
PREFIX ?= $(PWD)
#PREFIX=/usr/local/crpp
F90 = mpif90
HDF5 = $(HDF5_ROOT)
#OPT = -O3 -fast -Mvect=simd -Munroll -Minline -Mipa=fast,inline -Mlarge_arrays
OPT = -O3 -fast -Mvect=simd -Munroll -Mlarge_arrays
F90FLAGS = $(OPT) -I${HDF5}/lib -I${HDF5}/include
CC = cc
CFLAGS = -O2
LDFLAGS = $(OPT) -L. -L${HDF5}/lib
#LIBS = -lfutils -lhdf5_fortran -lhdf5 -lz -lgcc_s -lcrypt -lssl
LIBS = -lfutils -lhdf5_fortran -lhdf5 -lz
.SUFFIXES:
.SUFFIXES: .o .c .f90 .F90
.f90.o:
$(F90) $(F90FLAGS) -c $<
.F90.o:
$(F90) $(F90FLAGS) -c $<
lib: libfutils.a getfile
getfile: getfile.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
h5types: h5types.o
$(F90) $(LDFLAGS) -o $@ $< -lhdf5_fortran -lhdf5 -lz
libfutils.a: futils.o cutils.o buffer.o vis3d.o vis3d.o
ar r $@ $?
ranlib $@
futils.o: append.tpl zappend.tpl putarr.tpl cputarr.tpl putarrnd.tpl cputarrnd.tpl getarr.tpl cgetarr.tpl getarrnd.tpl cgetarrnd.tpl
buffer.o: futils.o
vis3d.o: futils.o
test:
make -C ../examples test_s test_p
install: debug opt
debug:
#make distclean
#make "OPT = -g -traceback -CB" libfutils.a
make libfutils.a
mkdir -p $(PREFIX)/{lib,include}/g
cp -p libfutils.a $(PREFIX)/lib/g
cp -p *.mod $(PREFIX)/include/g
opt:
#make distclean
make libfutils.a
#make "OPT = -O3 -xHOST" libfutils.a
mkdir -p $(PREFIX)/{lib,include}/O
cp -p libfutils.a $(PREFIX)/lib/O
cp -p *.mod $(PREFIX)/include/O
uninstall:
rm -f $(PREFIX)/include{O,g}/futils.mod
rm -f $(PREFIX)/include{O,g}/vis3d.mod
rm -f $(PREFIX)/include{O,g}/hashtable.mod
rm -f $(PREFIX)/lib{O,g}/libfutils.a
getfile.o: libfutils.a
clean:
rm -f *.o *~ a.out fort.* *.h5*
distclean: clean
rm -f getfile *.a *.mod TAGS h5types

Event Timeline