Commit c3a15e22 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

use sys.exit() instead of the removed error() function

parent 59559f74
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ lib = os.path.basename(cwd)
# reset EXTRAMAKE if requested

if not os.path.exists("Makefile.%s" % machine):
  error("lib/%s/Makefile.%s does not exist" % (lib,machine))
  sys.exit("lib/%s/Makefile.%s does not exist" % (lib,machine))

lines = open("Makefile.%s" % machine,'r').readlines()
fp = open("Makefile.auto",'w')
@@ -82,7 +82,7 @@ except subprocess.CalledProcessError as e:
  sys.exit(1)

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))
else: sys.exit("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))

if has_extramake and not os.path.exists("Makefile.lammps"):
  print("WARNING: lib/%s/Makefile.lammps was NOT created" % lib)
+3 −3
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ if args.output:
# reset EXTRAMAKE, CUDA_HOME, CUDA_ARCH, CUDA_PRECISION if requested

if not os.path.exists("Makefile.%s" % isuffix):
  error("lib/gpu/Makefile.%s does not exist" % isuffix)
  sys.exit("lib/gpu/Makefile.%s does not exist" % isuffix)

lines = open("Makefile.%s" % isuffix,'r').readlines()
fp = open("Makefile.auto",'w')
@@ -129,9 +129,9 @@ if makeflag:
    sys.exit(1)

  if not os.path.exists("libgpu.a"):
    error("Build of lib/gpu/libgpu.a was NOT successful")
    sys.exit("Build of lib/gpu/libgpu.a was NOT successful")
  if not os.path.exists("Makefile.lammps"):
    error("lib/gpu/Makefile.lammps was NOT created")
    sys.exit("lib/gpu/Makefile.lammps was NOT created")

# copy new Makefile.auto to Makefile.osuffix

+4 −3
Original line number Diff line number Diff line
@@ -73,8 +73,9 @@ homepath = fullpath('.')
homedir = "%s/%s" % (homepath,tardir)

if (pathflag):
    if not os.path.isdir(mscgpath): error("MS-CG path does not exist")
    homedir = mscgpath
    if not os.path.isdir(mscgpath):
      sys.exit("MS-CG path %s does not exist" % mscgpath)
    homedir = fullpath(mscgpath)

# download and unpack MS-CG tarfile

@@ -104,7 +105,7 @@ if buildflag:
    cmd = 'cd "%s/src"; cp ../../Makefile.%s .; make -f Makefile.%s' % \
        (homedir,msuffix,msuffix)
  else:
    error("Cannot find Makefile.%s" % msuffix)
    sys.exit("Cannot find Makefile.%s" % msuffix)
  try:
    txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
    print(txt.decode('UTF-8'))
+5 −4
Original line number Diff line number Diff line
@@ -68,8 +68,9 @@ homepath = fullpath('.')
homedir = "%s/plumed2" % (homepath)

if (pathflag):
    if not os.path.isdir(plumedpath): error("Plumed2 path does not exist")
    homedir = plumedpath
    if not os.path.isdir(plumedpath):
      sys.exit("Plumed2 path %s does not exist" % plumedpath)
    homedir = fullpath(plumedpath)

# download and unpack plumed2 tarball

@@ -82,7 +83,7 @@ if buildflag:
  # verify downloaded archive integrity via md5 checksum, if known.
  if version in checksums:
    if not checkmd5sum(checksums[version],filename):
      error("Checksum for plumed2 library does not match")
      sys.exit("Checksum for plumed2 library does not match")

  print("Unpacking plumed2 source tarball ...")
  if os.path.exists("%s/plumed-%s" % (homepath,version)):
+2 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ homepath = fullpath(".")
homedir = "%s/%s" % (homepath,version)

if (pathflag):
    if not os.path.isdir(voropath): error("Voro++ path does not exist")
    if not os.path.isdir(voropath):
      sys.exit("Voro++ path %s does not exist" % voropath)
    homedir = voropath

# download and unpack Voro++ tarball