Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Jan 28, 2026

This merge also fixes two issues with the compass package exposed by the conda builds:

  • some misnamed files __init_.py that should have been __init__.py
  • yaml files that were not being included in the package data

Here, I have also updated the quick start for users to be consistent with the latest releases I have uploaded: compass 1.8.0.

Checklist

  • User's Guide has been updated
  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes

@xylar xylar self-assigned this Jan 28, 2026
@xylar xylar added documentation Improvements or additions to documentation dependencies and deployment Changes relate to creating conda and Spack environments, and creating a load script labels Jan 28, 2026
@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

@matthewhoffman and @trhille, could you follow the quick start for users on Perlmutter or Chrysalis or some other linux machine? I just want to make sure the packages are actually working as expected. It would be nice to run some tests but even just setting something up would be a good starting point.

Copy link
Collaborator

@trhille trhille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar, this is great! I followed the quick-start guide on Perlmutter and was able to create the compass env and successfully run the landice/kangerlussuaq/mesh_gen test case.

I have one small comment to do with a potential tripping point in conda config settings that we might as well make a note of, but I'm approving this because it works as-is and that is really not a compass issue.

I'd be happy to do any other testing you think is necessary.

.. code-block:: bash

conda create -n compass -c conda-forge -c e3sm/label/compass python=3.10 \
conda create -n compass -c conda-forge -c e3sm/label/compass python=3.13 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I first tried this, I got an error:

Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - package compass-1.8.0-mpi_mpich_haa344d4_0 is excluded by strict repo priority

I was able to solve this by changing my conda channel priority settings: conda config --set channel_priority flexible. It might be worth adding a note here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, dear! I always feared we'd get scooped. Someone made a compass package on conda-forge:
https://github.com/conda-forge/compass-feedstock

So I'll need to switch the channel order so -c e3sm/label/compass comes first. But I need to make sure we're not serving packages on that label that we don't want. I don't think so.

@matthewhoffman
Copy link
Member

matthewhoffman commented Jan 28, 2026

@xylar , thanks for putting this together so quickly. I tried to follow these steps in the Ubuntu Docker container for MALI that Luca has set up. I was able to install the compass package without incident but hit an internal compiler error while trying to compile jigsaw. Are you familiar at all with this error?

$ build_jigsaw --clone --subdir jigsaw-python
Running:
  source /home/runner/miniforge3/etc/profile.d/conda.sh &&
  conda activate /home/runner/miniforge3/envs/compass &&
  pip uninstall -y jigsawpy; conda remove -y --force-remove jigsaw jigsawpy
WARNING: Skipping jigsawpy as it is not installed.

PackagesNotFoundError: The following packages are missing from the target environment:

  - jigsawpy
  - jigsaw



Running:
  source /home/runner/miniforge3/etc/profile.d/conda.sh &&
  conda activate /home/runner/miniforge3/envs/compass &&
  rm -rf jigsaw-python &&
  git clone https://github.com/dengwirda/jigsaw-python.git jigsaw-python
Cloning into 'jigsaw-python'...

Install dependencies

Running:
  source /home/runner/miniforge3/etc/profile.d/conda.sh &&
  conda activate /home/runner/miniforge3/envs/compass &&
  conda install -y cmake make libnetcdf setuptools numpy scipy sysroot_linux-64=2.17 gxx=14 openmp
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/runner/miniforge3/envs/compass

  added / updated specs:
    - cmake
    - gxx=14
    - libnetcdf
    - make
    - numpy
    - openmp
    - scipy
    - setuptools
    - sysroot_linux-64=2.17


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    binutils_impl_linux-64-2.45|default_hfdba357_105         3.5 MB  conda-forge
    cmake-4.2.3                |       hc85cc9f_0        21.3 MB  conda-forge
    conda-gcc-specs-14.3.0     |      he8ccf15_16          31 KB  conda-forge
    gcc-14.3.0                 |      h0dff253_16          28 KB  conda-forge
    gcc_impl_linux-64-14.3.0   |      he8b2097_16        71.8 MB  conda-forge
    gxx-14.3.0                 |      h76987e4_16          28 KB  conda-forge
    gxx_impl_linux-64-14.3.0   |      h2185e75_16        14.5 MB  conda-forge
    kernel-headers_linux-64-3.10.0|      he073ed8_18         921 KB  conda-forge
    libgcc-devel_linux-64-14.3.0|     hf649bbc_116         2.9 MB  conda-forge
    libsanitizer-14.3.0        |      h8f1669f_16         7.6 MB  conda-forge
    libstdcxx-devel_linux-64-14.3.0|     h9f08a49_116        19.6 MB  conda-forge
    libuv-1.51.0               |       hb03c661_1         874 KB  conda-forge
    llvm-openmp-8.0.1          |       hc9558a2_0         439 KB  conda-forge
    make-4.4.1                 |       hb9d3cd8_2         501 KB  conda-forge
    openmp-8.0.1               |                0           8 KB  conda-forge
    rhash-1.4.6                |       hb9d3cd8_1         189 KB  conda-forge
    sysroot_linux-64-2.17      |      h0157908_18        14.5 MB  conda-forge
    ------------------------------------------------------------
                                           Total:       158.7 MB

