Skip to content

Commit

Permalink
adding fesom2 and t-hysea
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Ejarque committed Dec 22, 2022
1 parent 5a2202c commit 09d08da
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 3 deletions.
69 changes: 69 additions & 0 deletions packages/fesom2/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# ----------------------------------------------------------------------------
# If you submit this package back to Spack as a pull request,
# please first remove this boilerplate and all FIXME comments.
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install fesom2
#
# You can edit this file again by typing:
#
# spack edit fesom2
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------

from spack import *


class Fesom2(CMakePackage):
"""FIXME: Put a proper description of your package here."""

# FIXME: Add a proper url for your package's homepage here.
homepage = "https://www.example.com"
url = "https://github.com/FESOM/fesom2/archive/refs/tags/2.1.1.tar.gz"
git = "https://github.com/FESOM/fesom2.git"
# FIXME: Add a list of GitHub accounts to
# notify when the package is updated.
# maintainers = ['github_user1', 'github_user2']
version('eflows4hpc', branch='eflows4hpc_hecuba_integration', submodules=True)
version('2.1.1', sha256='a4c9006489f9010be11ed30b8249efc63af8125d9214e94977e2dd16c75ecc38')
version('2.1.0', sha256='b46e8a22d160b0e34915f573f4ca1f9f08f5be121c3b814b15e0baa592490aa4')

# FIXME: Add dependencies if required.
depends_on('mpi')
depends_on('netcdf-fortran')
depends_on('blas')

variant('hecuba', default=False, description='Builds a MPI version of the library')
def setup_build_environment(self, env):
env.set('CC', self.spec['mpi'].mpicc)
env.set('FC',self.spec['mpi'].mpifc)
env.set('CXX', self.spec['mpi'].mpicxx)
env.set('F77', self.spec['mpi'].mpif77)

@run_after('install')
def copy_fesom(self):
#print("***** Calling super install ****")
#super().install(spec, prefix)
print("***** Coping fesom binary to bin ****")
mkdirp(self.prefix.bin)
install(self.stage.source_path+'/bin/fesom.x', self.prefix.bin)

def cmake_args(self):
# FIXME: Add arguments other than
# FIXME: CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE
# FIXME: If not needed delete this function
args = []
if self.spec.variants['hecuba'].value == True:
args.append('-DUSE_HECUBA=ON')
else:
args.append('-DUSE_HECUBA=OFF')
return args
Binary file removed packages/kratos/__pycache__/package.cpython-36.pyc
Binary file not shown.
10 changes: 7 additions & 3 deletions packages/kratos/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ class Kratos(CMakePackage):

# FIXME: Add a proper url for your package's homepage here.
homepage = "https://www.cimne.com/kratos/"
url = "https://github.com/KratosMultiphysics/Kratos/archive/refs/tags/v9.1.tar.gz"
url = "https://github.com/KratosMultiphysics/Kratos/archive/refs/tags/v9.1.4.tar.gz"

# FIXME: Add a list of GitHub accounts to
# notify when the package is updated.
# maintainers = ['github_user1', 'github_user2']

version('9.1', sha256='2a2415089ffefb288b61e7d9f8dab55564c7b84498c8edfa5677560c90c97b64')
version('9.1.4', sha256='efe255921b279bc866af2311a6da96c3d11c4f5c3d11ddbe3f2d2751178bd81f')

# FIXME: Add dependencies if required.
depends_on('boost')
Expand All @@ -47,11 +48,14 @@ class Kratos(CMakePackage):
variant('mmg', default=False, description='Builds a MMG version of the library')
depends_on('mmg', when='+mmg')
variant('apps', default='none', multi=True, description='Builds apps version of the library')


def url_for_version(self, version):
url = "https://github.com/KratosMultiphysics/Kratos/archive/refs/tags/v{0}.tar.gz"
return url.format(version)

def setup_build_environment(self, env):
apps = self.spec.variants['apps'].value
if apps != 'none':
print("***** APPS: " + str(apps) + "env: " + str(self))
kratos_apps=""
applications_path=os.path.join(self.stage.source_path, "applications")
for app in apps:
Expand Down
Binary file removed packages/py-dislib/__pycache__/package.cpython-36.pyc
Binary file not shown.
65 changes: 65 additions & 0 deletions packages/t-hysea/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# ----------------------------------------------------------------------------
# If you submit this package back to Spack as a pull request,
# please first remove this boilerplate and all FIXME comments.
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install t-hysea
#
# You can edit this file again by typing:
#
# spack edit t-hysea
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------

from spack import *
import os

class THysea(CMakePackage):
"""FIXME: Put a proper description of your package here."""

# FIXME: Add a proper url for your package's homepage here.
homepage = "https://www.example.com"
#url = "file:///t-hysea"
manual_download = True
root_cmakelists_dir = 'src_3.9.0_MC'
# FIXME: Add a list of GitHub accounts to
# notify when the package is updated.
# maintainers = ['github_user1', 'github_user2']

# FIXME: Add proper versions here.
version('3.9.0', sha256='c6399c9ee1a6cd87c71bcb4d0bcdb3501ffe3e55c7ff0de7b16094ca8ce34faa')

# FIXME: Add dependencies if required.
depends_on('cuda')
depends_on('mpi')
depends_on('netcdf-c')

def url_for_version(self, version):
return "file://{0}/T-HySEA_{1}.tar.xz".format(
os.getcwd(), version)

def cmake_args(self):
# FIXME: Add arguments other than
# FIXME: CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE
# FIXME: If not needed delete this function
args = []
args.extend([self.define("CMAKE_MODULE_PATH", self.stage.source_path)])
#args.extend([self.define("NetCDF_DIR", self.spec['netcdf-c'].prefix)])
return args

def install(self, spec, prefix):
#print("***** Calling super install ****")
#super().install(spec, prefix)
print("***** Coping TsunamiHySEA binary to bin ****")
mkdirp(self.prefix.bin)
install(self.build_directory + '/TsunamiHySEA', self.prefix.bin)

0 comments on commit 09d08da

Please sign in to comment.