############################################################################### # This is the Makefile for the quantum dots programs. In principle, only the # Part (A) should be changed, in order to specify the compiler, compiler options, # and libraries (BLAS, LAPACK, GSL, FFTW). ############################################################################### ############################################################################### # (A) Compiler, compiler flags, libraries. # Which compiler is going to be used. FC = ifc # FCFLAGS variable holds the compiler flags. FCFLAGS = -O F77FLAGS = -W0 # LDFLAGS variable holds the flags passed to the linker (i.e. for static linking) LDFLAGS = # BLAS, LAPACK, gsl and FFTW3 libraries have to be linked with the various programs. LIBS = -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/ -L/home/castro/local/lib -llapack -lblas -lg2c -lfftw3 -lgslcblas -lgsl #LIBS = -L/home/marques/lib/g77 -llapack -lblas -lf2c_mine -lfftw3 -lgslcblas -lgsl ############################################################################### ############################################################################### # (B) List of programs that will be built. # PROGS = gs td test_hartree test_laplacian coeff excitations sf ############################################################################### ############################################################################### # (C) Files to be compiled: # # BASE_SRC is the list of the files common for all the programs. # # GS_SRC contains the files necessary to complete the "gs" program. # TD_SRC contains the files necessary to complete the "td" program. # TESTHARTREE_SRC contains the files for the "test_hartree" program. # TESTLAPLACIAN_SRC contains the files for the "test_laplacian" program. # COEFF_SRC contains the files for the "coeff" program. # EXCITATIONS_SRC contains the files necessary to complete the "excitations" program # SF_SRC contains the files necessary for the "sf" program. # # EXPOKIT_SRC contains the subroutines belonging to the "expokit" package # (http://www.maths.uq.edu.au/expokit) # # SRCS_C contains some necessary source written in C (interfaces to the GSL library) # # The corresponing x_OBJS variables contain the x.o object files. BASE_SRC = states.f90 mesh.f90 fftw3.f90 cf.f90 poisson.f90 vxc.f90 epot.f90 ipot.f90 \ output.f90 energy.f90 hpsi.f90 rho.f90 write_wfs.f90 read_wfs.f90 BASE_OBJS=$(BASE_SRC:.f90=.o) GS_SRC = init_wfs.f90 cg.f90 scf.f90 gs.f90 TD_SRC = perturbation.f90 exponential.f90 propagator.f90 propagate.f90 td.f90 TESTHARTREE_SRC = test_hartree.f90 TESTLAPLACIAN_SRC = test_laplacian.f90 COEFF_SRC = coeff.f90 EXCITATIONS_SRC = excitations.f90 SF_SRC = sf.f90 GS_OBJS=$(GS_SRC:.f90=.o) TD_OBJS=$(TD_SRC:.f90=.o) TESTHARTREE_OBJS = $(TESTHARTREE_SRC:.f90=.o) TESTLAPLACIAN_OBJS = $(TESTLAPLACIAN_SRC:.f90=.o) COEFF_OBJS = $(COEFF_SRC:.f90=.o) EXCITATIONS_OBJS=$(EXCITATIONS_SRC:.f90=.o) SF_OBJS = $(SF_SRC:.f90=.o) EXPOKIT_SRC = expokit.f EXPOKIT_OBJS = expokit.o SRCS_C = gslwrappers.c OBJS_C=$(SRCS_C:.c=.o) ############################################################################### ############################################################################### # (D) Rules for compilation. %.o:%.f90 $(FC) $(FCFLAGS) -o $@ -c $< %.o:%.f $(FC) $(FCFLAGS) $(F77FLAGS) -o $@ -c $< ############################################################################# ############################################################################### # (E) Rules to compile the programs. all: $(PROGS) gs: $(OBJS_C) $(BASE_OBJS) $(GS_OBJS) $(FC) $(FCFLAGS) $(LDFLAGS) $(OBJS_C) $(BASE_OBJS) $(GS_OBJS) $(LIBS) -o $@ td: $(EXPOKIT_OBJS) $(OBJS_C) $(BASE_OBJS) $(TD_OBJS) $(FC) $(FCFLAGS) $(LDFLAGS) $(EXPOKIT_OBJS) $(OBJS_C) $(BASE_OBJS) $(TD_OBJS) $(LIBS) -o $@ test_hartree: $(OBJS_C) $(BASE_OBJS) $(TESTHARTREE_OBJS) $(FC) $(FCFLAGS) $(LDFLAGS) $(OBJS_C) $(BASE_OBJS) $(TESTHARTREE_OBJS) $(LIBS) -o $@ test_laplacian: $(OBJS_C) $(BASE_OBJS) $(TESTLAPLACIAN_OBJS) $(FC) $(FCFLAGS) $(LDFLAGS) $(OBJS_C) $(BASE_OBJS) $(TESTLAPLACIAN_OBJS) $(LIBS) -o $@ excitations: $(OBJS_C) $(BASE_OBJS) $(EXCITATIONS_OBJS) $(FC) $(FCFLAGS) $(LDFLAGS) $(OBJS_C) $(BASE_OBJS) $(EXCITATIONS_OBJS) $(LIBS) -o $@ coeff: $(COEFF_OBJS) $(FC) $(FCFLAGS) $(LDFLAGS) $(COEFF_OBJS) -o $@ $(LIBS) sf: sf.o $(FC) $(FCFLAGS) $(LDFLAGS) sf.o -o $@ $(LIBS) clean: rm -f *.o *.mod *~ $(PROGS) vh vx vc vext rho wfs rho spectrum dipole ############################################################################### ############################################################################### # (F) Dependencies. mesh.o : mesh.f90 fftw3.o : fftw3.f90 cf.o : fftw3.o cf.f90 poisson.o : mesh.o fftw3.o cf.o poisson.f90 vxc.o : mesh.o vxc.f90 ###############################################################################