The following NEW packages will be INSTALLED:

  binutils_impl_lin~ conda-forge/linux-64::binutils_impl_linux-64-2.45-default_hfdba357_105
  cmake              conda-forge/linux-64::cmake-4.2.3-hc85cc9f_0
  conda-gcc-specs    conda-forge/linux-64::conda-gcc-specs-14.3.0-he8ccf15_16
  gcc                conda-forge/linux-64::gcc-14.3.0-h0dff253_16
  gcc_impl_linux-64  conda-forge/linux-64::gcc_impl_linux-64-14.3.0-he8b2097_16
  gxx                conda-forge/linux-64::gxx-14.3.0-h76987e4_16
  gxx_impl_linux-64  conda-forge/linux-64::gxx_impl_linux-64-14.3.0-h2185e75_16
  kernel-headers_li~ conda-forge/noarch::kernel-headers_linux-64-3.10.0-he073ed8_18
  libgcc-devel_linu~ conda-forge/noarch::libgcc-devel_linux-64-14.3.0-hf649bbc_116
  libsanitizer       conda-forge/linux-64::libsanitizer-14.3.0-h8f1669f_16
  libstdcxx-devel_l~ conda-forge/noarch::libstdcxx-devel_linux-64-14.3.0-h9f08a49_116
  libuv              conda-forge/linux-64::libuv-1.51.0-hb03c661_1
  llvm-openmp        conda-forge/linux-64::llvm-openmp-8.0.1-hc9558a2_0
  make               conda-forge/linux-64::make-4.4.1-hb9d3cd8_2
  openmp             conda-forge/linux-64::openmp-8.0.1-0
  rhash              conda-forge/linux-64::rhash-1.4.6-hb9d3cd8_1
  sysroot_linux-64   conda-forge/noarch::sysroot_linux-64-2.17-h0157908_18



                                                      done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done



==> WARNING: A newer version of conda exists. <==
    current version: 25.11.0
    latest version: 25.11.1

Please update conda by running

    $ conda update -n base -c conda-forge conda



Building JIGSAW

Running:
  source /home/runner/miniforge3/etc/profile.d/conda.sh &&
  conda activate /home/runner/miniforge3/envs/compass &&
  cd jigsaw-python/external/jigsaw/tmp &&
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="/home/runner/jigsaw-python/external/jigsaw/tmp/conda-toolchain.cmake" &&
  cmake --build . --config Release --target install --parallel 4
-- The C compiler identification is GNU 14.3.0
-- The CXX compiler identification is GNU 14.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/runner/miniforge3/envs/compass/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/runner/miniforge3/envs/compass/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GCXX-like compiler detected
-- Installing locally
-- NetCDF library found
-- NetCDF inc. lib: /home/runner/miniforge3/envs/compass/lib/libnetcdf.so
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- OpenMP library found
-- OpenMP inc. lib: gomp;pthread
-- OpenMP inc. lib: /home/runner/miniforge3/envs/compass/lib/gcc/x86_64-conda-linux-gnu/14.3.0/libgomp.so;/home/runner/miniforge3/envs/compass/x86_64-conda-linux-gnu/sysroot/usr/lib/libpthread.so
-- Configuring done (9.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/runner/jigsaw-python/external/jigsaw/tmp
[ 12%] Building CXX object src/CMakeFiles/jigsaw-lib.dir/jigsaw.cpp.o
[ 25%] Building CXX object src/CMakeFiles/tripod-cmd.dir/jigsaw.cpp.o
[ 37%] Building CXX object src/CMakeFiles/jigsaw-cmd.dir/jigsaw.cpp.o
[ 50%] Building CXX object src/CMakeFiles/marche-cmd.dir/jigsaw.cpp.o
[ 62%] Linking CXX executable marche
[ 75%] Linking CXX executable tripod
[ 87%] Linking CXX executable jigsaw
[100%] Linking CXX shared library libjigsaw.so

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


during IPA pass: static-var
lto1: internal compiler error: in return_token, at opts-common.cc:2177
0x1e054a6 internal_error(char const*, ...)
	???:0
0x773e20 fancy_abort(char const*, int, char const*)
	???:0
0x7b7b84 lto_main()
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose> for instructions.
lto-wrapper: fatal error: /home/runner/miniforge3/envs/compass/bin/c++ returned 1 exit status
compilation terminated.
/home/runner/miniforge3/envs/compass/bin/../libexec/gcc/x86_64-conda-linux-gnu/14.3.0/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/CMakeFiles/marche-cmd.dir/build.make:104: src/marche] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:179: src/CMakeFiles/marche-cmd.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
during IPA pass: static-var
lto1: internal compiler error: in return_token, at opts-common.cc:2177
0x1e054a6 internal_error(char const*, ...)
	???:0
0x773e20 fancy_abort(char const*, int, char const*)
	???:0
0x7b7b84 lto_main()
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose> for instructions.
lto-wrapper: fatal error: /home/runner/miniforge3/envs/compass/bin/c++ returned 1 exit status
compilation terminated.
/home/runner/miniforge3/envs/compass/bin/../libexec/gcc/x86_64-conda-linux-gnu/14.3.0/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/CMakeFiles/tripod-cmd.dir/build.make:104: src/tripod] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:147: src/CMakeFiles/tripod-cmd.dir/all] Error 2
lto1: internal compiler error: in return_token, at opts-common.cc:2177
0x1e054a6 internal_error(char const*, ...)
	???:0
0x773e20 fancy_abort(char const*, int, char const*)
	???:0
0x7b7b84 lto_main()
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose> for instructions.
lto-wrapper: fatal error: /home/runner/miniforge3/envs/compass/bin/c++ returned 1 exit status
compilation terminated.
/home/runner/miniforge3/envs/compass/bin/../libexec/gcc/x86_64-conda-linux-gnu/14.3.0/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/CMakeFiles/jigsaw-cmd.dir/build.make:104: src/jigsaw] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:115: src/CMakeFiles/jigsaw-cmd.dir/all] Error 2
lto1: internal compiler error: in return_token, at opts-common.cc:2177
0x1e054a6 internal_error(char const*, ...)
	???:0
0x773e20 fancy_abort(char const*, int, char const*)
	???:0
0x7b7b84 lto_main()
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose> for instructions.
lto-wrapper: fatal error: /home/runner/miniforge3/envs/compass/bin/c++ returned 1 exit status
compilation terminated.
/home/runner/miniforge3/envs/compass/bin/../libexec/gcc/x86_64-conda-linux-gnu/14.3.0/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
gmake[2]: *** [src/CMakeFiles/jigsaw-lib.dir/build.make:104: src/libjigsaw.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:211: src/CMakeFiles/jigsaw-lib.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Traceback (most recent call last):
  File "/home/runner/miniforge3/envs/compass/bin/build_jigsaw", line 9, in <module>
    sys.exit(main_build_jigsaw())
             ~~~~~~~~~~~~~~~~~^^
  File "/home/runner/miniforge3/envs/compass/lib/python3.13/site-packages/mpas_tools/mesh/creation/jigsaw_driver.py", line 296, in main_build_jigsaw
    build_jigsaw(clone=args.clone, subdir=args.subdir, hash=args.hash)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/miniforge3/envs/compass/lib/python3.13/site-packages/mpas_tools/mesh/creation/jigsaw_driver.py", line 225, in build_jigsaw
    check_call(commands, logger=logger, executable='/bin/bash', shell=True)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/miniforge3/envs/compass/lib/python3.13/site-packages/mpas_tools/logging.py", line 66, in check_call
    raise subprocess.CalledProcessError(process.returncode, print_args)
subprocess.CalledProcessError: Command '
  source /home/runner/miniforge3/etc/profile.d/conda.sh &&
  conda activate /home/runner/miniforge3/envs/compass &&
  cd jigsaw-python/external/jigsaw/tmp &&
  cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="/home/runner/jigsaw-python/external/jigsaw/tmp/conda-toolchain.cmake" &&
  cmake --build . --config Release --target install --parallel 4' returned non-zero exit status 2.

@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

@matthewhoffman, no idea. I'd have to ask ChatGPT, which I'm happy to do.

@xylar xylar force-pushed the add-conda-v1-recipe branch 2 times, most recently from 95a5d35 to cad5279 Compare January 28, 2026 17:42
@matthewhoffman
Copy link
Member

@xylar , with the help of ChatGPT, I was able to get past the error and get jigsaw compiled successfully by disabling link-time optimization with these flags:

export CFLAGS="-O2 -fno-lto"
export CXXFLAGS="-O2 -fno-lto"
export LDFLAGS="-fno-lto"

It thought it might be related to messy architecture (compiling AMD in a container on ARM architecture) and/or compiler version. This should not be necessary generally, but seems like a fine workaround for this situation.

@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

I ran into trouble creating the load script with nompi. I have it fixed and I uploaded new 1.8.0 packages with the fix.

I retested and I get some error messages that are confusing:


CondaValueError: No packages match 'mpich'.


CondaValueError: No packages match 'openmpi'.

but not worth generating yet another set of packages to fix. I just fixed it in this branch so it will go away the next time we build packages.

@xylar xylar force-pushed the add-conda-v1-recipe branch from cad5279 to 685f304 Compare January 28, 2026 18:04
Copy link
Member

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar , after resolving the debugging issue with jigsaw, I was able to use the conda package to successfully install compass in the linux container. I confirmed that compass list worked. I tried setting up a test case and realized that I need to deal with specifying a config file or machine for the container. I think that is beyond the scope of this PR, so I'm approving this now.

@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

I think some issues remain for create_compass_load_script. Here's the load script it's generating:

source /home/xylar/miniforge3/etc/profile.d/conda.sh
conda activate compass

export NETCDF=$(dirname $(dirname $(which nc-config)))
export NETCDFF=$(dirname $(dirname $(which nf-config)))
export PNETCDF=$(dirname $(dirname $(which pnetcdf-config)))


export PIO=/home/xylar/miniforge3/envs/compass
export USE_PIO2=true
export HDF5_USE_FILE_LOCKING=FALSE
export LOAD_COMPASS_ENV=/home/xylar/Desktop/compass/load_compass_1.8.0.sh

The main thing is it's assuming PIO comes from the conda environment, which is never going to be true.

I'm not sure how to make it find PIO, given that we're basically making it up to our users to figure that out. One option is to simply remove PIO and USE_PIO2 from the load script and make users have to set those themselves.

In any case, it seems likely that the load script produced in the docker container will need to be more sophisticated than this, including setting various other environment variable that MALI needs. Presumably, we just won't call create_compass_load_script in the docker container build, and instead it will use its own template or scripting to generate an equivalent load script.

@matthewhoffman, what are your thoughts here?

@matthewhoffman
Copy link
Member

matthewhoffman commented Jan 28, 2026

@xylar , I agree something more sophisticated needs to happen for the container situation (which may or may not directly bear on this PR). I just made the discovery that multi processor runs with landice_model are not working in the container because I'm picking up mpirun from the conda environment, which I think is a similar situation to what you are describing. I'll have to think about this some more and test to understand the situation better and have a suggestion.

@matthewhoffman
Copy link
Member

I was able to get around my mpirun issue by specifying the full path to mpirun in parallel_executable in my compass cfg file. Given that the compass conda package is not meant to support model compilation (I think? at least not for unsupported machines), I think it's ok if these env variables that are only needed for compiling the model and supporting compass-built model execution just aren't set up right. What do you think?

@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

I just made the discovery that multi processor runs with landice_model are not working in the container because I'm picking up mpirun from the conda environment, which I think is a similar situation to what you are describing. I'll have to think about this some more and test to understand the situation better and have a suggestion.

You need to do the equivalent of loading the MPI module after you load the conda environment. This is something we always do in the compass load scripts for supported machines. You can probably use one of them as an example to work from.

@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

I was able to get around my mpirun issue by specifying the full path to mpirun in parallel_executable in my compass cfg file. Given that the compass conda package is not meant to support model compilation (I think? at least not for unsupported machines), I think it's ok if these env variables that are only needed for compiling the model and supporting compass-built model execution just aren't set up right. What do you think?

That's also an okay workaround. But I would think just making sure the path to the executable gets added to your $PATH variable earlier than the conda bin directory would be another easy fix. Whatever you think is easier.

@xylar
Copy link
Collaborator Author

xylar commented Jan 28, 2026

Okay, I think we'll live with a somewhat imperfect load script produced by create_compass_load_script, since we don't think many people will actually use it and those who do can be told to edit it manually to point to the correct PIO.

@xylar xylar merged commit 6912ae3 into MPAS-Dev:main Jan 28, 2026
5 checks passed
@xylar xylar deleted the add-conda-v1-recipe branch January 28, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies and deployment Changes relate to creating conda and Spack environments, and creating a load script documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants