diff --git a/README.md b/README.md index 0ff5041e..e0daf377 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,13 @@ The help message identifies required positional arguments and optional arguments default values. ``` -usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,ftn,none}] +usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] - [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] - [-e] [-dr] [-sd] [-ff FFLAGS] [-cf CFLAGS] - [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] - [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so] - [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] - [--networkx] [--mb] [-mbd] + [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] + [-dr] [-sd] [-ff FFLAGS] [-cf CFLAGS] [-sl {-lc,-lm}] [-mf] + [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] + [-so] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] + [--networkx] [--meson] [--mesondir] srcdir target This is the pymake program for compiling fortran, c, and c++ source @@ -76,79 +75,70 @@ positional arguments: optional arguments: -h, --help show this help message and exit - -fc {ifort,mpiifort,gfortran,ftn,none} - Fortran compiler to use. (default is - gfortran) + -fc {ifort,mpiifort,gfortran,none} + Fortran compiler to use. (default is gfortran) -cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none} C/C++ compiler to use. (default is gcc) -ar {ia32,ia32_intel64,intel64}, --arch {ia32,ia32_intel64,intel64} - Architecture to use for Intel and Microsoft - compilers on Windows. (default is intel64) - -mc, --makeclean Clean temporary object, module, and source - files when done. (default is False) + Architecture to use for Intel and Microsoft compilers + on Windows. (default is intel64) + -mc, --makeclean Clean temporary object, module, and source files when + done. (default is False) -dbl, --double Force double precision. (default is False) -dbg, --debug Create debug version. (default is False) - -e, --expedite Only compile out of date source files. Clean - must not have been used on previous build. + -e, --expedite Only compile out of date source files. Clean must not + have been used on previous build. (default is False) + -dr, --dryrun Do not actually compile. Files will be deleted, if + --makeclean is used. Does not work yet for ifort. (default is False) - -dr, --dryrun Do not actually compile. Files will be - deleted, if --makeclean is used. Does not - work yet for ifort. (default is False) - -sd, --subdirs Include source files in srcdir - subdirectories. (default is None) + -sd, --subdirs Include source files in srcdir subdirectories. + (default is None) -ff FFLAGS, --fflags FFLAGS - Additional Fortran compiler flags. Fortran - compiler flags should be enclosed in quotes - and start with a blank space or separated - from the name (-ff or --fflags) with a equal - sign (-ff='-O3'). (default is None) + Additional Fortran compiler flags. Fortran compiler + flags should be enclosed in quotes and start with a + blank space or separated from the name (-ff or + --fflags) with a equal sign (-ff='-O3'). (default is + None) -cf CFLAGS, --cflags CFLAGS - Additional C/C++ compiler flags. C/C++ - compiler flags should be enclosed in quotes - and start with a blank space or separated - from the name (-cf or --cflags) with a equal - sign (-cf='-O3'). (default is None) + Additional C/C++ compiler flags. C/C++ compiler flags + should be enclosed in quotes and start with a blank + space or separated from the name (-cf or --cflags) + with a equal sign (-cf='-O3'). (default is None) -sl {-lc,-lm}, --syslibs {-lc,-lm} - Linker system libraries. Linker libraries - should be enclosed in quotes and start with a - blank space or separated from the name (-sl - or --syslibs) with a equal sign - (-sl='-libgcc'). (default is None) - -mf, --makefile Create a GNU make makefile. (default is - False) - -md, --makefile-dir GNU make makefile directory. (default is '.') + Linker system libraries. Linker libraries should be + enclosed in quotes and start with a blank space or + separated from the name (-sl or --syslibs) with a + equal sign (-sl='-libgcc'). (default is None) + -mf, --makefile Create a GNU make makefile. (default is False) + -md, --makefiledir GNU make makefile directory. (default is '.') -cs COMMONSRC, --commonsrc COMMONSRC - Additional directory with common source - files. (default is None) + Additional directory with common source files. + (default is None) -ef EXTRAFILES, --extrafiles EXTRAFILES List of extra source files to include in the - compilation. extrafiles can be either a list - of files or the name of a text file that - contains a list of files. (default is None) + compilation. extrafiles can be either a list of files + or the name of a text file that contains a list of + files. (default is None) -exf EXCLUDEFILES, --excludefiles EXCLUDEFILES - List of extra source files to exclude from - the compilation. excludefiles can be either a - list of files or the name of a text file that - contains a list of files. (default is None) - -so, --sharedobject Create shared object or dll on Windows. - (default is False) - -ad APPDIR, --appdir APPDIR - Target path that overides path defined target - path (default is None) - -v, --verbose Verbose output to terminal. (default is + List of extra source files to exclude from the + compilation. excludefiles can be either a list of + files or the name of a text file that contains a list + of files. (default is None) + -so, --sharedobject Create shared object or dll on Windows. (default is False) + -ad APPDIR, --appdir APPDIR + Target path that overides path defined target path + (default is None) + -v, --verbose Verbose output to terminal. (default is False) --keep Keep existing executable. (default is False) --zip ZIP Zip built executable. (default is False) - --inplace Source files in srcdir are used directly. - (default is False) - --networkx Use networkx package to build Directed - Acyclic Graph use to determine the order - source files are compiled in. (default is - False) - --mb, --meson-build Use meson to build executable. (default is + --inplace Source files in srcdir are used directly. (default is False) - -mbd, --mesonbuild-dir - meson directory. (default is '.') + --networkx Use networkx package to build Directed Acyclic Graph + use to determine the order source files are compiled + in. (default is False) + --meson Use meson to build executable. (default is False) + --mesondir meson directory. (default is '.') Note that the source directory should not contain any bad or duplicate source files as all source files in the source diff --git a/docs/build_apps.md b/docs/build_apps.md index b547b8c2..12b15b90 100644 --- a/docs/build_apps.md +++ b/docs/build_apps.md @@ -6,19 +6,20 @@ and options can be determined by executing: ```console $ make-program --help + usage: make-program [-h] [--release_precision] - [-fc {ifort,mpiifort,gfortran,ftn,none}] - [-cc {gcc,clang,clang++,icc,icx,icl,mpiicc,g++,cl,none}] - [-dr] [-ff FFLAGS] [-cf CFLAGS] [-ad APPDIR] [-v] [--keep] - [--zip ZIP] + [-fc {ifort,mpiifort,gfortran,none}] + [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-dr] + [-ff FFLAGS] [-cf CFLAGS] [-ad APPDIR] [-v] [--keep] + [--zip ZIP] [--meson] targets Download and build USGS MODFLOW and related programs. positional arguments: - targets Program(s) to build. Options: crt, gridgen, gsflow, - libmf6, mf2000, mf2005, mf6, mflgr, mfnwt, mfusg, mp6, - mp7, mt3dms, mt3dusgs, prms, sutra, swtv4, triangle, + targets Program(s) to build. Options: crt, gridgen, libmf6, + mf2000, mf2005, mf6, mflgr, mfnwt, mfusg, mfusg_gsi, + mp6, mp7, mt3dms, mt3dusgs, sutra, swtv4, triangle, vs2dt, zbud6, zonbud3, zonbudusg, :. Specifying the target to be ':' will build all of the programs. @@ -29,9 +30,9 @@ optional arguments: precision version of the program for programs where the standard_switch and double_switch in usgsprograms.txt is True. default is True. - -fc {ifort,mpiifort,gfortran,ftn,none} + -fc {ifort,mpiifort,gfortran,none} Fortran compiler to use. (default is gfortran) - -cc {gcc,clang,clang++,icc,icx,icl,mpiicc,g++,cl,none} + -cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none} C/C++ compiler to use. (default is gcc) -dr, --dryrun Do not actually compile. Files will be deleted, if --makeclean is used. Does not work yet for ifort. @@ -53,6 +54,7 @@ optional arguments: -v, --verbose Verbose output to terminal. (default is False) --keep Keep existing executable. (default is False) --zip ZIP Zip built executable. (default is False) + --meson Use meson to build executable. (default is False) Examples: @@ -64,6 +66,7 @@ Examples: Download and compile all programs in the ./temp subdirectory: $ make-program : --appdir temp + ``` `make-program` can be used to build MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, MODFLOW-LGR, MODFLOW-2000, diff --git a/docs/getting_started.md b/docs/getting_started.md index 7d89f5b4..e30c8c56 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -25,14 +25,13 @@ The help message identifies required positional arguments and optional arguments that can be provided to overide default values. ``` -usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,ftn,none}] +usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] - [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] - [-e] [-dr] [-sd] [-ff FFLAGS] [-cf CFLAGS] - [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] - [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so] - [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] - [--networkx] [--mb] [-mbd] + [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] + [-dr] [-sd] [-ff FFLAGS] [-cf CFLAGS] [-sl {-lc,-lm}] [-mf] + [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] + [-so] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] + [--networkx] [--meson] [--mesondir] srcdir target This is the pymake program for compiling fortran, c, and c++ source @@ -46,79 +45,70 @@ positional arguments: optional arguments: -h, --help show this help message and exit - -fc {ifort,mpiifort,gfortran,ftn,none} - Fortran compiler to use. (default is - gfortran) + -fc {ifort,mpiifort,gfortran,none} + Fortran compiler to use. (default is gfortran) -cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none} C/C++ compiler to use. (default is gcc) -ar {ia32,ia32_intel64,intel64}, --arch {ia32,ia32_intel64,intel64} - Architecture to use for Intel and Microsoft - compilers on Windows. (default is intel64) - -mc, --makeclean Clean temporary object, module, and source - files when done. (default is False) + Architecture to use for Intel and Microsoft compilers + on Windows. (default is intel64) + -mc, --makeclean Clean temporary object, module, and source files when + done. (default is False) -dbl, --double Force double precision. (default is False) -dbg, --debug Create debug version. (default is False) - -e, --expedite Only compile out of date source files. Clean - must not have been used on previous build. + -e, --expedite Only compile out of date source files. Clean must not + have been used on previous build. (default is False) + -dr, --dryrun Do not actually compile. Files will be deleted, if + --makeclean is used. Does not work yet for ifort. (default is False) - -dr, --dryrun Do not actually compile. Files will be - deleted, if --makeclean is used. Does not - work yet for ifort. (default is False) - -sd, --subdirs Include source files in srcdir - subdirectories. (default is None) + -sd, --subdirs Include source files in srcdir subdirectories. + (default is None) -ff FFLAGS, --fflags FFLAGS - Additional Fortran compiler flags. Fortran - compiler flags should be enclosed in quotes - and start with a blank space or separated - from the name (-ff or --fflags) with a equal - sign (-ff='-O3'). (default is None) + Additional Fortran compiler flags. Fortran compiler + flags should be enclosed in quotes and start with a + blank space or separated from the name (-ff or + --fflags) with a equal sign (-ff='-O3'). (default is + None) -cf CFLAGS, --cflags CFLAGS - Additional C/C++ compiler flags. C/C++ - compiler flags should be enclosed in quotes - and start with a blank space or separated - from the name (-cf or --cflags) with a equal - sign (-cf='-O3'). (default is None) + Additional C/C++ compiler flags. C/C++ compiler flags + should be enclosed in quotes and start with a blank + space or separated from the name (-cf or --cflags) + with a equal sign (-cf='-O3'). (default is None) -sl {-lc,-lm}, --syslibs {-lc,-lm} - Linker system libraries. Linker libraries - should be enclosed in quotes and start with a - blank space or separated from the name (-sl - or --syslibs) with a equal sign - (-sl='-libgcc'). (default is None) - -mf, --makefile Create a GNU make makefile. (default is - False) - -md, --makefile-dir GNU make makefile directory. (default is '.') + Linker system libraries. Linker libraries should be + enclosed in quotes and start with a blank space or + separated from the name (-sl or --syslibs) with a + equal sign (-sl='-libgcc'). (default is None) + -mf, --makefile Create a GNU make makefile. (default is False) + -md, --makefiledir GNU make makefile directory. (default is '.') -cs COMMONSRC, --commonsrc COMMONSRC - Additional directory with common source - files. (default is None) + Additional directory with common source files. + (default is None) -ef EXTRAFILES, --extrafiles EXTRAFILES List of extra source files to include in the - compilation. extrafiles can be either a list - of files or the name of a text file that - contains a list of files. (default is None) + compilation. extrafiles can be either a list of files + or the name of a text file that contains a list of + files. (default is None) -exf EXCLUDEFILES, --excludefiles EXCLUDEFILES - List of extra source files to exclude from - the compilation. excludefiles can be either a - list of files or the name of a text file that - contains a list of files. (default is None) - -so, --sharedobject Create shared object or dll on Windows. - (default is False) - -ad APPDIR, --appdir APPDIR - Target path that overides path defined target - path (default is None) - -v, --verbose Verbose output to terminal. (default is + List of extra source files to exclude from the + compilation. excludefiles can be either a list of + files or the name of a text file that contains a list + of files. (default is None) + -so, --sharedobject Create shared object or dll on Windows. (default is False) + -ad APPDIR, --appdir APPDIR + Target path that overides path defined target path + (default is None) + -v, --verbose Verbose output to terminal. (default is False) --keep Keep existing executable. (default is False) --zip ZIP Zip built executable. (default is False) - --inplace Source files in srcdir are used directly. - (default is False) - --networkx Use networkx package to build Directed - Acyclic Graph use to determine the order - source files are compiled in. (default is - False) - --mb, --meson-build Use meson to build executable. (default is + --inplace Source files in srcdir are used directly. (default is False) - -mbd, --mesonbuild-dir - meson directory. (default is '.') + --networkx Use networkx package to build Directed Acyclic Graph + use to determine the order source files are compiled + in. (default is False) + --meson Use meson to build executable. (default is False) + --mesondir meson directory. (default is '.') Note that the source directory should not contain any bad or duplicate source files as all source files in the source diff --git a/pymake/pymake_base.py b/pymake/pymake_base.py index 71eb4450..9b9c3f7f 100644 --- a/pymake/pymake_base.py +++ b/pymake/pymake_base.py @@ -1621,22 +1621,6 @@ def _create_makefile( line += f"\t\tFFLAGS ?= {' '.join(tfflags)}\n" line += "\t\tMODSWITCH = -module $(MODDIR)\n" line += "\tendif\n" - line += "\tifeq ($(FC), $(filter $(FC), ftn))\n" - tfflags = _get_fortran_flags( - target, - "ftn", - [], - debug, - double, - osname="linux", - sharedobject=sharedobject, - verbose=verbose, - ) - for idx, flag in enumerate(tfflags): - if "-D__" in flag: - tfflags[idx] = "$(OS_macro)" - line += f"\t\tFFLAGS ?= {' '.join(tfflags)}\n" - line += "\tendif\n" line += "endif\n\n" f.write(line) @@ -1820,20 +1804,6 @@ def _create_makefile( ) line += f"\t\tLDFLAGS ?= {' '.join(tsyslibs)}\n" line += "\tendif\n" - # ftn compiler - line += "\tifeq ($(FC), $(filter $(FC), ftn))\n" - _, tsyslibs = _get_linker_flags( - target, - "ftn", - "clang", - [], - srcfiles, - osname="linux", - sharedobject=sharedobject, - verbose=verbose, - ) - line += f"\t\tLDFLAGS ?= {' '.join(tsyslibs)}\n" - line += "\tendif\n" line += "endif\n\n" f.write(line) diff --git a/pymake/pymake_parser.py b/pymake/pymake_parser.py index faeeb8f2..a9425ba8 100644 --- a/pymake/pymake_parser.py +++ b/pymake/pymake_parser.py @@ -49,7 +49,6 @@ def _get_standard_arg_dict(): "ifort", "mpiifort", "gfortran", - "ftn", "none", ], "action": None, diff --git a/pymake/utils/_compiler_switches.py b/pymake/utils/_compiler_switches.py index d186892e..e6eb0fff 100644 --- a/pymake/utils/_compiler_switches.py +++ b/pymake/utils/_compiler_switches.py @@ -364,20 +364,6 @@ def _get_fortran_flags( ] if double: flags += ["r8", "autodouble"] - elif fc in ("ftn",): - if osname in ("win32", "darwin"): - raise ValueError(f"ftn compiler not supported on {osname}") - else: - if sharedobject: - flags.append("f PIC") - else: - if "f PIC" in flags: - flags.remove("f PIC") - if debug: - flags += ["g"] - flags += ["h noheap_allocate"] - if double: - flags += ["s default64"] # process passed fortran flags - check for flags with a space between # the flag and a setting @@ -659,7 +645,6 @@ def _get_linker_flags( if fc in ( "ifort", "mpiifort", - "ftn", ): gnu_compiler = False else: