Update to Make file and working compile

This commit is contained in:
Alex Selimov 2021-02-12 12:35:04 -05:00
parent 24b1647754
commit 90bdc160cb
7 changed files with 309 additions and 133 deletions

View file

@ -1,53 +1,49 @@
FC=gfortran
#Ifort flags
#FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays
#FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays
#gfortran flags
FFLAGS=-mcmodel=large -O3 -g
#FFLAGS=-mcmodel=large -O0 -g -fbacktrace -fcheck=all
MODES=mode_create.o mode_merge.o mode_convert.o mode_metric.o mode_calc.o
OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.o opt_deform.o opt_redef_box.o opt_slip_plane.o
OBJECTS=main.o elements.o io.o subroutines.o functions.o atoms.o call_mode.o box.o neighbors.o $(MODES) $(OPTIONS) call_option.o sorts.o
.SUFFIXES:
.SUFFIXES: .c .f .f90 .F90 .o
.DEFAULT_GOAL := all
cacmb: $(OBJECTS)
$(FC) $(FFLAGS) $(OBJECTS) parameters.o -o $@
FC=mpif90
FFLAGS=-Wall -mcmodel=large -O0 -g -fbacktrace -fcheck=all -ffpe-trap=invalid,zero,overflow,underflow,denormal
OBJDIR=obj
SRCS := $(wildcard *.f90)
OBJECTS := $(addprefix $(OBJDIR)/,$(SRCS:%.f90=%.o))
#----------------- DEPENDENCIES -----------------#
# GENERATED USING https://github.com/ZedThree/fort_depend.py **requires python3**
# > pip install fortdepend
# > fortdepend -o Makefile.dep -i mpi -b obj/
include Makefile.dep
#----------------- DEFAULTS -----------------#
all: cacmb
.PHONY: deps
cacmb: $(OBJECTS) $(OBJDIR)/main.o
$(FC) $(FFLAGS) $(OBJECTS) -o $@
$(OBJDIR)/%.o: %.f90
@mkdir -p $(@D)
$(FC) $(FFLAGS) -c -o $@ $< -J$(OBJDIR)
.f90.o:
$(FC) $(FFLAGS) -c $<
deps:
@fortdepend -o Makefile.dep -i mpi -b obj -w
#----------------- CLEAN UP -----------------#
.PHONY: clean
clean:
$(RM) cacmb *.o *.mod *genmod*
clean:
$(RM) *.mod *.o
$(RM) $(OBJDIR)/*.mod $(OBJDIR)/*.o CAC
@$(RM) -rf obj/
testfuncs: testfuncs.o functions.o subroutines.o
$(FC) testfuncs.o functions.o subroutines.o box.o elements.o -o $@
.PHONY: clean-all
clean-all: clean
.PHONY: cleantest
cleantest:
$(RM) testfuncs testfuncs.o
.PHONY: test
test: testfuncs
./testfuncs
.PHONY: install
install: cacmb
cp ./cacmb /usr/local/bin
$(OBJECTS) : parameters.o
atoms.o subroutines.o testfuncs.o box.o : functions.o
main.o io.o $(MODES) $(OPTIONS) : elements.o
call_mode.o : $(MODES)
call_option.o : $(OPTIONS)
elements.o : sorts.o
$(MODES) $(OPTIONS) subroutines.o io.o : atoms.o box.o
$(MODES) main.o : io.o
testfuncs.o elements.o mode_create.o $(OPTIONS) $(MODES): subroutines.o
opt_delete.o mode_metric.o : neighbors.o
# DEBUGGING VARIABLE PRINT
print-% : ; @echo $* = $($*)