diff --git a/conda_package/ci/linux_64_python3.10.____cpython.yaml b/conda_package/ci/linux_64_python3.10.____cpython.yaml index c5a01eccd..11ce265e6 100644 --- a/conda_package/ci/linux_64_python3.10.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.10.____cpython.yaml @@ -11,13 +11,13 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '13' +- '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: diff --git a/conda_package/ci/linux_64_python3.11.____cpython.yaml b/conda_package/ci/linux_64_python3.11.____cpython.yaml index 5f3013292..4f411537b 100644 --- a/conda_package/ci/linux_64_python3.11.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.11.____cpython.yaml @@ -11,13 +11,13 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '13' +- '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: diff --git a/conda_package/ci/linux_64_python3.12.____cpython.yaml b/conda_package/ci/linux_64_python3.12.____cpython.yaml index 4738dda10..d93028a95 100644 --- a/conda_package/ci/linux_64_python3.12.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.12.____cpython.yaml @@ -11,13 +11,13 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '13' +- '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: diff --git a/conda_package/ci/linux_64_python3.13.____cpython.yaml b/conda_package/ci/linux_64_python3.13.____cpython.yaml index ef027c9f7..a3d36aae6 100644 --- a/conda_package/ci/linux_64_python3.13.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.13.____cpython.yaml @@ -11,13 +11,13 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '13' +- '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: diff --git a/conda_package/ci/linux_64_python3.9.____cpython.yaml b/conda_package/ci/linux_64_python3.9.____cpython.yaml index 8288041bb..ed8d7a414 100644 --- a/conda_package/ci/linux_64_python3.9.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.9.____cpython.yaml @@ -11,13 +11,13 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '13' +- '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: diff --git a/conda_package/ci/osx_64_python3.10.____cpython.yaml b/conda_package/ci/osx_64_python3.10.____cpython.yaml index a10d0af4a..f0e0e306a 100644 --- a/conda_package/ci/osx_64_python3.10.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.10.____cpython.yaml @@ -13,17 +13,17 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '18' +- '19' fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: - 4.9.2 llvm_openmp: -- '18' +- '19' macos_machine: - x86_64-apple-darwin13.4.0 netcdf_fortran: diff --git a/conda_package/ci/osx_64_python3.11.____cpython.yaml b/conda_package/ci/osx_64_python3.11.____cpython.yaml index 53fd73c4f..ccaa997f4 100644 --- a/conda_package/ci/osx_64_python3.11.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.11.____cpython.yaml @@ -13,17 +13,17 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '18' +- '19' fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: - 4.9.2 llvm_openmp: -- '18' +- '19' macos_machine: - x86_64-apple-darwin13.4.0 netcdf_fortran: diff --git a/conda_package/ci/osx_64_python3.12.____cpython.yaml b/conda_package/ci/osx_64_python3.12.____cpython.yaml index a3c13e58f..767aa4e5a 100644 --- a/conda_package/ci/osx_64_python3.12.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.12.____cpython.yaml @@ -13,17 +13,17 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '18' +- '19' fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: - 4.9.2 llvm_openmp: -- '18' +- '19' macos_machine: - x86_64-apple-darwin13.4.0 netcdf_fortran: diff --git a/conda_package/ci/osx_64_python3.13.____cpython.yaml b/conda_package/ci/osx_64_python3.13.____cpython.yaml index a63d13635..1fa8eb76d 100644 --- a/conda_package/ci/osx_64_python3.13.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.13.____cpython.yaml @@ -13,17 +13,17 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '18' +- '19' fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: - 4.9.2 llvm_openmp: -- '18' +- '19' macos_machine: - x86_64-apple-darwin13.4.0 netcdf_fortran: diff --git a/conda_package/ci/osx_64_python3.9.____cpython.yaml b/conda_package/ci/osx_64_python3.9.____cpython.yaml index d845ca340..ece171912 100644 --- a/conda_package/ci/osx_64_python3.9.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.9.____cpython.yaml @@ -13,17 +13,17 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '18' +- '19' fortran_compiler: - gfortran fortran_compiler_version: -- '13' +- '14' hdf5: - 1.14.6 libnetcdf: - 4.9.2 llvm_openmp: -- '18' +- '19' macos_machine: - x86_64-apple-darwin13.4.0 netcdf_fortran: diff --git a/conda_package/mpas_tools/mesh/creation/jigsaw_driver.py b/conda_package/mpas_tools/mesh/creation/jigsaw_driver.py index d73ed681d..86e02e732 100644 --- a/conda_package/mpas_tools/mesh/creation/jigsaw_driver.py +++ b/conda_package/mpas_tools/mesh/creation/jigsaw_driver.py @@ -1,9 +1,11 @@ import argparse import os import platform +import shutil import subprocess import time from importlib.resources import files as imp_res_files +from pathlib import Path import numpy @@ -142,15 +144,9 @@ def build_jigsaw(logger=None, clone=False, subdir='jigsaw-python', hash=None): conda_base = os.path.dirname(os.path.dirname(conda_exe)) conda_sh_path = os.path.join(conda_base, 'etc', 'profile.d', 'conda.sh') - conda_env_name = os.getenv('CONDA_DEFAULT_ENV') - if conda_env_name is None: - raise EnvironmentError( - 'The CONDA_DEFAULT_ENV environment variable is not defined. ' - 'Please ensure a conda environment is activated.' - ) activate_env = ( - f'source {conda_sh_path} && conda activate {conda_env_name} && ' + f'source {conda_sh_path} && conda activate {conda_env_path} && ' ) # remove conda jigsaw and jigsaw-python @@ -177,37 +173,52 @@ def build_jigsaw(logger=None, clone=False, subdir='jigsaw-python', hash=None): check_call(commands, logger=logger, executable='/bin/bash', shell=True) # add build tools to deployment env, not polaris env - jigsaw_build_deps = ( - 'cxx-compiler cmake make libnetcdf openmp setuptools numpy scipy' - ) + jigsaw_build_deps = 'cmake make libnetcdf setuptools numpy scipy' - conda_toolchain = ( - imp_res_files('mpas_tools.mesh.creation') / 'conda-toolchain.cmake' - ) if platform.system() == 'Linux': - jigsaw_build_deps = f'{jigsaw_build_deps} sysroot_linux-64=2.17' + jigsaw_build_deps = ( + f'{jigsaw_build_deps} sysroot_linux-64=2.17 gxx=14 openmp' + ) elif platform.system() == 'Darwin': jigsaw_build_deps = ( - f'{jigsaw_build_deps} macosx_deployment_target_osx-64=10.13' + f'{jigsaw_build_deps} ' + f'macosx_deployment_target_osx-64=10.13 ' + f'clangxx=19 ' + f'llvm-openmp=19' ) - cmake_args = ( - f'-DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={conda_toolchain}' - ) - print('Install dependencies\n') # Install dependencies commands = f'{activate_env}conda install -y {jigsaw_build_deps}' check_call(commands, logger=logger, executable='/bin/bash', shell=True) + res = imp_res_files('mpas_tools.mesh.creation') / 'conda-toolchain.cmake' + if not os.path.exists(str(res)): + raise FileNotFoundError( + f'The conda toolchain file does not exist: {res}' + ) + + build_dir = Path(os.path.abspath(subdir)) / 'external' / 'jigsaw' / 'tmp' + if os.path.exists(build_dir): + shutil.rmtree(build_dir) + build_dir.mkdir(parents=True) + toolchain_path = build_dir / 'conda-toolchain.cmake' + + with res.open('rb') as src, open(toolchain_path, 'wb') as dst: + shutil.copyfileobj(src, dst) + + conda_toolchain = str(toolchain_path) + + cmake_args = ( + f'-DCMAKE_BUILD_TYPE=Release ' + f'-DCMAKE_TOOLCHAIN_FILE="{conda_toolchain}"' + ) + print('Building JIGSAW\n') # Build JIGSAW commands = ( f'{activate_env}' - f'cd {subdir}/external/jigsaw && ' - f'rm -rf tmp && ' - f'mkdir tmp && ' - f'cd tmp && ' + f'cd {subdir}/external/jigsaw/tmp && ' f'cmake .. {cmake_args} && ' f'cmake --build . --config Release --target install --parallel 4' )