def make(self): """ Build with make and correct make options """ for envvar in ["MPICC", "LIBLAPACK_MT", "CPPFLAGS", "LDFLAGS", "CFLAGS"]: if not os.getenv(envvar): self.log.error("Required environment variable %s not found (no toolkit used?)." % envvar) # build dir extra_makeopts = 'TOPdir="%s" ' % self.getcfg("startfrom") # compilers extra_makeopts += 'CC="%(mpicc)s" MPICC="%(mpicc)s" LINKER="%(mpicc)s" ' % {"mpicc": os.getenv("MPICC")} # libraries: LAPACK and FFTW extra_makeopts += 'LAlib="%s %s" ' % (os.getenv("LIBFFT"), os.getenv("LIBLAPACK_MT")) # HPL options extra_makeopts += 'HPL_OPTS="%s -DUSING_FFTW" ' % os.getenv("CPPFLAGS") # linker flags extra_makeopts += 'LINKFLAGS="%s" ' % os.getenv("LDFLAGS") # C compilers flags extra_makeopts += "CCFLAGS='$(HPL_DEFS) %s' " % os.getenv("CFLAGS") # set options and build self.updatecfg("makeopts", extra_makeopts) Application.make(self)
def sanitycheck(self): """Custom sanity check for OpenFOAM""" if not self.getcfg('sanityCheckPaths'): odir = "%s-%s" % (self.name(), self.version()) psubdir = "linux64%sDPOpt" % self.wm_compiler if LooseVersion(self.version()) < LooseVersion("2"): toolsdir = os.path.join(odir, "applications", "bin", psubdir) else: toolsdir = os.path.join(odir, "platforms", psubdir, "bin") pdirs = [] if LooseVersion(self.version()) >= LooseVersion("2"): pdirs = [toolsdir, os.path.join(odir, "platforms", psubdir, "lib")] # some randomly selected binaries # if one of these is missing, it's very likely something went wrong bins = [os.path.join(odir, "bin", x) for x in []] + \ [os.path.join(toolsdir, "buoyant%sSimpleFoam" % x) for x in ["", "Boussinesq"]] + \ [os.path.join(toolsdir, "%sFoam" % x) for x in ["bubble", "engine", "sonic"]] + \ [os.path.join(toolsdir, "surface%s" % x) for x in ["Add", "Find", "Smooth"]] + \ [os.path.join(toolsdir, x) for x in ["deformedGeom", "engineSwirl", "modifyMesh", "refineMesh", "vorticity"]] self.setcfg('sanityCheckPaths',{'files':["%s/etc/%s" % (odir, x) for x in ["bashrc", "cshrc"]] + bins, 'dirs':pdirs }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def sanitycheck(self): """ Custom sanity check for HDF5 """ if not self.getcfg('sanityCheckPaths'): if self.toolkit().opts['usempi']: extra_binaries = ["bin/%s" % x for x in ["h5perf", "h5pcc", "h5pfc", "ph5diff"]] else: extra_binaries = ["bin/%s" % x for x in ["h5cc", "h5fc"]] self.setcfg('sanityCheckPaths',{ 'files': ["bin/h5%s" % x for x in ["2gif", "c++", "copy", "debug", "diff", "dump", "import", "jam","ls", "mkgrp", "perf_serial", "redeploy", "repack", "repart", "stat", "unjam"]] + ["bin/gif2h5"] + extra_binaries + ["lib/libhdf5%s.so" % x for x in ["_cpp", "_fortran", "_hl_cpp", "_hl", "hl_fortran", ""]], 'dirs': ['include'] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def configure(self): """Configure build: <single-line description how this deviates from standard configure>""" # set generic make options self.updatecfg('makeopts', 'CC="%s" OPTFLAGS="%s"' % (os.getenv('MPICC'), os.getenv('CFLAGS'))) if LooseVersion(self.version()) >= LooseVersion("3.2"): # set correct startfrom dir, and change into it self.setcfg('startfrom', os.path.join(self.getcfg('startfrom'),'src')) try: os.chdir(self.getcfg('startfrom')) except OSError, err: self.log.error("Failed to change to correct source dir %s: %s" % (self.getcfg('startfrom'), err)) # run autoconf to generate configure script cmd = "autoconf" run_cmd(cmd) # set config opts beagle = get_software_root('BEAGLE') if beagle: self.updatecfg('configopts', '--with-beagle=%s' % beagle) else: self.log.error("BEAGLE module not loaded?") if self.toolkit().opts['usempi']: self.updatecfg('configopts', '--enable-mpi') # configure Application.configure(self)
def configure(self): """Configure build: set require config and make options, and run configure script.""" # configure options deps = ["Szip", "zlib"] for dep in deps: root = get_software_root(dep) if root: self.updatecfg('configopts', '--with-%s=%s' % (dep.lower(), root)) else: self.log.error("Dependency module %s not loaded." % dep) fcomp = 'FC="%s"' % os.getenv('F77') self.updatecfg('configopts', "--with-pic --with-pthread --enable-shared") self.updatecfg('configopts', "--enable-cxx --enable-fortran %s" % fcomp) # MPI and C++ support enabled requires --enable-unsupported, because this is untested by HDF5 if self.toolkit().opts['usempi']: self.updatecfg('configopts', "--enable-unsupported") # make options self.updatecfg('makeopts', fcomp) Application.configure(self)
def __init__(self,*args,**kwargs): """Add extra config options specific to WRF.""" Application.__init__(self, *args, **kwargs) self.build_in_installdir = True self.wrfsubdir = None self.comp_fam = None
def sanitycheck(self): """Custom sanity check for g2clib.""" if not self.getcfg("sanityCheckPaths"): self.setcfg("sanityCheckPaths", {"files": ["lib/libgrib2c.a"], "dirs": ["include"]}) Application.sanitycheck(self)
def sanitycheck(self): """ Custom sanity check for netCDF """ if not self.getcfg('sanityCheckPaths'): incs = ["netcdf.h"] libs = ["libnetcdf.so", "libnetcdf.a"] # since v4.2, the non-C libraries have been split off in seperate packages # see netCDF-Fortran and netCDF-C++ if LooseVersion(self.version()) < LooseVersion("4.2"): incs += ["netcdf%s" % x for x in ["cpp.h", ".hh", ".inc", ".mod"]] + \ ["ncvalues.h", "typesizes.mod"] libs += ["libnetcdf_c++.so", "libnetcdff.so", "libnetcdf_c++.a", "libnetcdff.a"] self.setcfg('sanityCheckPaths',{ 'files': ["bin/nc%s" % x for x in ["-config", "copy", "dump", "gen", "gen3"]] + ["lib/%s" % x for x in libs] + ["include/%s" % x for x in incs], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def __init__(self,*args,**kwargs): """Specify building in install dir, initialize custom variables.""" Application.__init__(self, *args, **kwargs) self.build_in_installdir = True self.fsldir = None
def setparallelism(self, nr=None): """ Parallel build of ATLAS doesn't make sense (and doesn't work), because it collects timing etc., so disable it. """ if not nr: self.log.warning("Ignoring requested parallelism, it breaks ATLAS, so setting to 1") self.log.info("Disabling parallel build, makes no sense for ATLAS.") Application.setparallelism(self, 1)
def cleanup(self): """Cleanup leftover mess - clean home dir - generic cleanup (get rid of build dir) """ self.clean_homedir() Application.cleanup(self)
def sanitycheck(self): """Custom sanity check for g2lib.""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths', { 'files': ["lib/libg2.a"], 'dirs': [] }) Application.sanitycheck(self)
def make(self): """ Only build when we're not testing. """ if self.getcfg('test_only'): return else: # default make suffices (for now) Application.make(self)
def sanitycheck(self): """ Custom sanity check for HPL """ if not self.getcfg("sanityCheckPaths"): self.setcfg("sanityCheckPaths", {"files": ["bin/xhpl"], "dirs": []}) self.log.info("Customized sanity check paths: %s" % self.getcfg("sanityCheckPaths")) Application.sanitycheck(self)
def __init__(self,*args,**kwargs): """Specify that OpenFOAM should be built in install dir.""" Application.__init__(self, *args, **kwargs) self.build_in_installdir = True self.wm_compiler= None self.wm_mplib = None self.mpipath = None self.thrdpartydir = None
def configure(self): # things might go wrong if a previous install dir is present, so let's get rid of it if not self.getcfg('keeppreviousinstall'): self.log.info("Making sure any old installation is removed before we start the build...") Application.make_dir(self, self.installdir, True, dontcreateinstalldir=True) # additional configuration options add_configopts = '--with-rdma=%s ' % self.getcfg('rdma_type') # use POSIX threads add_configopts += '--with-thread-package=pthreads ' if self.getcfg('debug'): # debug build, with error checking, timing and debug info # note: this will affact performance add_configopts += '--enable-fast=none ' else: # optimized build, no error checking, timing or debug info add_configopts += '--enable-fast ' # enable shared libraries, using GCC and GNU ld options add_configopts += '--enable-shared --enable-sharedlibs=gcc ' # enable Fortran 77/90 and C++ bindings add_configopts += '--enable-f77 --enable-fc --enable-cxx ' # MVAPICH configure script complains when F90 or F90FLAGS are set, # they should be replaced with FC/FCFLAGS instead for (envvar, new_envvar) in [("F90", "FC"), ("F90FLAGS", "FCFLAGS")]: envvar_val = os.getenv(envvar) if envvar_val: if not os.getenv(new_envvar): env.set(new_envvar, envvar_val) env.set(envvar, '') else: self.log.error("Both %(ev)s and %(nev)s set, can I overwrite %(nev)s with %(ev)s (%(evv)s) ?" % { 'ev': envvar, 'nev': new_envvar, 'evv': envvar_val }) # enable specific support options (if desired) if self.getcfg('withmpe'): add_configopts += '--enable-mpe ' if self.getcfg('withlimic2'): add_configopts += '--enable-limic2 ' if self.getcfg('withchkpt'): add_configopts += '--enable-checkpointing --with-hydra-ckpointlib=blcr ' self.updatecfg('configopts', add_configopts) Application.configure(self)
def make(self): """Build by supplying required make options, and running make.""" jasper = get_software_root('JASPER') if not jasper: self.log.error("JasPer module not loaded?") makeopts = 'CC="%s" FC="%s" INCDIR="-I%s/include"' % (os.getenv('CC'), os.getenv('F90'), jasper) self.updatecfg('makeopts', makeopts) Application.make(self)
def sanitycheck(self): """Custom sanity check for ScaLAPACK.""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths',{ 'files': ["lib/libscalapack.a"], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def make_install(self): """Extend make install to make sure that the 'python' command is present.""" Application.make_install(self) python_binary_path = os.path.join(self.installdir, 'bin', 'python') if not os.path.isfile(python_binary_path): pythonver = '.'.join(self.version().split('.')[0:2]) srcbin = "%s%s" % (python_binary_path, pythonver) try: os.symlink(srcbin, python_binary_path) except OSError, err: self.log.error("Failed to symlink %s to %s: %s" % err)
def sanitycheck(self): """Custom sanity check for MrBayes.""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths', { 'files': ["bin/mb"], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def make(self): """Build by supplying required make options, and running make.""" jasper = get_software_root("JASPER") if not jasper: self.log.error("JasPer module not loaded?") # beware: g2clib uses INC, while g2lib uses INCDIR ! makeopts = 'CC="%s" FC="%s" INC="-I%s/include"' % (os.getenv("CC"), os.getenv("F90"), jasper) self.updatecfg("makeopts", makeopts) Application.make(self)
def sanitycheck(self): """Custom sanity check for libsmm""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths', { 'files': ["lib/libsmm_%s.a" % x for x in ["dnn", "znn"]], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def sanitycheck(self): """Custom sanity check for FSL""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths', {'files':[], 'dirs':["fsl/%s" % x for x in ["bin", "data", "etc", "extras", "include", "lib"]] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def configure(self): """Configure build: set config options and configure""" if self.toolkit().opts['pic']: self.updatecfg('configopts', "--with-pic") self.updatecfg('configopts', 'FCFLAGS="%s" FC="%s"' % (os.getenv('FFLAGS'), os.getenv('F90'))) # add -DgFortran to CPPFLAGS when building with GCC if self.toolkit().comp_family() == toolkit.GCC: env.set('CPPFLAGS', "%s -DgFortran" % os.getenv('CPPFLAGS')) Application.configure(self)
def sanitycheck(self): """ Custom sanity check for LAPACK (only run when not testing) """ if not self.getcfg('test_only'): if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths',{ 'files': ["lib/%s" % x for x in ["liblapack.a", "libtmglib.a"]], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def sanitycheck(self): """Custom sanity check for WPS.""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths', { 'files': ["WPS/%s" % x for x in ["geogrid.exe", "metgrid.exe", "ungrib.exe"]], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def sanitycheck(self): """Custom sanity check for BLACS.""" if not self.getcfg('sanityCheckPaths'): self.setcfg('sanityCheckPaths',{ 'files': [fil for filptrn in ["blacs", "blacsCinit", "blacsF77init"] for fil in ["lib/lib%s.a" % filptrn, "lib/%s_MPI-LINUX-0.a" % filptrn]] + ["bin/xintface"], 'dirs': [] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def make_install(self): """Install step Default make install and optionally remove incomplete lapack libs. If the full_lapack option was set to false we don't """ Application.make_install(self) if not self.getcfg('full_lapack'): for i in ['liblapack.a', 'liblapack.so']: lib = os.path.join(self.installdir, "lib", i[0]) if os.path.exists(lib): os.rename(lib, os.path.join(self.installdir, "lib", lib.replace("liblapack", "liblapack_atlas"))) else: self.log.warning("Tried to remove %s, but file didn't exist")
def sanitycheck(self): """Custom sanity check for CP2K""" if not self.getcfg('sanityCheckPaths'): cp2k_type = self.getcfg('type') self.setcfg('sanityCheckPaths',{ 'files': ["bin/%s.%s" % (x, cp2k_type) for x in ["cp2k", "cp2k_shell", "fes"]], 'dirs': ["tests"] }) self.log.info("Customized sanity check paths: %s" % self.getcfg('sanityCheckPaths')) Application.sanitycheck(self)
def extra_options(): extra_vars = { 'ignorethrottling': [False, "Ignore check done by ATLAS for CPU throttling (not recommended) (default: False)"], 'full_lapack': [False, "Build a full LAPACK library (requires netlib's LAPACK) (default: False)"], 'sharedlibs': [False, "Enable building of shared libs as well (default: False)"] } return Application.extra_options(extra_vars)