Skip to content

JEDI skylab plot steps are not working with oneapi environments on Orion and Hercules #1808

@srherbener

Description

@srherbener

Description

When attempting to create plots using the python3 simobs utilities, the following error shows up (Hercules example using spack-stack-1.9.2):

>>> from simobs.plotting.skylab_monitor import main as skylab_monitor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/work2/noaa/jcsda/herbener/jedi-herc/jedi-workflow/simobs/src/simobs/plotting/skylab_monitor.py", line 16, in <module>
    from simobs.plotting.plot_maps import \
  File "/work2/noaa/jcsda/herbener/jedi-herc/jedi-workflow/simobs/src/simobs/plotting/plot_maps.py", line 9, in <module>
    import scipy.stats as st
  File "/apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/stats/__init__.py", line 610, in <module>
    from ._stats_py import *
  File "/apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/stats/_stats_py.py", line 38, in <module>
    from scipy.spatial import distance_matrix
  File "/apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/spatial/__init__.py", line 110, in <module>
    from ._kdtree import *
  File "/apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/spatial/_kdtree.py", line 4, in <module>
    from ._ckdtree import cKDTree, cKDTreeNode
ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/spatial/_ckdtree.cpython-311-x86_64-linux-gnu.so)
>>> 

The the stdc++ library (libstdc++.so.6) is being loaded during runtime. However the compiled python library in scipy (/apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/spatial/_ckdtree.cpython-311-x86_64-linux-gnu.so) was linked with a stdc++ library from a different location as revealed by the ldd command. Here's the output of running ldd on the scipy compiled library:

ldd /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/py-scipy-1.14.1-xhcqbl7/lib/python3.11/site-packages/scipy/spatial/_ckdtree.cpython-311-x86_64-linux-gnu.so
	linux-vdso.so.1 (0x00007ffdb334d000)
	libstdc++.so.6 => /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/gcc-runtime-13.3.0-rmyeldf/lib/libstdc++.so.6 (0x00007fedfe603000)
	libm.so.6 => /usr/lib64/libm.so.6 (0x00007fedfe528000)
	libgcc_s.so.1 => /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/gcc-runtime-13.3.0-rmyeldf/lib/libgcc_s.so.1 (0x00007fedfe500000)
	libc.so.6 => /usr/lib64/libc.so.6 (0x00007fedfe2f7000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fedfe94c000)

where you can see that /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/gcc-runtime-13.3.0-rmyeldf/lib/libstdc++.so.6 was linked at build time, whereas /usr/lib64/libstdc++.so.6 was loaded at runtime.

This is happening because LD_LIBRARY_PATH is not being setup correctly. The desired path (/apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/gcc/13.3.0/gcc-runtime-13.3.0-rmyeldf/lib) is not included but /usr/lib64 is included.

It looks like oneapi provides a standard C++ library that needs to be used instead of the system provided library. Placing the desired path in LD_LIBRARY_PATH before /usr/lib64 provides a workaround, and perhaps this is the way to address this.

The same situation is ocurring on Orion, spack-stack-1.9.3 with the desired path /apps/contrib/spack-stack/spack-stack-1.9.3/envs/ue-oneapi-2024.2.1/install/gcc/12.2.0/gcc-runtime-12.2.0-bilscpd/lib not being included in LD_LIBRARY_PATH.

To Reproduce

  1. set up the environment
  • On Hercules:
module purge
module use /work/noaa/epic/role-epic/spack-stack/hercules/modulefiles
module load ecflow/5.8.4
module load git-lfs/3.1.2

module use /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/modulefiles/Core
module use /apps/contrib/spack-stack/spack-stack-1.9.2/envs/ue-oneapi-2024.1.0/install/modulefiles/gcc/13.3.0
module load stack-oneapi/2024.2.1
module load stack-intel-oneapi-mpi/2021.13
module load stack-python/3.11.7
module load jedi-fv3-env
  • On Orion:
SPACK_STACK_INTEL_ENV=/apps/contrib/spack-stack/spack-stack-1.9.3/envs/ue-oneapi-2024.2.1

# load modules
module purge
module use $SPACK_STACK_INTEL_ENV/install/modulefiles/Core
module load stack-oneapi/2024.2.1
module load stack-intel-oneapi-mpi/2021.13
module load stack-python/3.11.7

module load singularity

# This is a fix for the issue where a handful of spack-stack-1.9.1
# oneapi modules (eg, py-scipy) were not being found because
# these modules were being built with the gcc compilers instead
# of the oneapi compilers.
export LMOD_TMOD_FIND_FIRST=yes
module use $SPACK_STACK_INTEL_ENV/install/modulefiles/gcc/12.2.0

module load jedi-fv3-env
  1. run python3 and try importing the following
linux_prompt> python3
>>> import pandas
>>> import scipy.stats as st

Expected behavior

The example import (above) successfully completes

System, compiler, code, ...

  • using the JEDI skylab environment (at the least source the setup script and run build_workflow_apps.sh from jedi-tools)
  • intel oneapi 2024.1.0 for both orion and hercules

Additional context

I suspect that there is a process we are missing in our JEDI skylab setup scripts that gets LD_LIBRARY_PATH set correctly, so the solution might simply be to add this process to the JEDI skylab scripts.

Metadata

Metadata

Labels

OAR-EPICNOAA Oceanic and Atmospheric Research and Earth Prediction Innovation CenterbugSomething is not working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions