def egg(): if not os.path.exists("PyFoam-{}.tar.gz".format(VERSION)): common.run("wget https://openfoamwiki.net/images/3/3b/PyFoam-"+VERSION+".tar.gz --no-check-certificate") common.run("tar -xzf PyFoam-"+VERSION+".tar.gz") shutil.copy( os.path.join("files", "setup.py"), os.path.join(clone_dir, "setup.py") ) with common.cd(clone_dir): common.local_repo_to_edm_egg(".", name=NAME, version=VERSION, build=BUILD)
def upload_egg(): egg_path = "endist/{NAME}-{VERSION}-{BUILD}.egg".format( NAME=NAME, VERSION=VERSION, BUILD=BUILD) click.echo("Uploading {} to EDM repo".format(egg_path)) common.upload_egg(egg_path) with common.cd("openfoam-interface/internal-interface/wrapper"): try: common.run("python edmsetup.py upload_egg") except subprocess.CalledProcessError as e: print("Error during egg upload of submodule: {}. Continuing.".format(e)) click.echo("Done")
def egg(): try: shutil.rmtree("build") except OSError: pass os.makedirs("build/usr/bin") os.makedirs("build/python") if not os.path.exists(clone_dir): common.run("git clone --branch r" + VERSION + " http://git.lammps.org/lammps-ro.git " + clone_dir) common.run( "git clone --branch " + LIGGGHTS_VERSION + " --depth 1 git://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git " + os.path.join(clone_dir, "myliggghts")) shutil.copy( "files/Makefile.centos6", os.path.join(clone_dir, "src", "MAKE", "MACHINES", "Makefile.centos6")) shutil.copy( "files/Makefile.centos6", os.path.join(clone_dir, "myliggghts", "src", "MAKE", "Makefile.centos6")) # Build lammps executable common.run("make -C " + os.path.join(clone_dir, "src") + " centos6 -j 3") shutil.copy(os.path.join(clone_dir, "src", "lmp_centos6"), "build/usr/bin/lammps") # Build the shared library common.run("make -C " + os.path.join(clone_dir, "src") + " centos6 -j 3 mode=shlib") current_dir = os.getcwd() with common.cd(os.path.join(clone_dir, "python")): common.edmenv_run("python install.py " + os.path.join(current_dir, "build", "python")) # Build liggghts common.run("make -C " + os.path.join(clone_dir, "myliggghts", "src") + " centos6 -j 3") shutil.copy(os.path.join(clone_dir, "myliggghts", "src", "lmp_centos6"), "build/usr/bin/liggghts") common.local_repo_to_edm_egg(".", name=NAME, version=VERSION, build=BUILD)
def egg(): write_endist_dat() common.edmenv_run("python setup.py bdist_egg") try: os.makedirs("endist") except OSError: pass common.run("edm repack-egg -b {build} -a rh6-x86_64 dist/{name}-{version}-py2.7-linux-x86_64.egg".format( name=NAME, version=VERSION, build=BUILD)) edm_egg_filename = "{name}-{version}-{build}.egg".format( name=NAME, version=VERSION, build=BUILD) shutil.move( os.path.join("dist", edm_egg_filename), os.path.join("endist", edm_egg_filename) ) return os.path.join("endist", edm_egg_filename)
def egg(): write_endist_dat() common.edmenv_run("python setup.py bdist_egg") try: os.makedirs("endist") except OSError: pass common.run( "edm repack-egg -b {build} -a rh6-x86_64 dist/{name}-{version}-py2.7-linux-x86_64.egg" .format(name=NAME, version=VERSION, build=BUILD)) edm_egg_filename = "{name}-{version}-{build}.egg".format(name=NAME, version=VERSION, build=BUILD) shutil.move(os.path.join("dist", edm_egg_filename), os.path.join("endist", edm_egg_filename)) return os.path.join("endist", edm_egg_filename)
def egg(): common.local_repo_to_edm_egg(".", name=NAME, version=VERSION, build=BUILD) with common.cd("openfoam-interface/internal-interface/wrapper"): common.run("python edmsetup.py egg")