Skip to content

Instantly share code, notes, and snippets.

@migueldiascosta
Last active March 27, 2017 10:22
Show Gist options
  • Save migueldiascosta/0fbe52345abe7d59eb62a0cbab909264 to your computer and use it in GitHub Desktop.
Save migueldiascosta/0fbe52345abe7d59eb62a0cbab909264 to your computer and use it in GitHub Desktop.
--- siesta.py.ake 2017-03-26 14:20:45.916387226 +0800
+++ siesta.py 2017-03-27 18:21:40.186696130 +0800
@@ -124,7 +124,7 @@
# ScaLAPACK (and BLACS)
self.cfg.update('configopts', '--with-scalapack="%s"' % scalapack)
- self.cfg.update('configopts', '--with-blacs="$%s"' % blacs)
+ self.cfg.update('configopts', '--with-blacs="%s"' % blacs)
# NetCDF-Fortran
if netcdff_loc:
@@ -132,6 +132,21 @@
super(EB_Siesta, self).configure_step(cmd_prefix='../Src/')
+ # make sure suffixes are after include
+ suffixes = ".f .f90 .F .F90 .c .o .a"
+ regex_subSUFFIXES = [
+ (r"^(\.SUFFIXES:\s*.+)$", ""),
+ (r"^(include.*)$", r"\1\n.SUFFIXES: %s" % suffixes)
+ ]
+
+ apply_regex_substitutions(os.path.join(start_dir, 'Util', 'Sockets', 'Makefile'),
+ regex_subSUFFIXES)
+ apply_regex_substitutions(os.path.join(start_dir, 'Util', 'SiestaSubroutine', 'SimpleTest', 'Src', 'Makefile'),
+ regex_subSUFFIXES)
+
+ if self.version == "4.0-b1" or self.version == "4.0-b2":
+ apply_regex_substitutions(os.path.join(obj_dir, 'Makefile'), [(r"\$\(CFLAGS\)\-c", "$(CFLAGS) -c")])
+
else: # there's no configure on newer versions
if self.toolchain.comp_family() in [toolchain.INTELCOMP]:
@@ -160,7 +175,7 @@
if netcdff_loc:
regex_subs.extend([
- (r"^(COMP_LIBS\s*=.*)$", r"\1\nNETCDF_LIBS = -lnetcdff"),
+ (r"^(WXML\s*=.*)$", r"\1\nNETCDF_LIBS = -lnetcdff"),
(r"^(LIBS\s*=.*)$", r"\1 $(NETCDF_LIBS)"),
(r"^(FPPFLAGS\s*=.*)$", r"\1 -DCDF"),
])
@@ -184,7 +199,7 @@
adjust_permissions('./clean_all.sh', stat.S_IXUSR, recursive=False, relative=True)
run_cmd('./clean_all.sh', log_all=True, simple=True, log_output=True)
- if LooseVersion(self.version) >= LooseVersion("4.0"):
+ if LooseVersion(self.version) >= LooseVersion("4.1"):
regex_subs_TS = [
(r"^default:.*$", r""),
(r"^EXE\s*=.*$", r""),
@@ -194,12 +209,22 @@
apply_regex_substitutions(os.path.join(self.cfg['start_dir'], 'Util', 'TS', 'tshs2tshs', 'Makefile'), regex_subs_TS)
+ regex_subs_UtilFPP = [(r"^(CPP\s*=\s*)\$\(FC\)(.*)$", r"\1 cpp \2")]
+ apply_regex_substitutions(os.path.join(self.cfg['start_dir'], 'Src', 'fdict', 'Makefile'), regex_subs_UtilFPP)
+
regex_subs_UtilLDFLAGS = [
(r'(\$\(FC\)\s*-o\s)', r'$(FC) %s %s -o ' % (os.environ['FCFLAGS'], os.environ['LDFLAGS'])),
]
apply_regex_substitutions(os.path.join(self.cfg['start_dir'], 'Util', 'Optimizer', 'Makefile'), regex_subs_UtilLDFLAGS)
apply_regex_substitutions(os.path.join(self.cfg['start_dir'], 'Util', 'JobList', 'Src', 'Makefile'), regex_subs_UtilLDFLAGS)
+ regex_subs_UtilFFT = [
+ (r"^(FFTW_ROOT.*=\s*).*$", r"\1%s" % os.path.split(os.environ['FFTW_LIB_DIR'])[0]),
+ (r"^(FFTW_LIBS.*=\s*).*$", r"\1%s" % os.environ['LIBFFT']),
+ ]
+
+ apply_regex_substitutions(os.path.join(self.cfg['start_dir'], 'Util', 'STM', 'ol-stm', 'Src', 'Makefile'), regex_subs_UtilFFT)
+
run_cmd('./build_all.sh', log_all=True, simple=True, log_output=True)
# Now move all the built utils to the temp installdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment