Page MenuHomec4science

Makefile
No OneTemporary

File Metadata

Created
Sat, May 18, 05:41

Makefile

#
# @file Makefile
#
# @brief
#
# @copyright
# Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
# SPC (Swiss Plasma Center)
#
# SPClibs 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.
#
# SPClibs 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/>.
#
# @author
# (in alphabetical order)
# @author Trach-Minh Tran <trach-minh.tran@epfl.ch>
#
F90 = mpiifort
CC = cc
debug = -g -traceback -CB
optim = -O3 -xSSE4.2
#OPT=$(debug)
OPT=$(optim)
F90FLAGS = $(OPT) -I. -I$(FUTILS)/include -I${HDF5}/lib
CFLAGS = -O2
LDFLAGS = $(OPT) -fPIC -L. -L$(FUTILS)/lib -L${HDF5}/lib
LIBS = -lfutils pputils2.o -lhdf5_fortran -lhdf5 -lz
.SUFFIXES:
.SUFFIXES: .o .c .f90
.f90.o:
$(F90) $(F90FLAGS) -c $<
all: ex1 ex2 ex3 ex4 ex5 ex6 ex7
lib: libpputils2.a
libpputils2.a: pputils2.o
xiar r $@ $?
ranlib $@
ex1: ex1.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex2: ex2.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex3: ex3.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex4: ex4.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex5: ex5.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex6: ex6.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
ex7: ex7.o
$(F90) $(LDFLAGS) -o $@ $< $(LIBS)
tests: ex1 ex2 ex3 ex4 ex5 ex6 ex7
@echo ==== Running ex1 ======
@mpiexec -n 4 ./ex1
@echo ==== Running ex2 ======
@mpiexec -n 9 ./ex2
@echo ==== Running ex3 ======
@mpiexec -n 5 ./ex3
@echo ==== Running ex4 ======
@mpiexec -n 12 ./ex4
@echo ==== Running ex5 ======
@mpiexec -n 8 ./ex5
@echo ==== Running ex6 ======
@mpiexec -n 12 ./ex6
@echo ==== Running ex7 ======
@mpiexec -n 6 ./ex7
ex1.o: pputils2.o
ex2.o: pputils2.o
ex3.o: pputils2.o
ex4.o: pputils2.o
ex5.o: pputils2.o
ex6.o: pputils2.o
ex7.o: pputils2.o
tags:
etags *.f90 $(FUTILS)/futils.f90
clean:
rm -f *.o *~ a.out
distclean: clean
rm -f ex1 ex2 ex3 ex4 ex5 ex6 ex7 *.h5 *.a *.mod

Event Timeline