################################################################# # # Makefile for UKRmol-in codes # # Possible invocations: # # make [with optional arguments, including the names of # individual programs to be compiled] # (some of these options can be: all, to compile all programs in # diatomic and polyatomic suites. # allpoly, to compile all programs # in polyatomic suite # alldiat, to compile all programs # in diatomic suite) # # make tools # (builds the utility programs whose source is in ./source/tools/) # # make clean # (removes .o and .mod files) # # make cleanall # (removes .o, .mod and executables) # # This Makefile DOES NOT NEED to be edited for use on different # machines and/or with different compilers, etc. # Default definitions of system-specific variables (the compiler, # compiler flags, linear algebra libraries) can be found below. # These settings can be overridden via command-line arguments to # "make", or by setting the relevant variables appropriately in a # file "make.inc" (copy, paste and edit the lines below that you # want to change) # # # MAL 17/06/2011: If the 'arpack' library (which is in the public # domain) is linked to optimized 'lapack' and 'blas' libraries # at 'arpack' compilation time, 'scatci' will run more efficiently. # # For example, a suggestion for flags for the linking of 'arpack' # to Intel's 'mkl' library is as follows: # -O3 -static-intel -parallel -par-threshold0 -mkl=parallel. # # It should be noted that this version of scatci will work only # with a 32-bit integer version of arpack. If users are interested # in using a 64-bit integer compiled version of arpack, the code # can be easily adapted, but resulting executables may run more # slowly. # # If the versions of Intel compiler or mkl library does not support the # -mkl=parallel or -mkl=sequential flag, follow the form of linking # found in the make.inc.ou file. ################################################################# ################################################################# # Default settings for the system-dependent variables # COMP2, LINK2 and LIB2 are used for the compilation of scatci COMP=ifort -w -mkl=sequential -i8 -qopenmp COMP2 = ifort -i8 COMP3=ifort -fpe0 -i8 LINK=ifort -static -mkl=sequential -i8 LINK2 = ifort -O3 -static-intel -parallel -par-threshold0 -mkl=parallel -qopenmp -i8 LINK3 = ifort OPT=-O3 -i8 NOOPT=-O0 -i8 OPT3=-O3 -static-intel -parallel -par-threshold0 -mkl=parallel -qopenmp -i8 OPT4=-O3 -static-intel -mkl=parallel -i8 OPT64I=-i8 # The following libraries should be included: # Lapack and blas here: LIB=-mkl=sequential LIB2=-mkl=parallel # Arpack here (compiled with sequential mkl): LIBAR= ~./Desktop/UKRMOL-IN/lib -larpack ################################################################# # The following include line must come after the system-specific defaults are set # The leading "-" means that make will continue if the named file cannot be found # (i.e. we wish to keep all the default settings) -include make.inc BINDIR = ./bin SHELL = /bin/sh POLYTARGS = swscf swtrmo sword swedmos swmol3 swfjk gausprop gaustail numcbas gtobas gausdelta cdenprop cdenprop_target DIATARGS = ints scf mos trans numbas COMMONTARGS = congen psn scatci denprop cdenprop cdenprop_target TOOLTARGS = mpoutrd radden # VPATH supplies a list of directories that will be searched if a prerequisite is not present in the current # working directory. It works with the pattern rules. VPATH = source/global:source/utilities:source/interfaces:source/bas:source/ci-diag:source/den:source/gaus:source/poly-scf:source/ints-orbs:source/diatomic:source/gausdelta:source/cdenprop .SUFFIXES: .SUFFIXES: .f .f90 .o all: $(POLYTARGS) $(DIATARGS) $(COMMONTARGS) tools #$(TOOLTARGS) allpoly: $(POLYTARGS) $(COMMONTARGS) alldiat: $(DIATARGS) $(COMMONTARGS) #.PHONY : all clean cleanall .PHONY: tools clean: rm -f *.o *.mod - cd source/tools/mpoutrd/ && rm -f *.o *.mod - cd source/tools/radden/ && rm -f *.o *.mod cleanall: rm -f *.o *.mod - cd source/tools/mpoutrd/ && rm -f *.o *.mod - cd source/tools/radden/ && rm -f *.o *.mod - cd ./bin && rm -f $(POLYTARGS) $(DIATARGS) $(COMMONTARGS) - cd ./bin && rm -f $(TOOLTARGS) # export these variables to the sub-make process in the source/tools/ subdirectories export COMP OPT OPT64I tools: cd source/tools/mpoutrd && $(MAKE) mkdir -p $(BINDIR) mv -f source/tools/mpoutrd/mpoutrd $(BINDIR) cd source/tools/radden && $(MAKE) mkdir -p $(BINDIR) mv -f source/tools/radden/radden $(BINDIR) %.o : %.f $(COMP) $(OPT) -c $< # Make the local bin directory (note the -p option means that nothing is done if the dir already exists) # in case it has accidentally been removed (etc.) mkdir -p $(BINDIR) %.o : %.f90 $(COMP) $(OPT) -c $< # Make the local bin directory (note the -p option means that nothing is done if the dir already exists) # in case it has accidentally been removed (etc.) mkdir -p $(BINDIR) # special rule for swscf.f as optimisation breaks it swscf.o: swscf.f $(COMP) $(NOOPT) -c $^ swscf: swscf.o swscf_intPacking.o $(LINK) $^ $(LIB) -o $@ mv -f swscf $(BINDIR) swtrmo: swtrmo.o global_data.o sw_shared.o global_utils.o integer_packing.o maths_interface.o swmol3_data.o $(LINK) $^ $(LIB) -o $@ mv -f swtrmo $(BINDIR) sword: sword.o integer_packing.o global_data.o global_utils.o swmol3_data.o $(LINK) $^ -o $@ mv -f sword $(BINDIR) swedmos: swedmos.o global_data.o sw_shared.o global_utils.o maths_interface.o swmol3_data.o $(LINK) $^ $(LIB) -o $@ mv -f swedmos $(BINDIR) congen: congen.o global_utils.o global_data.o swmol3_data.o $(LINK) $^ -o $@ mv -f congen $(BINDIR) swmol3: swmol3.o swmol3_data.o global_data.o maths_interface.o global_utils.o integer_packing.o $(LINK) $^ $(LIB) -o $@ mv -f swmol3 $(BINDIR) swfjk: swfjk.o global_data.o global_utils.o integer_packing.o swmol3_data.o $(LINK) $^ -o $@ mv -f swfjk $(BINDIR) gausprop: gausprop.o gaus_shared.o global_utils.o global_data.o sw_shared.o swmol3_data.o maths_interface.o $(LINK) $^ $(LIB) -o $@ mv -f gausprop $(BINDIR) gaustail: gaustail.o global_utils.o maths_interface.o gaus_shared.o global_data.o integer_packing.o swmol3_data.o $(LINK) $^ $(LIB) -o $@ mv -f gaustail $(BINDIR) psn: psn.o maths_interface.o global_utils.o global_data.o swmol3_data.o $(LINK) $^ $(LIB) -o $@ mv -f psn $(BINDIR) m_2_matrix_sparse.o: m_2_matrix_sparse.f90 precisn.o $(COMP3) $(OPT3) -c $< m_3_arpack_diagonalizers.o: m_3_arpack_diagonalizers.f90 precisn.o m_2_matrix_sparse.o $(COMP3) $(OPT3) -c $< m_4_mkarp.o: m_4_mkarp.f90 precisn.o m_2_matrix_sparse.o m_3_arpack_diagonalizers.o $(COMP3) $(OPT3) -c $< scatci_build.o: scatci_build.f precisn.o scatci_routines.o scatci_diag.o davidson.o $(COMP3) $(OPT4) -c $< scatci_diag.o: scatci_diag.f precisn.o scatci_routines.o $(COMP3) $(OPT4) -c $< scatci_routines.o: scatci_routines.f scatci_data.o m_2_matrix_sparse.o m_3_arpack_diagonalizers.o m_4_mkarp.o precisn.o global_data.o global_utils.o integer_packing.o maths_interface.o swmol3_data.o $(COMP3) $(OPT4) -c $< scatci: scatci_build.o scatci_routines.o scatci_data.o scatci_diag.o davidson.o m_2_matrix_sparse.o m_3_arpack_diagonalizers.o m_4_mkarp.o precisn.o global_data.o global_utils.o integer_packing.o maths_interface.o swmol3_data.o $(LINK2) $^ $(LIB2) $(LIBAR) -o $@ mv -f scatci $(BINDIR) denprop: denprop.o global_data.o integer_packing.o global_utils.o swmol3_data.o $(LINK) $^ $(LIB) -o $@ mv -f denprop $(BINDIR) cdenprop: cdenprop.o class_namelists.o class_COOSparseMatrix_real.o class_COOSparseMatrix_integer.o cdenprop_defs.o class_molecular_properties_data.o cdenprop_io.o cdenprop_aux.o cdenprop_procs.o $(LINK) $^ -o $@ mv -f cdenprop $(BINDIR) cdenprop_target: cdenprop_target.o cdenprop_procs.o cdenprop_io.o cdenprop_defs.o cdenprop_aux.o class_COOSparseMatrix_real.o class_COOSparseMatrix_integer.o class_namelists.o class_molecular_properties_data.o $(LINK) $^ -o $@ mv -f cdenprop_target $(BINDIR) numcbas: numcbas.o global_utils.o global_data.o swmol3_data.o $(LINK) $^ -o $@ mv -f numcbas $(BINDIR) gtobas: gtobas.o global_utils.o global_data.o swmol3_data.o $(LINK) $^ -o $@ mv -f gtobas $(BINDIR) ints: ints.o $(LINK) $^ -o $@ mv -f ints $(BINDIR) scf: scf.o $(LINK) $^ -o $@ mv -f scf $(BINDIR) trans: trans.o $(LINK) $^ -o $@ mv -f trans $(BINDIR) mos: mos.o $(LINK) $^ $(LIB) -o $@ mv -f mos $(BINDIR) numbas: numbas.o $(LINK) $^ -o $@ mv -f numbas $(BINDIR) SOURCESF = $(filter-out ./source/gausdelta/main.f,$(wildcard ./source/gausdelta/[^~]*.f)) TMPSOURCESF = $(notdir $(SOURCESF)) OBJECTS = ${TMPSOURCESF:.f=.o} gausdelta: $(OBJECTS) $(LINK) $^ -o $@ mv -f gausdelta $(BINDIR) # make -C source/gausdelta swtrmo.o: precisn.o global_data.o global_utils.o sw_shared.o integer_packing.o maths_interface.o swfjk.o: precisn.o global_data.o global_utils.o integer_packing.o denprop.o: precisn.o global_data.o integer_packing.o global_utils.o scatci_build.o: precisn.o global_data.o global_utils.o integer_packing.o scatci_diag.o: precisn.o global_data.o maths_interface.o sw_shared.o: precisn.o global_data.o swedmos.o: precisn.o global_data.o sw_shared.o global_utils.o maths_interface.o congen.o: precisn.o global_data.o global_utils.o scatci_data.o: precisn.o global_data.o: precisn.o integer_packing.o: precisn.o swmol3.o: precisn.o swmol3_data.o global_data.o maths_interface.o global_utils.o integer_packing.o swmol3_data.o: global_data.o sword.o: precisn.o global_data.o integer_packing.o global_utils.o gaustail.o: precisn.o global_data.o global_utils.o maths_interface.o gaus_shared.o integer_packing.o gausprop.o: precisn.o gaus_shared.o global_data.o global_utils.o sw_shared.o gaus_shared.o: precisn.o global_data.o global_utils.o maths_interface.o psn.o: precisn.o global_data.o maths_interface.o global_utils.o numcbas.o : precisn.o global_data.o global_utils.o gtobas.o : precisn.o global_data.o global_utils.o maths_interface.o : precisn.o global_utils.o global_utils.o : swmol3_data.o cdenprop.o: class_namelists.o class_COOSparseMatrix_real.o class_COOSparseMatrix_integer.o cdenprop_defs.o class_molecular_properties_data.o cdenprop_io.o cdenprop_aux.o cdenprop_procs.o cdenprop_target.o: class_namelists.o class_COOSparseMatrix_real.o class_COOSparseMatrix_integer.o cdenprop_defs.o class_molecular_properties_data.o cdenprop_io.o cdenprop_aux.o cdenprop_procs.o