2021-03-29 10:49:57 +02:00
|
|
|
## Compilers
|
|
|
|
H5CXX = h5c++
|
|
|
|
CXX = verificarlo-c++
|
|
|
|
FC = verificarlo-f
|
|
|
|
|
|
|
|
## Compiler flags
|
2021-04-15 12:17:12 +02:00
|
|
|
H5FLAGS = "-I/usr/include/hdf5/serial \
|
|
|
|
-L/usr/lib/x86_64-linux-gnu/hdf5/serial \
|
|
|
|
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl_cpp.a \
|
|
|
|
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.a \
|
|
|
|
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.a \
|
|
|
|
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a \
|
|
|
|
-lpthread -lsz -lz -ldl -lm \
|
|
|
|
-Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/hdf5/serial"
|
2021-03-29 10:49:57 +02:00
|
|
|
CXXFLAGS = -O0 -g $(H5FLAGS)
|
2021-04-15 12:17:12 +02:00
|
|
|
FFLAGS = $(CXXFLAGS)
|
2021-03-29 10:49:57 +02:00
|
|
|
|
|
|
|
INCLUDE = -I $(INC_DIR)/
|
2021-04-14 17:18:31 +02:00
|
|
|
DEPS_CXX = $(OBJ_DIR)/SM_MaponiA3.o \
|
|
|
|
$(OBJ_DIR)/SM_MaponiA3S.o \
|
|
|
|
$(OBJ_DIR)/SM_Standard.o \
|
|
|
|
$(OBJ_DIR)/SM_Helpers.o
|
2021-04-15 12:17:12 +02:00
|
|
|
DEPS_F = $(DEPS_CXX) \
|
|
|
|
$(OBJ_DIR)/SM_MaponiA3_mod.o \
|
|
|
|
$(OBJ_DIR)/Helpers_mod.o
|
2021-03-29 10:49:57 +02:00
|
|
|
FLIBS = -lstdc++
|
|
|
|
|
|
|
|
SRC_DIR := src
|
|
|
|
TST_DIR := tests
|
|
|
|
INC_DIR := include
|
|
|
|
OBJ_DIR := build
|
|
|
|
BIN_DIR := bin
|
|
|
|
|
|
|
|
EXEC := $(BIN_DIR)/cMaponiA3_test_3x3_3 \
|
2021-04-06 16:17:42 +02:00
|
|
|
$(BIN_DIR)/test_h5 \
|
2021-04-30 11:22:22 +02:00
|
|
|
$(BIN_DIR)/vfc_test_h5 \
|
2021-03-29 10:49:57 +02:00
|
|
|
$(BIN_DIR)/fMaponiA3_test_3x3_3 \
|
|
|
|
$(BIN_DIR)/fMaponiA3_test_4x4_2 \
|
|
|
|
$(BIN_DIR)/QMCChem_dataset_test
|
|
|
|
|
|
|
|
#$(BIN_DIR)/test_external_h5 \
|
|
|
|
|
|
|
|
## Build tagets
|
|
|
|
.PHONY: all clean distclean
|
|
|
|
|
|
|
|
all: $(EXEC)
|
|
|
|
|
|
|
|
clean:
|
2021-04-15 12:17:12 +02:00
|
|
|
@rm -vrf $(OBJ_DIR) .*.o *.dbg *.cmdx *.cmod *.ilm *.stb
|
2021-03-29 10:49:57 +02:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
@rm -vrf $(BIN_DIR) \
|
|
|
|
Slater* Updates.dat
|
|
|
|
|
|
|
|
|
|
|
|
#### COMPILING
|
|
|
|
$(BIN_DIR) $(OBJ_DIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
### IMPLICIT BUILD RULES
|
|
|
|
## C++ objects
|
|
|
|
$(OBJ_DIR)/%.o: $(TST_DIR)/%.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) $(ARCH) $(INCLUDE) -c -o $@ $<
|
|
|
|
|
2021-04-14 16:19:49 +02:00
|
|
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
2021-04-15 12:17:12 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDE) -c -o $@ $<
|
2021-04-14 16:19:49 +02:00
|
|
|
|
2021-03-29 10:49:57 +02:00
|
|
|
## HDF5/C++ objects
|
|
|
|
$(OBJ_DIR)/%_h5.o: $(TST_DIR)/%_h5.cpp $(INC_DIR)/* | $(OBJ_DIR)
|
|
|
|
$(H5CXX) $(H5CXXFLAGS) $(INCLUDE) -c -o $@ $<
|
|
|
|
|
|
|
|
## Fortran modules
|
|
|
|
$(OBJ_DIR)/%_mod.o: $(SRC_DIR)/%_mod.f90 | $(OBJ_DIR)
|
2021-04-15 12:17:12 +02:00
|
|
|
$(FC) $(FFLAGS) $(ARCH) -J $(OBJ_DIR)/ -c -o $@ $<
|
2021-03-29 10:49:57 +02:00
|
|
|
|
|
|
|
## Fortran objects
|
|
|
|
$(OBJ_DIR)/%.o: $(TST_DIR)/%.f90 | $(OBJ_DIR)
|
|
|
|
$(FC) $(FFLAGS) $(ARCH) -I $(OBJ_DIR)/ -c -o $@ $<
|
|
|
|
|
|
|
|
|
|
|
|
#### LINKING
|
|
|
|
$(BIN_DIR)/cMaponiA3_test_3x3_3: $(OBJ_DIR)/cMaponiA3_test_3x3_3.o $(DEPS_CXX) | $(BIN_DIR)
|
|
|
|
$(CXX) -o $@ $^
|
|
|
|
|
2021-04-06 16:17:42 +02:00
|
|
|
$(BIN_DIR)/test_h5: $(OBJ_DIR)/test_h5.o $(DEPS_CXX) | $(BIN_DIR)
|
2021-03-29 10:49:57 +02:00
|
|
|
$(CXX) -o $@ $^ $(H5FLAGS)
|
|
|
|
|
2021-04-30 11:22:22 +02:00
|
|
|
$(BIN_DIR)/vfc_test_h5: $(OBJ_DIR)/vfc_test_h5.o $(DEPS_CXX) | $(BIN_DIR)
|
|
|
|
$(CXX) -o $@ $^ $(H5FLAGS)
|
|
|
|
|
2021-03-29 10:49:57 +02:00
|
|
|
$(BIN_DIR)/fMaponiA3_test_3x3_3: $(DEPS_F) $(OBJ_DIR)/fMaponiA3_test_3x3_3.o | $(BIN_DIR)
|
|
|
|
$(FC) $(FLIBS) -o $@ $^
|
|
|
|
|
|
|
|
$(BIN_DIR)/fMaponiA3_test_4x4_2: $(DEPS_F) $(OBJ_DIR)/fMaponiA3_test_4x4_2.o | $(BIN_DIR)
|
|
|
|
$(FC) $(FLIBS) -o $@ $^
|
|
|
|
|
|
|
|
$(BIN_DIR)/QMCChem_dataset_test: $(DEPS_F) $(OBJ_DIR)/QMCChem_dataset_test.o | $(BIN_DIR)
|
|
|
|
$(FC) $(FLIBS) -o $@ $^
|