Skip to content

Commit 9a7189e

Browse files
authored
Merge pull request #660 from xylar/update-jigsaw-build
Update build_jigsaw to use a cmake toolchain
2 parents 957f96a + bba2c83 commit 9a7189e

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

conda_package/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
recursive-include mpas_tools *.xml
2+
recursive-include mpas_tools *.cmake
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Point CMake's find logic at the conda env only
2+
set(CMAKE_FIND_ROOT_PATH "$ENV{CONDA_PREFIX}")
3+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # use host tools (cmake, python) normally
4+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
5+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
6+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

conda_package/mpas_tools/mesh/creation/jigsaw_driver.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import platform
44
import subprocess
55
import time
6+
from importlib.resources import files as imp_res_files
67

78
import numpy
89

@@ -177,18 +178,22 @@ def build_jigsaw(logger=None, clone=False, subdir='jigsaw-python', hash=None):
177178

178179
# add build tools to deployment env, not polaris env
179180
jigsaw_build_deps = (
180-
'cxx-compiler cmake make libnetcdf setuptools numpy scipy'
181+
'cxx-compiler cmake make libnetcdf openmp setuptools numpy scipy'
182+
)
183+
184+
conda_toolchain = (
185+
imp_res_files('mpas_tools.mesh.creation') / 'conda-toolchain.cmake'
181186
)
182187
if platform.system() == 'Linux':
183188
jigsaw_build_deps = f'{jigsaw_build_deps} sysroot_linux-64=2.17'
184-
netcdf_lib = f'{conda_env_path}/lib/libnetcdf.so'
185189
elif platform.system() == 'Darwin':
186190
jigsaw_build_deps = (
187191
f'{jigsaw_build_deps} macosx_deployment_target_osx-64=10.13'
188192
)
189-
netcdf_lib = f'{conda_env_path}/lib/libnetcdf.dylib'
190193

191-
cmake_args = f'-DCMAKE_BUILD_TYPE=Release -DNETCDF_LIBRARY={netcdf_lib}'
194+
cmake_args = (
195+
f'-DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={conda_toolchain}'
196+
)
192197

193198
print('Install dependencies\n')
194199
# Install dependencies

0 commit comments

Comments
 (0)