Skip to content

Any system is detected as Unicos if cray is somewhere in the PATH environment variable #434

@climbfuji

Description

@climbfuji

This is a real bug in the ESMF OS/compiler detection logic.

My laptop is auto-detected as ESMF_OS=Unicos because

  • I am using spack, which has a ftn in the default search path in the build environment
  • I have cray in the path to spack on my local disk, because this is how the working branch is called (testing something locally first before testing on a Cray)

This is because the ESMF_OS detection logic in ESMF is flawed (scripts/esmf_os):

...
if [ $esmf_os = Linux ]; then
# determine if this is Linux on Cray, i.e. Unicos
which ftn > esmf_os.tmp 2>&1
ftn_test=`grep -e cray -e bin/ftn esmf_os.tmp`
rm -f esmf_os.tmp
if [ -n "$ftn_test" ]; then
esmf_os=Unicos
fi

With spack and a local path like mine:

bash-5.1$ which ftn
~/work/spack-stack/spst-dev-20250613-modulepurgecray/spack/lib/spack/env/ftn
$ which ftn > esmf_os.tmp 2>&1
$ cat esmf_os.tmp
/home/dom/work/spack-stack/spst-dev-20250613-modulepurgecray/spack/lib/spack/env/ftn
$ export ftn_test=`grep -e cray -e bin/ftn esmf_os.tmp`
$ export | grep ftn
declare -x ftn_test="/home/dom/work/spack-stack/spst-dev-20250613-modulepurgecray/spack/lib/spack/env/ftn"

Yet another reason to implement a clean, standard CMake build for ESMF?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions