Skip to content
Snippets Groups Projects
Commit dbf98fc2 authored by Oriol Tintó Prims's avatar Oriol Tintó Prims
Browse files

Fix blas dependency

parent 9d5dddb7
No related branches found
No related tags found
1 merge request!4Switching to the advanced configuration method and fixing spack build.
......@@ -3,9 +3,10 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
from pathlib import Path
from spack.package import *
class IconNwp(Package):
"""
......@@ -14,7 +15,7 @@ class IconNwp(Package):
homepage = "https://code.mpimet.mpg.de/projects/iconpublic"
# maintainers("oriol.tinto")
# Main repository (pointing to LMU's gitlab)
git = "ssh://git@gitlab.physik.uni-muenchen.de/w2w/icon.git"
......@@ -27,7 +28,6 @@ class IconNwp(Package):
version("master", branch="master")
version("psp", branch="icon-nwp/icon-nwp-psp")
# Dependencies
depends_on("mpi")
depends_on("netcdf-c")
......@@ -35,6 +35,10 @@ class IconNwp(Package):
depends_on("eccodes")
depends_on("libxml2")
# Openblas? best way of doing it?
depends_on("openblas", when="%gcc")
depends_on("intel-mkl", when="%intel")
# Extra dependencies for B6, including yaml, and the hdf5 filters for compression.
depends_on("libyaml", when="@w2w-B6")
depends_on("hdf5-blosc", when="@w2w-B6")
......@@ -129,7 +133,7 @@ class IconNwp(Package):
"F77": spec["mpi"].mpif77,
}
for variable, value in env_variables_to_set.items():
env.set(variable, value)
env.set(variable, value)
def configure(self, spec, prefix):
spec = self.spec
......@@ -138,11 +142,15 @@ class IconNwp(Package):
libs = [
f"-L{spec['netcdf-c'].prefix.lib} -lnetcdf ", # netcdf-c libs
f"-L{spec['netcdf-fortran'].prefix.lib} -lnetcdff", # netcdf-fortran libs
"-lopenblas", # OpenBlas
f"-L{spec['eccodes'].prefix.lib} -leccodes_f90 -leccodes",
f"-L{spec['libxml2'].prefix.lib} -lxml2", # XML2 libs
]
if self.spec.satisfies("%gcc"):
libs.append("-lopenblas")
elif self.spec.satisfies("%intel"):
libs.append("-qmkl=sequential")
if self.spec.version == Version("w2w-B6"):
libs.append("-lyaml")
......@@ -182,7 +190,6 @@ class IconNwp(Package):
env.set("ICON_DATA_PATH", self.spec.prefix.join("data"))
env.set("ICON_DOCS_PATH", self.spec.prefix.join("doc"))
def make_extra_folders(self, prefix):
mkdir = which("mkdir")
rsync = which("rsync")
......@@ -195,6 +202,7 @@ class IconNwp(Package):
rsync("-av", "data/", f"{prefix}/data")
rsync("-av", "run/", f"{prefix}/run")
rsync("-av", "--include='*.pdf'", "--exclude='*.*'", "doc/", f"{prefix}/doc/")
curl("https://code.mpimet.mpg.de/attachments/download/19568/ICON_tutorial_2019.pdf", "--output", f"{prefix}/doc/ICON_tutorial_2019.pdf")
curl("http://www.cosmo-model.org/content/model/documentation/core/emvorado_userguide.pdf", "--output", f"{prefix}/doc/emvorado_userguide.pdf")
curl("https://code.mpimet.mpg.de/attachments/download/19568/ICON_tutorial_2019.pdf", "--output",
f"{prefix}/doc/ICON_tutorial_2019.pdf")
curl("http://www.cosmo-model.org/content/model/documentation/core/emvorado_userguide.pdf", "--output",
f"{prefix}/doc/emvorado_userguide.pdf")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment