diff --git a/spack_repo/packages/dwd-icon-tools/package.py b/spack_repo/packages/dwd-icon-tools/package.py index b24c29b2ef64ab67fcc286cbf265bb92a65677c1..202f6793ab2f253f3a723c9436bfcbaacc32c05a 100644 --- a/spack_repo/packages/dwd-icon-tools/package.py +++ b/spack_repo/packages/dwd-icon-tools/package.py @@ -21,7 +21,6 @@ # ---------------------------------------------------------------------------- from spack.package import * -from pathlib import Path import os from urllib.parse import urlparse @@ -48,57 +47,34 @@ class DwdIconTools(Package): depends_on("netcdf-fortran") depends_on("eccodes") depends_on("libxml2") - # - # def patch(self): - # """ - # Because of the lack of access rights to the original submodule repositories, - # we patch the gitmodules file to point to a different mirror. - # """ - # git_submodules_file = Path().cwd() / ".gitmodules" - # git_mirror = "git@gitlab.lrz.de:dkrz-mirror" - # git_modules_patch = f""" - # [submodule "externals/libcdi"] - # path = externals/libcdi - # url = {git_mirror}/libcdi.git - # """ - # - # # Replace the content of the original file with the patch - # with git_submodules_file.open("w") as out_f: - # out_f.write(git_modules_patch) - # - # # Run git submodule update - # git = which("git") - # git("submodule", "update", "--init", "--recursive") + # + @staticmethod + def init_submodules(): + # Run git submodule update + git = which("git") + git("submodule", "update", "--init", "--recursive") def setup_build_environment(self, env): spec = self.spec # Some environment variables to set env_variables_to_set = { -# "CC": spec["mpi"].mpicc, -# "FC": spec["mpi"].mpifc, -# "F77": spec["mpi"].mpif77, "CXXFLAGS": "-O2 -g -fopenmp -Wunused -DNOMPI", "FCFLAGS": "-I/usr/include --std=f2008 -O2 -g -cpp -fopenmp -fbounds-check -Wunused -DNOMPI", - "LIBS": f"-L{spec['libxml2'].prefix.lib} -L{spec['netcdf-c'].prefix.lib} -lnetcdf -L{spec['netcdf-fortran'].prefix.lib} -lnetcdff -leccodes -lgfortran -lhdf5 -lxml2", + "LIBS": f"-leccodes -lgfortran -lhdf5 -lxml2", } - - for variable, value in env_variables_to_set.items(): - env.set(variable, value) - - + env.set(variable, value) def install(self, spec, prefix): options = [ f"--prefix={prefix}", "--enable-grib2", "--enable-iso-c-interface", - f"--with-netcdf={spec['netcdf-c'].prefix}", - "LIBS": f"-L{spec['libxml2'].prefix.lib} -leccodes -lgfortran -lhdf5 -lxml2", + f"--with-netcdf={spec['netcdf-c'].prefix}" ] + self.init_submodules() configure(*options) make() make("install") -