Skip to content

Commit

Permalink
Merge pull request #72 from addman2/add_old_build
Browse files Browse the repository at this point in the history
Add old build
  • Loading branch information
kousuke-nakano authored Jan 30, 2024
2 parents 429450c + 22d0bec commit 00fbaf6
Show file tree
Hide file tree
Showing 13 changed files with 905 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*.i90
*.mod

# Old build system files
make.inc
make.txt

# iOS
.DS_Store

Expand Down
122 changes: 122 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
$(info ===================================================)
$(info )
$(info TurboRVB Legacy build system)
$(info )
$(info ===================================================)
$(info )

# Test if make.inc exists

make_inc_c := e
make_txt_c := e

ifeq ($(wildcard make.inc),)
$(info )
$(warning make.inc not found. )

make_inc_c := $(shell read -p "Do you want to create make.inc? [y/n]: " ans; \
if [ "$$ans" = "y" ]; then \
cp devel_tools/configs/make.inc.example.gcc make.inc; \
echo "c"; \
else \
echo "n"; \
fi)

ifeq ($(make_inc_c) ,c)
$(info )
$(info Please select an example: )
$(info )
$(info 1 GNU Fortran Compiler )
$(info 2 GNU Fortran Compiler with MPI)
$(info )
$(shell read -p "Select an example [1-2]: " ans; \
if [ "$$ans" = "1" ]; then \
cp devel_tools/make.inc.examples/make.inc.example.gcc make.inc; \
elif [ "$$ans" = "2" ]; then \
cp devel_tools/configs/make.inc.example.gccmpi make.inc; \
fi)

endif

endif

ifeq ($(wildcard make.txt),)
$(info )
$(warning make.txt not found. )

make_txt_c := $(shell read -p "Do you want to create make.txt? [y/n]: " ans; \
if [ "$$ans" = "y" ]; then \
cp devel_tools/configs/make.txt.example make.txt; \
echo "c"; \
else \
echo "n"; \
fi)

endif

$(info )

ifeq ($(make_inc_c),c)
$(info make.inc created. Please edit it.)
endif

ifeq ($(make_txt_c),c)
$(info make.txt created. Please edit it.)
endif

ifeq ($(make_inc_c),n)
$(info make.inc not created. Exiting.)
endif

ifeq ($(make_inc_c),n)
$(info make.inc not created. Exiting.)
endif

ifneq ($(make_inc_c),e)
$(info )
$(error Exiting.)
endif

ifneq ($(make_txt_c),e)
$(info )
$(error Exiting.)
endif

include make.inc

$(info )
$(info Using make.inc found in $(CURDIR))
$(info Building in $(BUILD_DIR))
$(info )
$(info Fortran compiler: $(FC))
$(info Fortran compiler flags: $(FCFLAGS))
$(info Fortran passive flags: $(FCFLAGS_PASSIVE))
$(info Fortran aggressive flags: $(FCFLAGS_AGGRESSIVE))
$(info )
$(info C compiler: $(CC))
$(info C compiler flags: $(CFLAGS))
$(info )
$(info Linker: $(LD))
$(info Linker flags: $(FLINK))
$(info )
$(info Libraries: $(LINK_LIBS))
$(info )
$(info ===================================================)


all:
make -C src/m_pfapack -f Makefile
make -C src/m_common -f Makefile
make -C src/d_qlapack -f Makefile
make -C src/c_adjoint_forward -f Makefile
make -C src/c_adjoint_backward -f Makefile
make -C src/b_complex -f Makefile
make -C src/a_turborvb -f Makefile

@echo " "
@echo " DONE - Enjoy TurboRVB! "
@echo " "

clean:
rm -rf $(BUILD_DIR)

83 changes: 83 additions & 0 deletions devel_tools/configs/make.inc.example.gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Makefile inc for TurboRVB

# This make.inc is also a tutorial how to setup Makefile for TurboRVB.
# This one is set up for GNU Compilers Collection (GCC) and Netlib LAPACK.
# You might have to check your compiler and LAPACK installation and change

# First we specifies suffix for our executable. This is not necessary but it is good practice.

SUFFIX=-serial.x

# This Makefile uses out-of-source build. This means that all object files and modules
# will be stored in separate directory. This directory is specified here.
# Keep in mind this have to be ABSOLUTE PATH. This file is loaded by sub-makefiles
# therefore $(pwd) or $(CURDIR) will not work.

BUILD_DIR=/home/addman/Software/turborvb-rm/build-serial

# Setup compilers Fortran and C. For this FC and CC variables are used respectively.

FC=gfortran
CC=gcc

# Setup compiler flags. Note that for MPI version Fortran compiler wrapper should be used.
# For this FCFLAGS and CFLAGS variables are used respectively.

# It is important NOT to specify optimization flags here!

# First we have to specify that Fortran should use C preprocessor.
# This is important for gfortran it is "-cpp" flag. However, for other compilers,
# such as Intel Fortran, it is "-fpp" flag.

FCFLAGS=-cpp

# Now we have to disable compilers check for argument mismatch. This is important for gfortran.

FCFLAGS+=-fallow-argument-mismatch

# Now we have to disable compilers check for line length.

FCFLAGS+=-ffree-line-length-none

# One might like to use OpenMP parallelism

FCFLAGS+=-fopenmp

# Debug -g flag is not slowing down modern code so we can use it all the time.

FCFLAGS+=-g

# Here we specify optimization flags. Note that for gfortran it is "-O" flag.
# C optimization flags CAN be specified here. This is one difference between C and Fortran flags.

CFLAGS=-O3 -g -fopenmp

# Here we specify flags for aggressive optimization. Note that for gfortran it is "-O" flag.
# Not all source files can be compiled with aggressive optimization. These files has to
# carefully selected and precified in the file make.txt

