From e053d5e8299747bb0c8bdbcb03f44c2f1f91a174 Mon Sep 17 00:00:00 2001 From: David Bowler Date: Fri, 24 Jan 2020 17:01:58 +0000 Subject: [PATCH] Fix missing file to allow compilation Small tweaks to Makefiles and associated inputs --- bin/README.md | 1 + src/Makefile | 12 +-- src/Makefile.Doc | 139 ++++++++++++++++++++++++++++++ src/system.make | 19 +--- tools/BasisGeneration/Makefile | 1 + tools/BasisGeneration/makedeps | 3 +- tools/BasisGeneration/system.make | 60 ++++++------- 7 files changed, 172 insertions(+), 63 deletions(-) create mode 100644 bin/README.md create mode 100644 src/Makefile.Doc diff --git a/bin/README.md b/bin/README.md new file mode 100644 index 00000000..b224562f --- /dev/null +++ b/bin/README.md @@ -0,0 +1 @@ +Directory holding executable files (Conquest and MakeIonFiles) diff --git a/src/Makefile b/src/Makefile index 264781c9..f3694d2c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -# -*- mode: makefile; mode: font-lock; column-number-mode: true -*- +# -*- mode: makefile; mode: font-lock -*- # # $Id: Makefile,v 1.9.2.1 2006/03/07 07:36:40 drb Exp $ # @@ -65,7 +65,8 @@ deps.obj.inc: $(SRCS_NODS) system.make #Target $(TARGET) : $(NODE_OBJECTS) - $(FC) $(LINKFLAGS) -o $(TARGET) $(NODE_OBJECTS) $(LIBS) + $(FC) $(LINKFLAGS) -o $(TARGET) $(NODE_OBJECTS) $(LIBS) + cp $(TARGET) ../bin #.f90.o: %.o: %.f90 @@ -112,13 +113,9 @@ doc: help: $(ECHOSTR) "\nConquest Makefile\n-----------------\n" $(ECHOSTR) "\t default (make or make Conquest) is to make Conquest\n" - $(ECHOSTR) "\t make preConquest makes preConquest\n" $(ECHOSTR) "\t make tar makes a .tar.gz file in the directory below\n" $(ECHOSTR) "\t make xhtml makes xrefs for ROBODoc html documentation" $(ECHOSTR) "\t make html makes ROBODoc html documentation" - $(ECHOSTR) "\t make doc; netscape Conquest_mi.html gives documentation\n" - $(ECHOSTR) "\t make _pure removes \"!!\" lines from source file " - $(ECHOSTR) "\t make pure does for all files (puts into subdir pure)\n" $(ECHOSTR) "\t make clean removes all object files and emacs ~ files" $(ECHOSTR) "\t make doc_clean cleans up ROBODoc html documentation" $(ECHOSTR) "\t make pure_clean removes all _pure files" @@ -129,9 +126,6 @@ list: $(ECHOSTR) $(HTMLXREFS) $(ECHOSTR) $(HTMLDOCS) -tools: - ( cd utilities; make ) - notimers: @if [ ! -d $(NOTIMERS_DIR) ]; \ then \ diff --git a/src/Makefile.Doc b/src/Makefile.Doc new file mode 100644 index 00000000..deab5e42 --- /dev/null +++ b/src/Makefile.Doc @@ -0,0 +1,139 @@ +SHELL = /bin/sh + +ROBODOC=/homes/conquest/bin/robodoc +#ROBOOPTS=C SORT +ROBOOPTS= + +# Your source files. +# +#SOURCES= DMM.f90 McWeeny.f90 Pulay.f90 basic_types.f90 common.module.f90 \ +# comms_module.f90 construct_module.f90 cover_module.f90 datatypes.module.f90 \ +# generic_blas.f90 global_module.f90 group_module.f90 hamiltonian.module.f90 \ +# initialise.f90 io_module.f90 matrix_comms_module.f90 matrix_data_module.f90 \ +# matrix_elements_module.f90 matrix_module.f90 maxima_module.f90 \ +# minimise.module.f90 mpi.f90 mult_init_module.f90 mult_module.f90 \ +# multiply_module.f90 numbers.module.f90 primary_module.f90 trans_module.f90 \ +# version_module.f90 +SOURCES=$(NODE_OBJECTS:.o=.f90) $(SRC2) + +# The name of your Project +# +PROJECT=Conquest + +# The various documentation files, derived from the source files. +# HTML +# +HTMLDOCS=$(SOURCES:=.html) +HTMLXREFS=$(HTMLDOCS:.html=.html.xref) +HTMLXREFSFILE=$(PROJECT)_html.xrefs +# LATEX +# +LATEXDOCS=$(SOURCES:=.tex) +LATEXXREFS=$(LATEXDOCS:.tex=.tex.xref) +LATEXXREFSFILE=$(PROJECT)_tex.xrefs +# ASCII +# +ASCIIDOCS=$(SOURCES:=.txt) +# RTF +# +RTFDOCS=$(SOURCES:=.rtf) +RTFXREFS=$(RTFDOCS:.rtf=.rtf.xref) +RTFXREFSFILE=$(PROJECT)_rtf.xrefs + +# Some common targets +xrefall: xrefhtml xreftex xrefrtf +docall: html tex ascii rtf + +# Create the xref files for the various formats. +xhtml: $(HTMLXREFSFILE) +xtex: $(LATEXXREFSFILE) +xrtf: $(RTFXREFSFILE) + +# Create the documentation files for the various formats. +html: $(HTMLDOCS) $(PROJECT)_mi.html +tex: $(LATEXDOCS) $(PROJECT)_mi.tex +rtf: $(RTFDOCS) +ascii: $(ASCIIDOCS) + +# master index file, currently works only for html and latex documentation. +# Note that you can define the title of the document. +$(PROJECT)_mi.html: $(HTMLXREFSFILE) + $(ROBODOC) $< $@ INDEX HTML TITLE "$(PROJECT) Master Index" + +$(PROJECT)_mi.tex: $(LATEXXREFSFILE) + $(ROBODOC) $< $@ INDEX LATEX TITLE "$(PROJECT) API Reference" + +# create xrefs file (file with the names of all .xref files). +$(HTMLXREFSFILE) : $(HTMLXREFS) + /bin/ls $(HTMLXREFS) > $@ +$(LATEXXREFSFILE) : $(LATEXXREFS) + /bin/ls $(LATEXXREFS) > $@ +$(RTFXREFSFILE) : $(RTFXREFS) + /bin/ls $(RTFXREFS) > $@ + +# Rule to create an .xref file from a source file for the various formats. +%.html.xref : % + $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@ +%.tex.xref : % + $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@ +%.rtf.xref : % + $(ROBODOC) $< $(@:.xref=) $(ROBOOPTS) INTERNAL GENXREF $@ + +# Rule to create html documentation from a source file. +%.html : % + $(ROBODOC) $< $@ HTML $(ROBOOPTS) XREF $(HTMLXREFSFILE) + +# Rule to create latex documentation from a source file. +# We do not include source items, and generate laxtex documents +# than can be included in a master document. +%.tex : % + $(ROBODOC) $< $@ LATEX $(ROBOOPTS) NOSOURCE SINGLEDOC XREF $(LATEXXREFSFILE) + +# Rule to create ascii documentation from a source file. +%.txt : % + $(ROBODOC) $< $@ ASCII + +# Rule to create rtf documentation from a source file. +%.rtf : % + $(ROBODOC) $< $@ RTF $(ROBOOPTS) XREF $(RTFXREFSFILE) + +# Use netscape to view the master index file for our project. +htmlview: html + netscape $(PROJECT)_mi.html + +# Use the latex programs to generate a .dvi from the master index file +# for our prokect. View this .dvi file with xdvi +texview: tex + latex $(PROJECT)_mi + makeindex $(PROJECT)_mi + latex $(PROJECT)_mi + latex $(PROJECT)_mi + xdvi $(PROJECT)_mi.dvi + +# Clean-up the mess we made +# +doc_clean: + rm -f $(HTMLXREFS) + rm -f $(HTMLDOCS) + rm -f $(LATEXXREFS) + rm -f $(LATEXDOCS) + rm -f $(PROJECT)_mi.* *.aux + rm -f $(RTFXREFS) + rm -f $(RTFDOCS) + rm -f $(ASCIIDOCS) + rm -f $(HTMLXREFSFILE) + rm -f $(LATEXXREFSFILE) + rm -f $(RTFXREFSFILE) + +%.f90_pure : %.f90 + sed '/^\!\!/D' $< > $<"_pure" + +PUREDOCS=$(SOURCES:=_pure) +pure : + -rm -rf pure + -mkdir pure + for X in $(SOURCES) ; do \ + sed '/^\!\!/D' $$X > pure/$$X; done +pure_clean: + -rm -rf pure + -rm -f $(PUREDOCS) diff --git a/src/system.make b/src/system.make index e0770504..3dbae5ec 100644 --- a/src/system.make +++ b/src/system.make @@ -9,9 +9,7 @@ LINKFLAGS= -L/usr/local/lib ARFLAGS= # Compilation flags -#COMPFLAGS= -O3 $(XC_COMPFLAGS) -Wpedantic -Wall -Wextra -COMPFLAGS= -O3 $(XC_COMPFLAGS) -Wpedantic -Wampersand -Wconversion -Wtabs -#COMPFLAGS= -O3 $(XC_COMPFLAGS) +COMPFLAGS= -O3 $(XC_COMPFLAGS) COMPFLAGS_F77= $(COMPFLAGS) # Set BLAS and LAPACK libraries @@ -35,24 +33,9 @@ XC_LIB = -lxcf90 -lxc XC_COMPFLAGS = -I/usr/local/include # Set FFT library - -# EXX is "stable" with FFTW (need to fix for the others) FFT_LIB=-lfftw3 FFT_OBJ=fft_fftw3.o -#FFT_LIB=-LFFT.FFTE -lffte -#FFT_OBJ=fft_ffte.o -#fft_ffte.o: FFT.FFTE/libffte.a -#FFT.FFTE/libffte.a: -# (cd FFT.FFTE; $(MAKE) "FC77=$(F77)" "FC90=${FC}" "FFLAGS=$(COMPFLAGS_F77)" "ARFL=$(ARFLAGS)") - -#FFT_LIB=-LFFT.GPFA -lgpfa -L$(FFTWROOT)/lib -lfftw3 -#FFT_OBJ=fft_gpfa.o -#fft_gpfa.o: FFT.GPFA/libgpfa.a -#FFT.GPFA/libgpfa.a: -# (cd FFT.GPFA; $(MAKE) "FC77=$(F77)" "FC90=${FC}" "FFLAGS=$(COMPFLAGS_F77)" "ARFL=$(ARFLAGS)") - - # Matrix multiplication kernel type MULT_KERN = default # Use dummy DiagModule or not diff --git a/tools/BasisGeneration/Makefile b/tools/BasisGeneration/Makefile index b6f8d371..7d5ea1c0 100644 --- a/tools/BasisGeneration/Makefile +++ b/tools/BasisGeneration/Makefile @@ -23,6 +23,7 @@ include deps.obj $(TARGET): $(OBJECTS) $(FC) $(LINKFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) + cp $(TARGET) ../../bin %.o: %.f90 $(FC) $(COMPFLAGS) -c $< diff --git a/tools/BasisGeneration/makedeps b/tools/BasisGeneration/makedeps index c1fdf886..d53248b4 100755 --- a/tools/BasisGeneration/makedeps +++ b/tools/BasisGeneration/makedeps @@ -202,7 +202,8 @@ sub MakeDependsf90 { /^\s*include\s+["\']([^"\']+)["\']/i && push(@incs, $1); /^\s*use\s+(\w+)/i && push(@modules, &ToLower($1)); } - if (defined @incs || defined @modules) +# if (defined @incs || defined @modules) + if (@incs || @modules) { ($objfile = $file) =~ s/\.[fF](90)?$/.o/; print $output "$objfile: "; diff --git a/tools/BasisGeneration/system.make b/tools/BasisGeneration/system.make index a373cb56..3dbae5ec 100644 --- a/tools/BasisGeneration/system.make +++ b/tools/BasisGeneration/system.make @@ -1,51 +1,41 @@ -# -*- mode: makefile; mode: font-lock; column-number-mode: true; vc-back-end: CVS -*- -# -# $Id: system.make,v 1.2 2013/04/10 22:07:21 lat Exp $ -# -# ISM RATM system.make -# # +# Set compilers FC=mpif90 F77=mpif77 -# If you need 64-bit flags for compiling, add them for linking -LINKFLAGS= -L/opt/local/lib +# Linking flags +LINKFLAGS= -L/usr/local/lib ARFLAGS= -# L.A. Truflandier intel/mkl/mpich2 compilation +# Compilation flags COMPFLAGS= -O3 $(XC_COMPFLAGS) COMPFLAGS_F77= $(COMPFLAGS) -#LIBS= $(FFT_LIB) -lscalapack ${BLACS} -latlas -llapack -lf77blas -lcblas -LIBS= $(FFT_LIB) -lscalapack -lvecLibFort $(XC_LIB) -# XC library or not ? -XC_LIBRARY = CQ -XC_LIB = -XC_COMPFLAGS = -#XC_LIBRARY = LibXC -#XC_LIB = -lxcf90 -lxc -#XC_COMPFLAGS = -I/opt/local/include -#XC_LIB = -L/Users/dave/lib/lib -lxcf90 -lxc -#XC_LIB = /Users/dave/lib/lib/libxcf90.a /Users/dave/lib/lib/libxc.a -#XC_COMPFLAGS = -I/Users/dave/lib/include -# **** EXX is "stable" with FFTW (need to fix for the others) +# Set BLAS and LAPACK libraries +BLAS= -lvecLibFort + +# Full library call; remove scalapack if using dummy diag module +LIBS= $(FFT_LIB) $(XC_LIB) -lscalapack $(BLAS) + +# LibXC compatibility (LibXC below) or Conquest XC library + +# Conquest XC library +#XC_LIBRARY = CQ +#XC_LIB = +#XC_COMPFLAGS = + +# LibXC compatibility +# Choose old LibXC (v2.x) or modern versions +#XC_LIBRARY = LibXC_v2 +XC_LIBRARY = LibXC +XC_LIB = -lxcf90 -lxc +XC_COMPFLAGS = -I/usr/local/include + +# Set FFT library FFT_LIB=-lfftw3 FFT_OBJ=fft_fftw3.o -#FFT_LIB=-LFFT.FFTE -lffte -#FFT_OBJ=fft_ffte.o -#fft_ffte.o: FFT.FFTE/libffte.a -#FFT.FFTE/libffte.a: -# (cd FFT.FFTE; $(MAKE) "FC77=$(F77)" "FC90=${FC}" "FFLAGS=$(COMPFLAGS_F77)" "ARFL=$(ARFLAGS)") - -#FFT_LIB=-LFFT.GPFA -lgpfa -L$(FFTWROOT)/lib -lfftw3 -#FFT_OBJ=fft_gpfa.o -#fft_gpfa.o: FFT.GPFA/libgpfa.a -#FFT.GPFA/libgpfa.a: -# (cd FFT.GPFA; $(MAKE) "FC77=$(F77)" "FC90=${FC}" "FFLAGS=$(COMPFLAGS_F77)" "ARFL=$(ARFLAGS)") - - # Matrix multiplication kernel type MULT_KERN = default # Use dummy DiagModule or not