2021-02-04 18:52:26 +01:00
|
|
|
## Used compilers
|
2021-02-04 17:05:55 +01:00
|
|
|
CXX = icpc
|
|
|
|
FC = ifort
|
2021-02-04 18:52:26 +01:00
|
|
|
|
|
|
|
## Compiler flags
|
|
|
|
CXXFLAGS = -O0 -debug full -traceback
|
2021-02-04 17:05:55 +01:00
|
|
|
FFLAGS = -O0 -debug full -traceback
|
|
|
|
# ARCH = -xCORE-AVX2
|
2021-01-26 07:26:54 +01:00
|
|
|
|
2021-02-04 11:39:00 +01:00
|
|
|
## Deps & objs for the C++ stuff
|
|
|
|
cppDEPS = cppmain.cpp SM_MaponiA3.cpp SM_MaponiA3.hpp Helpers.hpp
|
|
|
|
cppOBJ = cppmain.o SM_MaponiA3.o
|
2021-02-04 13:12:34 +01:00
|
|
|
|
2021-02-04 11:39:00 +01:00
|
|
|
## Deps & objs for the Fortran stuff
|
|
|
|
fDEPS = fmain.f90 SM_MaponiA3_mod.f90
|
2021-02-04 13:12:34 +01:00
|
|
|
fOBJ = SM_MaponiA3.o SM_MaponiA3_mod.o fmain.o
|
2021-02-04 17:05:55 +01:00
|
|
|
fLIBS = -lstdc++
|
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
## Compile recipes for C++ stuff
|
2021-02-04 11:39:00 +01:00
|
|
|
%.o: %.cpp $(cppDEPS)
|
|
|
|
$(CXX) $(ARCH) $(CXXFLAGS) -c -o $@ $<
|
2021-01-26 07:26:54 +01:00
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
## Compile recepies for Fortran stuff
|
2021-02-04 11:39:00 +01:00
|
|
|
%.o: %.f90 $(fDEPS)
|
|
|
|
$(FC) $(ARCH) $(FFLAGS) -c -o $@ $<
|
|
|
|
|
2021-02-04 18:52:26 +01:00
|
|
|
## Build tagets
|
2021-02-04 13:12:34 +01:00
|
|
|
.PHONY: all clean distclean
|
|
|
|
|
2021-02-04 11:39:00 +01:00
|
|
|
all: cppSherman-Morrison fSherman-Morrison
|
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
clean:
|
|
|
|
@rm -vf *.o *.mod
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
@rm -vf cppSherman-Morrison fSherman-Morrison
|
|
|
|
|
|
|
|
## Linking the C++ example program
|
2021-02-04 11:39:00 +01:00
|
|
|
cppSherman-Morrison: $(cppOBJ)
|
|
|
|
$(CXX) $(ARCH) $(CXXFLAGS) -o $@ $^
|
|
|
|
|
2021-02-04 13:12:34 +01:00
|
|
|
## Linking Fortran example program calling the C++ function 'Sherman_Morrison()'
|
2021-02-04 11:39:00 +01:00
|
|
|
fSherman-Morrison: $(fOBJ)
|
2021-02-04 17:05:55 +01:00
|
|
|
$(FC) $(ARCH) $(FFLAGS) $(fLIBS) -o $@ $^
|