FCFLAGS_AGGRESSIVE=-O3
FCFLAGS_PASSIVE=-O0

# Here we specify flags that control storing and including of modules.
# For gfortran it is "-J" and "-I" flags respectively. This is true for most compilers.
# Normally, it is not necessary to specify these flags.

MODULE_STORE=-J
MODULE_INCLUDE=-I

# Here we can add preprocessort directives. Keep in mind it is good add them to FCFLAGS
# as well as to CFLAGS. For this a helper variable PP_DIRECTIVES is used.

PP_DIRECTIVES=-D_TIME

FCFLAGS+=$(PP_DIRECTIVES)
CFLAGS+=$(PP_DIRECTIVES)

# Link options. Here we specify libraries that are needed for linking.

FLINK=-fopenmp

# Here we specify libraries that are needed for linking.

LINK_LIBS=-L/opt/addman/spack/opt/spack/linux-debian11-zen/gcc-12.3.0/netlib-lapack-3.11.0-y7uuukt5z6xv6gquhqe6lmificwmatuj/lib -llapack -lblas
85 changes: 85 additions & 0 deletions devel_tools/configs/make.inc.example.gccmpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Makefile inc for TurboRVB

# This make.inc is also a tutorial how to setup Makefile for TurboRVB.
# This one is set up for GNU Compilers Collection (GCC) and Netlib LAPACK.
# You might have to check your compiler and LAPACK installation and change

# First we specifies suffix for our executable. This is not necessary but it is good practice.

SUFFIX=-mpi.x

# This Makefile uses out-of-source build. This means that all object files and modules
# will be stored in separate directory. This directory is specified here.
# Keep in mind this have to be ABSOLUTE PATH. This file is loaded by sub-makefiles
# therefore $(pwd) or $(CURDIR) will not work.

BUILD_DIR=/home/addman/Software/turborvb-rm/build-mpi

# Setup compilers Fortran and C. For MPI version MPI compiler wrappers should be used.
# For this FC and CC variables are used respectively.

FC=mpif90
CC=mpicc

# Setup compiler flags. Note that for MPI version Fortran compiler wrapper should be used.
# For this FCFLAGS and CFLAGS variables are used respectively.

# It is important NOT to specify optimization flags here!

# First we have to specify that Fortran should use C preprocessor.
# This is important for gfortran it is "-cpp" flag. However, for other compilers,
# such as Intel Fortran, it is "-fpp" flag.

FCFLAGS=-cpp

# Now we have to disable compilers check for argument mismatch. This is important for gfortran.

FCFLAGS+=-fallow-argument-mismatch

# Now we have to disable compilers check for line length.

FCFLAGS+=-ffree-line-length-none

# One might like to use OpenMP parallelism

FCFLAGS+=-fopenmp

# Debug -g flag is not slowing down modern code so we can use it all the time.

FCFLAGS+=-g

# Here we specify optimization flags. Note that for gfortran it is "-O" flag.
# C optimization flags CAN be specified here. This is one difference between C and Fortran flags.

CFLAGS=-O3 -g -fopenmp

# Here we specify flags for aggressive optimization. Note that for gfortran it is "-O" flag.
# Not all source files can be compiled with aggressive optimization. These files has to
# carefully selected and precified in the file make.txt

FCFLAGS_AGGRESSIVE=-O3
FCFLAGS_PASSIVE=-O0

# Here we specify flags that control storing and including of modules.
# For gfortran it is "-J" and "-I" flags respectively. This is true for most compilers.
# Normally, it is not necessary to specify these flags.

MODULE_STORE=-J
MODULE_INCLUDE=-I

# Here we can add preprocessort directives. Keep in mind it is good add them to FCFLAGS
# as well as to CFLAGS. For this a helper variable PP_DIRECTIVES is used.
# For MPI version it is necessary to specify -DPARALLEL directive.

PP_DIRECTIVES=-D_TIME -DPARALLEL

FCFLAGS+=$(PP_DIRECTIVES)
CFLAGS+=$(PP_DIRECTIVES)

# Link options. Here we specify libraries that are needed for linking.

FLINK=-fopenmp

# Here we specify libraries that are needed for linking.

LINK_LIBS=-L/opt/addman/spack/opt/spack/linux-debian11-zen/gcc-12.3.0/netlib-lapack-3.11.0-y7uuukt5z6xv6gquhqe6lmificwmatuj/lib -llapack -lblas
44 changes: 44 additions & 0 deletions devel_tools/configs/make.txt.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
SOURCES_AGGRESSIVE=\
cell.f90\
conjginv_prep.f90\
dgemm_my.f90\
dielectric.f90\
dsktri.f90\
dsktrs.f90\
ewald.f90\
hopping_pbc.f90\
jastrow_ee_exp.f90\
jastrow_ei.f90\
jastrow_exp.f90\
jastrowgrad_exp.f90\
jastrowgrad_exp_pbc.f90\
makefun_bump.f90\
makefun.f90\
makefun_pbc.f90\
makefun0_bump.f90\
makefun0.f90 \
makefun0_pbc.f90\
mapping_sz.f90\
ngivej_pbc.f90\
ratiofn_psi.f90\
ratio_psi.f90\
ratiovar.f90\
scalevect.f90\
scratchdet.f90\
subener.f90\
t_lrdmc.f90\
updiag.f90\
upinvhop_fnf_new.f90\
upinvhop.f90\
upnewwf_new.f90\
upsim.f90\
upsimp.f90\
uptable.f90\
uptabpip_new.f90\
upvpot_pbc_exp.f90\
upwinv.f90\
upwinvp.f90\
up2bodypsi_pbc_exp.f90\
zsktri.f90\
zsktrs.f90\

Loading

0 comments on commit 00fbaf6

Please sign in to comment.