Commit 691d1b73 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #607 from akohlmey/final-changes-for-stable

Final build system changes for stable release
parents 0a54c34e 95ece8a6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
Makefile.lammps
.depend
Makefile.auto
+19 −10
Original line number Diff line number Diff line
@@ -23,8 +23,9 @@ specify -m and optionally -e, order does not matter

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
make lib-poems args="-m serial" # build POEMS lib with same settings as in the serial Makefile in src
make lib-colvars args="-m mpi"  # build USER-COLVARS lib with same settings as in the mpi Makefile in src
make lib-meam args="-m ifort"   # build MEAM lib with custom Makefile.ifort (using Intel Fortran)
"""

# print error message or help
@@ -70,23 +71,31 @@ if not os.path.exists("Makefile.%s" % 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] == '=':
  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)
  print >>fp,line,
  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)

lib/awpmd/Makefile.mpi

0 → 100644
+71 −0
Original line number Diff line number Diff line
SHELL = /bin/sh

# which file will be copied to Makefile.lammps

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 =	    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 -f *.d *~ $(OBJ) $(LIB)
+5 −3
Original line number Diff line number Diff line
@@ -36,8 +36,10 @@ OBJ = $(SRC:.cpp=.o)
# 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
@@ -66,4 +68,4 @@ DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------

clean:
	-rm *.d *~ $(OBJ) $(LIB)
	-rm -f *.d *~ $(OBJ) $(LIB)
+71 −0
Original line number Diff line number Diff line
SHELL = /bin/sh

# which file will be copied to Makefile.lammps

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 =	    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 -f *.d *~ $(OBJ) $(LIB)
Loading