must set suffix variable only when suffixflag is true

This commit is contained in:
Axel Kohlmeyer
2022-06-13 17:47:20 -04:00
parent 33f4bb525b
commit c53e53d701

View File

@ -71,7 +71,8 @@ buildflag = args.build
pathflag = args.path is not None pathflag = args.path is not None
version = args.version version = args.version
suffixflag = args.machine is not None suffixflag = args.machine is not None
suffix = args.machine if suffixflag:
suffix = args.machine
if pathflag: if pathflag:
lattedir = args.path lattedir = args.path
@ -132,8 +133,6 @@ os.symlink(os.path.join(lattedir, 'src', 'latte_c_bind.o'), 'filelink.o')
# copy Makefile.lammps.suffix to Makefile.lammps # copy Makefile.lammps.suffix to Makefile.lammps
if suffixflag or not os.path.exists("Makefile.lammps"): if suffixflag or not os.path.exists("Makefile.lammps"):
if suffix is None:
suffix = 'gfortran'
print("Creating Makefile.lammps") print("Creating Makefile.lammps")
if os.path.exists("Makefile.lammps.%s" % suffix): if os.path.exists("Makefile.lammps.%s" % suffix):
shutil.copyfile("Makefile.lammps.%s" % suffix, 'Makefile.lammps') shutil.copyfile("Makefile.lammps.%s" % suffix, 'Makefile.lammps')