diff --git a/lib/.gitignore b/lib/.gitignore index cbeae7705..4f9ebba6a 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -1,2 +1,3 @@ Makefile.lammps .depend +Makefile.auto diff --git a/lib/Install.py b/lib/Install.py index 6b9025433..416a2319c 100644 --- a/lib/Install.py +++ b/lib/Install.py @@ -1,92 +1,100 @@ #!/usr/bin/env python # install.py tool to do a generic build of a library # soft linked to by many of the lib/Install.py files # used to automate the steps described in the corresponding lib/README from __future__ import print_function import sys,os,subprocess # help message help = """ Syntax from src dir: make lib-libname args="-m machine -e suffix" Syntax from lib dir: python Install.py -m machine -e suffix libname = name of lib dir (e.g. atc, h5md, meam, poems, etc) specify -m and optionally -e, order does not matter -m = peform a clean followed by "make -f Makefile.machine" machine = suffix of a lib/Makefile.* file -e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix does not alter existing Makefile.machine Examples: make lib-poems args="-m g++" # build COLVARS lib with GNU g++ compiler make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler """ # print error message or help def error(str=None): if not str: print(help) else: print("ERROR",str) sys.exit() # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error() machine = None extraflag = 0 iarg = 0 while iarg < nargs: if args[iarg] == "-m": if iarg+2 > nargs: error() machine = args[iarg+1] iarg += 2 elif args[iarg] == "-e": if iarg+2 > nargs: error() extraflag = 1 suffix = args[iarg+1] iarg += 2 else: error() # set lib from working dir cwd = os.getcwd() lib = os.path.basename(cwd) # create Makefile.auto as copy of Makefile.machine # reset EXTRAMAKE if requested if not os.path.exists("Makefile.%s" % machine): error("lib/%s/Makefile.%s does not exist" % (lib,machine)) lines = open("Makefile.%s" % machine,'r').readlines() fp = open("Makefile.auto",'w') +has_extramake = False for line in lines: words = line.split() - if len(words) == 3 and extraflag and \ - words[0] == "EXTRAMAKE" and words[1] == '=': - line = line.replace(words[2],"Makefile.lammps.%s" % suffix) - print >>fp,line, + if len(words) == 3 and words[0] == "EXTRAMAKE" and words[1] == '=': + has_extramake = True + if extraflag: + line = line.replace(words[2],"Makefile.lammps.%s" % suffix) + fp.write(line) fp.close() -# make the library via Makefile.auto +# make the library via Makefile.auto optionally with parallel make + +try: + import multiprocessing + n_cpus = multiprocessing.cpu_count() +except: + n_cpus = 1 print("Building lib%s.a ..." % lib) -cmd = "make -f Makefile.auto clean; make -f Makefile.auto" +cmd = "make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus txt = subprocess.check_output(cmd,shell=True,stderr=subprocess.STDOUT) -print(txt) +print(txt.decode('UTF-8')) if os.path.exists("lib%s.a" % lib): print("Build was successful") else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) -if not os.path.exists("Makefile.lammps"): +if has_extramake and not os.path.exists("Makefile.lammps"): print("lib/%s/Makefile.lammps was NOT created" % lib) diff --git a/lib/awpmd/Makefile.mpicc b/lib/awpmd/Makefile.mpi similarity index 83% copy from lib/awpmd/Makefile.mpicc copy to lib/awpmd/Makefile.mpi index 4c289ad88..e4b424e77 100644 --- a/lib/awpmd/Makefile.mpicc +++ b/lib/awpmd/Makefile.mpi @@ -1,69 +1,71 @@ SHELL = /bin/sh # which file will be copied to Makefile.lammps -EXTRAMAKE = Makefile.lammps.installed +EXTRAMAKE = Makefile.lammps.linalg # ------ FILES ------ SRC = \ ivutils/src/logexc.cpp \ systems/interact/TCP/wpmd.cpp \ systems/interact/TCP/wpmd_split.cpp INC = \ cerf.h \ cerf2.h \ cerf_octave.h \ cvector_3.h \ lapack_inter.h \ logexc.h \ pairhash.h \ refobj.h \ tcpdefs.h \ vector_3.h \ wavepacket.h \ wpmd.h \ wpmd_split.h # ------ DEFINITIONS ------ LIB = libawpmd.a OBJ = $(SRC:.cpp=.o) # ------ SETTINGS ------ # include any MPI settings needed for the ATC library to build with # the same MPI library that LAMMPS is built with -CC = mpic++ -CCFLAGS = -O -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include +CC = mpicxx +CCFLAGS = -O3 -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include \ + -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 + ARCHIVE = ar ARCHFLAG = -rc DEPFLAGS = -M #LINK = #LINKFLAGS = USRLIB = SYSLIB = # ------ MAKE PROCEDURE ------ lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) @cp $(EXTRAMAKE) Makefile.lammps # ------ COMPILE RULES ------ %.o:%.cpp $(CC) $(CCFLAGS) -c $< -o $@ %.d:%.cpp $(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@ # ------ DEPENDENCIES ------ DEPENDS = $(OBJ:.o=.d) # ------ CLEAN ------ clean: - -rm *.d *~ $(OBJ) $(LIB) + -rm -f *.d *~ $(OBJ) $(LIB) diff --git a/lib/awpmd/Makefile.mpicc b/lib/awpmd/Makefile.mpicc index 4c289ad88..5cf6a75bd 100644 --- a/lib/awpmd/Makefile.mpicc +++ b/lib/awpmd/Makefile.mpicc @@ -1,69 +1,71 @@ SHELL = /bin/sh # which file will be copied to Makefile.lammps EXTRAMAKE = Makefile.lammps.installed # ------ FILES ------ SRC = \ ivutils/src/logexc.cpp \ systems/interact/TCP/wpmd.cpp \ systems/interact/TCP/wpmd_split.cpp INC = \ cerf.h \ cerf2.h \ cerf_octave.h \ cvector_3.h \ lapack_inter.h \ logexc.h \ pairhash.h \ refobj.h \ tcpdefs.h \ vector_3.h \ wavepacket.h \ wpmd.h \ wpmd_split.h # ------ DEFINITIONS ------ LIB = libawpmd.a OBJ = $(SRC:.cpp=.o) # ------ SETTINGS ------ # include any MPI settings needed for the ATC library to build with # the same MPI library that LAMMPS is built with -CC = mpic++ -CCFLAGS = -O -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include +CC = mpicxx +CCFLAGS = -O3 -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include \ + -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 + ARCHIVE = ar ARCHFLAG = -rc DEPFLAGS = -M #LINK = #LINKFLAGS = USRLIB = SYSLIB = # ------ MAKE PROCEDURE ------ lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) @cp $(EXTRAMAKE) Makefile.lammps # ------ COMPILE RULES ------ %.o:%.cpp $(CC) $(CCFLAGS) -c $< -o $@ %.d:%.cpp $(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@ # ------ DEPENDENCIES ------ DEPENDS = $(OBJ:.o=.d) # ------ CLEAN ------ clean: - -rm *.d *~ $(OBJ) $(LIB) + -rm -f *.d *~ $(OBJ) $(LIB) diff --git a/lib/awpmd/Makefile.mpicc b/lib/awpmd/Makefile.serial similarity index 85% copy from lib/awpmd/Makefile.mpicc copy to lib/awpmd/Makefile.serial index 4c289ad88..f51714fc9 100644 --- a/lib/awpmd/Makefile.mpicc +++ b/lib/awpmd/Makefile.serial @@ -1,69 +1,71 @@ SHELL = /bin/sh # which file will be copied to Makefile.lammps -EXTRAMAKE = Makefile.lammps.installed +EXTRAMAKE = Makefile.lammps.linalg # ------ FILES ------ SRC = \ ivutils/src/logexc.cpp \ systems/interact/TCP/wpmd.cpp \ systems/interact/TCP/wpmd_split.cpp INC = \ cerf.h \ cerf2.h \ cerf_octave.h \ cvector_3.h \ lapack_inter.h \ logexc.h \ pairhash.h \ refobj.h \ tcpdefs.h \ vector_3.h \ wavepacket.h \ wpmd.h \ wpmd_split.h # ------ DEFINITIONS ------ LIB = libawpmd.a OBJ = $(SRC:.cpp=.o) # ------ SETTINGS ------ # include any MPI settings needed for the ATC library to build with # the same MPI library that LAMMPS is built with -CC = mpic++ -CCFLAGS = -O -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include +CC = g++ +CCFLAGS = -O3 -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include \ + -I../../src/STUBS + ARCHIVE = ar ARCHFLAG = -rc DEPFLAGS = -M #LINK = #LINKFLAGS = USRLIB = SYSLIB = # ------ MAKE PROCEDURE ------ lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) @cp $(EXTRAMAKE) Makefile.lammps # ------ COMPILE RULES ------ %.o:%.cpp $(CC) $(CCFLAGS) -c $< -o $@ %.d:%.cpp $(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@ # ------ DEPENDENCIES ------ DEPENDS = $(OBJ:.o=.d) # ------ CLEAN ------ clean: - -rm *.d *~ $(OBJ) $(LIB) + -rm -f *.d *~ $(OBJ) $(LIB) diff --git a/lib/colvars/Install.py b/lib/colvars/Install.py index 2fc207710..01e70543f 100644 --- a/lib/colvars/Install.py +++ b/lib/colvars/Install.py @@ -1,142 +1,142 @@ #!/usr/bin/env python # Install.py tool to do automate build of Colvars from __future__ import print_function import sys,os,subprocess # help message help = """ Syntax from src dir: make lib-colvars args="-m machine -e suffix" Syntax from lib/colvars dir: python Install.py -m machine -e suffix specify -m and optionally -e, order does not matter - -m = peform a clean followed by "make -f Makefile.machine" + -m = delete all existing objects, followed by "make -f Makefile.machine" machine = suffix of a lib/colvars/Makefile.* or of a src/MAKE/MACHINES/Makefile.* file -e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix does not alter existing Makefile.machine Examples: -make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler +make lib-colvars args="-m mpi" # build COLVARS lib with default mpi compiler wrapper """ # print error message or help def error(str=None): if not str: print(help) else: print("ERROR",str) sys.exit() # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error() machine = None extraflag = False iarg = 0 while iarg < nargs: if args[iarg] == "-m": if iarg+2 > len(args): error() machine = args[iarg+1] iarg += 2 elif args[iarg] == "-e": if iarg+2 > len(args): error() extraflag = True suffix = args[iarg+1] iarg += 2 else: error() # set lib from working dir cwd = os.getcwd() lib = os.path.basename(cwd) def get_lammps_machine_flags(machine): """Parse Makefile.machine from LAMMPS, return dictionary of compiler flags""" if not os.path.exists("../../src/MAKE/MACHINES/Makefile.%s" % machine): error("Cannot locate src/MAKE/MACHINES/Makefile.%s" % machine) lines = open("../../src/MAKE/MACHINES/Makefile.%s" % machine, 'r').readlines() machine_flags = {} for line in lines: line = line.partition('#')[0] line = line.rstrip() words = line.split() if (len(words) > 2): if ((words[0] == 'CC') or (words[0] == 'CCFLAGS') or (words[0] == 'SHFLAGS') or (words[0] == 'ARCHIVE') or (words[0] == 'ARFLAGS') or (words[0] == 'SHELL')): machine_flags[words[0]] = ' '.join(words[2:]) return machine_flags def gen_colvars_makefile_machine(machine, machine_flags): """Generate Makefile.machine for Colvars given the compiler flags""" machine_makefile = open("Makefile.%s" % machine, 'w') machine_makefile.write('''# -*- makefile -*- to build Colvars module with %s COLVARS_LIB = libcolvars.a COLVARS_OBJ_DIR = CXX = %s CXXFLAGS = %s %s AR = %s ARFLAGS = %s SHELL = %s include Makefile.common .PHONY: default clean default: $(COLVARS_LIB) Makefile.lammps clean: -rm -f $(COLVARS_OBJS) $(COLVARS_LIB) ''' % (machine, machine_flags['CC'], machine_flags['CCFLAGS'], machine_flags['SHFLAGS'] , machine_flags['ARCHIVE'], machine_flags['ARFLAGS'], machine_flags['SHELL'])) if not os.path.exists("Makefile.%s" % machine): machine_flags = get_lammps_machine_flags(machine) gen_colvars_makefile_machine(machine, machine_flags) if not os.path.exists("Makefile.%s" % machine): error("lib/%s/Makefile.%s does not exist" % (lib,machine)) # create Makefile.auto as copy of Makefile.machine # reset EXTRAMAKE if requested lines = open("Makefile.%s" % machine,'r').readlines() fp = open("Makefile.auto",'w') for line in lines: words = line.split() if len(words) == 3 and extraflag and \ words[0] == "EXTRAMAKE" and words[1] == '=': line = line.replace(words[2],"Makefile.lammps.%s" % suffix) fp.write(line) fp.close() -# make the library via Makefile.auto +# make the library via Makefile.auto optionally with parallel make try: import multiprocessing n_cpus = multiprocessing.cpu_count() except: n_cpus = 1 print("Building lib%s.a ..." % lib) cmd = ["make -f Makefile.auto clean"] -print(subprocess.check_output(cmd, shell=True).decode()) +print(subprocess.check_output(cmd, shell=True).decode('UTF-8')) cmd = ["make -f Makefile.auto -j%d" % n_cpus] -print(subprocess.check_output(cmd, shell=True).decode()) +print(subprocess.check_output(cmd, shell=True).decode('UTF-8')) if os.path.exists("lib%s.a" % lib): print("Build was successful") else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) if not os.path.exists("Makefile.lammps"): print("lib/%s/Makefile.lammps was NOT created" % lib) diff --git a/lib/colvars/Makefile.lammps b/lib/colvars/Makefile.lammps deleted file mode 100644 index 99f57b050..000000000 --- a/lib/colvars/Makefile.lammps +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -colvars_SYSINC = -colvars_SYSLIB = -colvars_SYSPATH = diff --git a/lib/colvars/Makefile.mingw32-cross b/lib/colvars/Makefile.mingw32-cross deleted file mode 100644 index 29c64b26a..000000000 --- a/lib/colvars/Makefile.mingw32-cross +++ /dev/null @@ -1,31 +0,0 @@ -# -*- makefile -*- to build Colvars module with MinGW 32-bit - -EXTRAMAKE = Makefile.lammps.empty - -COLVARS_LIB = libcolvars.a -COLVARS_OBJ_DIR = Obj_mingw64/ - -CXX = i686-w64-mingw32-g++ -CXXFLAGS = -O2 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \ - -fno-rtti -fno-exceptions -finline-functions \ - -ffast-math -funroll-loops -fstrict-aliasing \ - -Wall -W -Wno-uninitialized -AR = i686-w64-mingw32-ar -ARFLAGS = -rscv -SHELL = /bin/sh - -.PHONY: default clean - -default: $(COLVARS_OBJ_DIR) $(COLVARS_LIB) Makefile.lammps - -include Makefile.common - -$(COLVARS_OBJ_DIR): - mkdir $(COLVARS_OBJ_DIR) - -clean: - -rm -f $(COLVARS_OBJS) $(COLVARS_LIB) - -rmdir $(COLVARS_OBJ_DIR) - -Makefile.lammps: - -cp $(EXTRAMAKE) Makefile.lammps diff --git a/lib/colvars/Makefile.mingw32-cross-mpi b/lib/colvars/Makefile.mingw32-cross-mpi deleted file mode 100644 index 1e35c5b46..000000000 --- a/lib/colvars/Makefile.mingw32-cross-mpi +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- wrapper for non-MPI libraries - -SHELL=/bin/sh - -all: - $(MAKE) $(MFLAGS) mingw32-cross - -rm -f Obj_mingw32-mpi - ln -s Obj_mingw32 Obj_mingw32-mpi - -clean: - $(MAKE) $(MFLAGS) clean-mingw32-cross - -rm -f Obj_mingw32-mpi - diff --git a/lib/colvars/Makefile.mingw64-cross b/lib/colvars/Makefile.mingw64-cross deleted file mode 100644 index 2fd1c6fc6..000000000 --- a/lib/colvars/Makefile.mingw64-cross +++ /dev/null @@ -1,31 +0,0 @@ -# -*- makefile -*- to build Colvars module with MinGW 32-bit - -EXTRAMAKE = Makefile.lammps.empty - -COLVARS_LIB = libcolvars.a -COLVARS_OBJ_DIR = Obj_mingw32/ - -CXX = x86_64-w64-mingw32-g++ -CXXFLAGS = -O2 -march=core2 -mtune=core2 -mpc64 -msse2 \ - -fno-rtti -fno-exceptions -finline-functions \ - -ffast-math -funroll-loops -fstrict-aliasing \ - -Wall -W -Wno-uninitialized -AR = x86_64-w64-mingw32-ar -ARFLAGS = -rscv -SHELL = /bin/sh - -.PHONY: default clean - -default: $(COLVARS_OBJ_DIR) $(COLVARS_LIB) Makefile.lammps - -include Makefile.common - -$(COLVARS_OBJ_DIR): - mkdir $(COLVARS_OBJ_DIR) - -clean: - -rm -f $(COLVARS_OBJS) $(COLVARS_LIB) - -rmdir $(COLVARS_OBJ_DIR) - -Makefile.lammps: - -cp $(EXTRAMAKE) Makefile.lammps diff --git a/lib/colvars/Makefile.mingw64-cross-mpi b/lib/colvars/Makefile.mingw64-cross-mpi deleted file mode 100644 index ca6f4a6d4..000000000 --- a/lib/colvars/Makefile.mingw64-cross-mpi +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- wrapper for non-MPI libraries - -SHELL=/bin/sh - -all: - $(MAKE) $(MFLAGS) mingw64-cross - -rm -f Obj_mingw64-mpi - ln -s Obj_mingw64 Obj_mingw64-mpi - -clean: - $(MAKE) $(MFLAGS) clean-mingw64-cross - -rm -f Obj_mingw64-mpi - diff --git a/lib/colvars/Makefile.mpi b/lib/colvars/Makefile.mpi new file mode 100644 index 000000000..6343ed7c0 --- /dev/null +++ b/lib/colvars/Makefile.mpi @@ -0,0 +1,25 @@ +# -*- makefile -*- to build Colvars module with default MPI compiler wrapper + +EXTRAMAKE = Makefile.lammps.empty + +COLVARS_LIB = libcolvars.a +COLVARS_OBJ_DIR = + +CXX = mpicxx +CXXFLAGS = -O2 -g -Wall -fPIC -funroll-loops +AR = ar +ARFLAGS = -rscv +SHELL = /bin/sh + +.PHONY: default clean + +default: $(COLVARS_LIB) Makefile.lammps + +include Makefile.common + +clean: + -rm -f $(COLVARS_OBJS) $(COLVARS_LIB) + +Makefile.lammps: + -cp $(EXTRAMAKE) Makefile.lammps + diff --git a/lib/colvars/Makefile.serial b/lib/colvars/Makefile.serial new file mode 100644 index 000000000..556e39d07 --- /dev/null +++ b/lib/colvars/Makefile.serial @@ -0,0 +1,25 @@ +# -*- makefile -*- to build Colvars module with GNU compiler + +EXTRAMAKE = Makefile.lammps.empty + +COLVARS_LIB = libcolvars.a +COLVARS_OBJ_DIR = + +CXX = g++ +CXXFLAGS = -O2 -g -Wall -fPIC -funroll-loops +AR = ar +ARFLAGS = -rscv +SHELL = /bin/sh + +.PHONY: default clean + +default: $(COLVARS_LIB) Makefile.lammps + +include Makefile.common + +clean: + -rm -f $(COLVARS_OBJS) $(COLVARS_LIB) + +Makefile.lammps: + -cp $(EXTRAMAKE) Makefile.lammps + diff --git a/lib/h5md/Makefile.h5cc b/lib/h5md/Makefile.h5cc index bd3e8a978..9feed2d74 100644 --- a/lib/h5md/Makefile.h5cc +++ b/lib/h5md/Makefile.h5cc @@ -1,33 +1,38 @@ EXTRAMAKE=Makefile.lammps.empty CC=h5cc # -DH5_NO_DEPRECATED_SYMBOLS is required here to ensure we are using # the v1.8 API when HDF5 is configured to default to using the v1.6 API. CFLAGS=-D_DEFAULT_SOURCE -O2 -DH5_NO_DEPRECATED_SYMBOLS -Wall -fPIC HDF5_PATH=/usr INC=-I include AR=ar ARFLAGS=rc -LIB=libch5md.a +# need to build two libraries to not break compatibility and to support Install.py +LIB=libh5md.a libch5md.a all: lib Makefile.lammps build: mkdir -p build + build/ch5md.o: src/ch5md.c | build $(CC) $(INC) $(CFLAGS) -c $< -o $@ Makefile.lammps: cp $(EXTRAMAKE) $@ .PHONY: all lib clean -$(LIB): build/ch5md.o - $(AR) $(ARFLAGS) $(LIB) build/ch5md.o +libch5md.a : build/ch5md.o + $(AR) $(ARFLAGS) $@ build/ch5md.o + +libh5md.a : build/ch5md.o + $(AR) $(ARFLAGS) $@ build/ch5md.o lib: $(LIB) clean: rm -f build/*.o $(LIB) diff --git a/lib/linalg/Install.py b/lib/linalg/Install.py deleted file mode 100644 index 560afecec..000000000 --- a/lib/linalg/Install.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -# install.py tool to do build of the linear algebra library -# used to automate the steps described in the README file in this dir - -import sys,commands,os - -# help message - -help = """ -Syntax from src dir: make lib-linalg args="-m machine" -Syntax from lib dir: python Install.py -m machine - - -m = peform a clean followed by "make -f Makefile.machine" - machine = suffix of a lib/Makefile.* file - -Example: - -make lib-linalg args="-m gfortran" # build with GNU Fortran compiler -""" - -# print error message or help - -def error(str=None): - if not str: print help - else: print "ERROR",str - sys.exit() - -# parse args - -args = sys.argv[1:] -nargs = len(args) -if nargs == 0: error() - -machine = None - -iarg = 0 -while iarg < nargs: - if args[iarg] == "-m": - if iarg+2 > nargs: error() - machine = args[iarg+1] - iarg += 2 - else: error() - -# set lib from working dir - -cwd = os.getcwd() -lib = os.path.basename(cwd) - -# make the library - -print "Building lib%s.a ..." % lib -cmd = "make -f Makefile.%s clean; make -f Makefile.%s" % (machine,machine) -txt = commands.getoutput(cmd) -print txt - -if os.path.exists("lib%s.a" % lib): print "Build was successful" -else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) diff --git a/lib/linalg/Makefile.gfortran b/lib/linalg/Makefile.gfortran index 89b7f2d7a..7e1d97a5b 100644 --- a/lib/linalg/Makefile.gfortran +++ b/lib/linalg/Makefile.gfortran @@ -1,54 +1,52 @@ # -*- makefile -*- # *_________________________________________________________________________* # * Minimal BLAS/LAPACK Library for use by other LAMMPS packages SHELL = /bin/sh # ------ FILES ------ SRC = $(wildcard *.f) FILES = $(SRC) Makefile.* README # ------ DEFINITIONS ------ LIB = liblinalg.a OBJ = $(SRC:.f=.o) # ------ SETTINGS ------ FC = gfortran -FFLAGS = -O3 -fPIC -march=native -mpc64 \ - -ffast-math -funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized -fno-second-underscore -FFLAGS0 = -O0 -fPIC -march=native -mpc64 \ - -Wall -W -Wno-uninitialized -fno-second-underscore +FFLAGS = -O3 -fPIC -ffast-math -fstrict-aliasing -fno-second-underscore +FFLAGS0 = -O0 -fPIC -fno-second-underscore ARCHIVE = ar AR = ar ARCHFLAG = -rcs USRLIB = SYSLIB = # ------ MAKE PROCEDURE ------ lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) # ------ COMPILE RULES ------ %.o:%.F $(F90) $(F90FLAGS) -c $< %.o:%.f $(FC) $(FFLAGS) -c $< dlamch.o: dlamch.f $(FC) $(FFLAGS0) -c $< # ------ CLEAN ------ clean: - -rm *.o *.mod *~ $(LIB) + -rm -f *.o *.mod *~ $(LIB) tar: -tar -czvf ../linalg.tar.gz $(FILES) diff --git a/lib/linalg/Makefile.mingw32-cross b/lib/linalg/Makefile.mingw32-cross deleted file mode 100644 index 02aa3f71a..000000000 --- a/lib/linalg/Makefile.mingw32-cross +++ /dev/null @@ -1,67 +0,0 @@ -# -*- makefile -*- -# *_________________________________________________________________________* -# * Minimal BLAS/LAPACK Library for use by other LAMMPS packages - -SHELL = /bin/sh - -# ------ FILES ------ - -SRC = $(wildcard *.f) - -FILES = $(SRC) Makefile.* README - -# ------ DEFINITIONS ------ - -DIR = Obj_mingw32/ -LIB = $(DIR)liblinalg.a -OBJ = $(SRC:%.f=$(DIR)%.o) - -# ------ SETTINGS ------ - -FC = i686-w64-mingw32-gfortran -FFLAGS = -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \ - -ffast-math -funroll-loops -fstrict-aliasing -Wall -W \ - -Wno-uninitialized -fno-second-underscore -FFLAGS0 = -O0 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \ - -Wall -W -Wno-uninitialized -fno-second-underscore -ARCHIVE = i686-w64-mingw32-ar -AR = i686-w64-mingw32-ar -ARCHFLAG = -rcs -USRLIB = -SYSLIB = - -.PHONY: default clean tar - -.SUFFIXES: -.SUFFIXES: .F .f .o - -# ------ MAKE PROCEDURE ------ - -default: $(DIR) $(LIB) - -$(LIB): $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - -$(DIR): - mkdir $(DIR) - -# ------ COMPILE RULES ------ - -$(DIR)%.o:%.F - $(F90) $(F90FLAGS) -c $< -o $@ - -$(DIR)%.o:%.f - $(FC) $(FFLAGS) -c $< -o $@ - -$(DIR)dlamch.o: dlamch.f - $(FC) $(FFLAGS0) -c $< -o $@ - -# ------ CLEAN ------ - -clean: - -rm $(DIR)*.o $(DIR)*.mod *~ $(LIB) - -rmdir $(DIR) - -tar: - -tar -czvf ../linalg.tar.gz $(FILES) - diff --git a/lib/linalg/Makefile.mingw32-cross-mpi b/lib/linalg/Makefile.mingw32-cross-mpi deleted file mode 100644 index 1e35c5b46..000000000 --- a/lib/linalg/Makefile.mingw32-cross-mpi +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- wrapper for non-MPI libraries - -SHELL=/bin/sh - -all: - $(MAKE) $(MFLAGS) mingw32-cross - -rm -f Obj_mingw32-mpi - ln -s Obj_mingw32 Obj_mingw32-mpi - -clean: - $(MAKE) $(MFLAGS) clean-mingw32-cross - -rm -f Obj_mingw32-mpi - diff --git a/lib/linalg/Makefile.mingw64-cross b/lib/linalg/Makefile.mingw64-cross deleted file mode 100644 index ee6eef819..000000000 --- a/lib/linalg/Makefile.mingw64-cross +++ /dev/null @@ -1,67 +0,0 @@ -# -*- makefile -*- -# *_________________________________________________________________________* -# * Minimal BLAS/LAPACK Library for use by other LAMMPS packages - -SHELL = /bin/sh - -# ------ FILES ------ - -SRC = $(wildcard *.f) - -FILES = $(SRC) Makefile.* README - -# ------ DEFINITIONS ------ - -DIR = Obj_mingw64/ -LIB = $(DIR)liblinalg.a -OBJ = $(SRC:%.f=$(DIR)%.o) - -# ------ SETTINGS ------ - -FC = x86_64-w64-mingw32-gfortran -FFLAGS = -O3 -march=core2 -mtune=generic -msse2 -mpc64 \ - -ffast-math -funroll-loops -fstrict-aliasing -Wall -W \ - -Wno-uninitialized -fno-second-underscore -FFLAGS0 = -O0 -march=core2 -mtune=generic -msse2 -mpc64 \ - -Wall -W -Wno-uninitialized -fno-second-underscore -ARCHIVE = x86_64-w64-mingw32-ar -AR = x86_64-w64-mingw32-ar -ARCHFLAG = -rcs -USRLIB = -SYSLIB = - -.PHONY: default clean tar - -.SUFFIXES: -.SUFFIXES: .F .f .o - -# ------ MAKE PROCEDURE ------ - -default: $(DIR) $(LIB) - -$(LIB): $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - -$(DIR): - mkdir $(DIR) - -# ------ COMPILE RULES ------ - -$(DIR)%.o:%.F - $(F90) $(F90FLAGS) -c $< -o $@ - -$(DIR)%.o:%.f - $(FC) $(FFLAGS) -c $< -o $@ - -$(DIR)dlamch.o: dlamch.f - $(FC) $(FFLAGS0) -c $< -o $@ - -# ------ CLEAN ------ - -clean: - -rm $(DIR)*.o $(DIR)*.mod *~ $(LIB) - -rmdir $(DIR) - -tar: - -tar -czvf ../linalg.tar.gz $(FILES) - diff --git a/lib/linalg/Makefile.mingw64-cross-mpi b/lib/linalg/Makefile.mingw64-cross-mpi deleted file mode 100644 index ca6f4a6d4..000000000 --- a/lib/linalg/Makefile.mingw64-cross-mpi +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- wrapper for non-MPI libraries - -SHELL=/bin/sh - -all: - $(MAKE) $(MFLAGS) mingw64-cross - -rm -f Obj_mingw64-mpi - ln -s Obj_mingw64 Obj_mingw64-mpi - -clean: - $(MAKE) $(MFLAGS) clean-mingw64-cross - -rm -f Obj_mingw64-mpi - diff --git a/lib/linalg/Makefile.serial b/lib/linalg/Makefile.serial new file mode 120000 index 000000000..c52fbcb98 --- /dev/null +++ b/lib/linalg/Makefile.serial @@ -0,0 +1 @@ +Makefile.gfortran \ No newline at end of file