# MPAS-JEDI build error during make on Ubuntu (undefined reference to \_gfortran\_transfer\_real\_write)

**URL:** <https://forums.jcsda.org/t/mpas-jedi-build-error-during-make-on-ubuntu-undefined-reference-to-gfortran-transfer-real-write/729>\
**Category:** JEDI\
**Created:** [March 5, 2026, 3:40pm UTC](https://forums.jcsda.org/t/mpas-jedi-build-error-during-make-on-ubuntu-undefined-reference-to-gfortran-transfer-real-write/729 "2026-03-05T15:40:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Astrogirlanajli](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/astrogirlanajli/32/273_2.png) [@Astrogirlanajli](https://forums.jcsda.org/u/Astrogirlanajli)\
**Post date:** [March 5, 2026, 3:40pm UTC](https://forums.jcsda.org/t/mpas-jedi-build-error-during-make-on-ubuntu-undefined-reference-to-gfortran-transfer-real-write/729/1 "2026-03-05T15:40:52Z")

</div>

Hello everyone,

I am trying to build **MPAS-JEDI** using the **spack-stack environment** on Ubuntu. The configuration step completes successfully, but the build fails during the linking stage.

### Environment

- Host OS: Windows with **WSL (Ubuntu)**

- spack-stack version: **1.6.0**

- Compiler: **GCC 11.5.0**

- ESMF version: **8.5.0** (installed via spack-stack)

### Steps I followed

Activated the environment:

```auto
spack env activate mpas-env

```

Configured the MPAS bundle:

```auto
cmake ../code

```

Started the build:

```auto
make -j2

```

### Error during build

The build fails during linking with the following error:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/487be3d89a8c6f25277ced3f54b8ee3d2cd1f966.png)

From `CMakeCache.txt` I see that it is linking against:

```auto
.../esmf-8.5.0/lib/libesmf.a

```

Has anyone encountered this issue when building MPAS-JEDI with spack-stack (especially under WSL)? Any suggestions on how to resolve this linking error would be greatly appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![byoung-joo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/byoung-joo/32/126_2.png) [@byoung-joo](https://forums.jcsda.org/u/byoung-joo)\
**Post date:** [March 10, 2026, 2:53pm UTC](https://forums.jcsda.org/t/mpas-jedi-build-error-during-make-on-ubuntu-undefined-reference-to-gfortran-transfer-real-write/729/2 "2026-03-10T14:53:27Z")

</div>

Hi @Astrogirlanajli ,

On your issue with esmf, I wonder if you can find some intuition from [Trouble running mpasjedi\_hofx3d.x with mpas-bundle 3.0.2](https://forums.jcsda.org/t/trouble-running-mpasjedi-hofx3d-x-with-mpas-bundle-3-0-2/679) .

Also curious which versions of mpas-bundle and spack-stack you are using.

Although not resolving esmf issue, you may try commenting out two lines of ( `ecbuild_bundle( PROJECT MPAS...` and `ecbuild_bundle( PROJECT mpas-jedi ...`) from mpas-bundle’s `CMakeLists.txt`, then see if the build (both `cmake` and `make`) work. With this way, you may still explore other model-agnostic JEDI components (such as UFO) or simple model examples in OOPS.

Hope this helps!

Thank you,  
BJ

---

<div class="post-metadata">

**Author:** ![Astrogirlanajli](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/astrogirlanajli/32/273_2.png) [@Astrogirlanajli](https://forums.jcsda.org/u/Astrogirlanajli)\
**Post date:** [March 17, 2026, 4:21am UTC](https://forums.jcsda.org/t/mpas-jedi-build-error-during-make-on-ubuntu-undefined-reference-to-gfortran-transfer-real-write/729/3 "2026-03-17T04:21:07Z")

</div>

Hi @byoung-joo,

Thank you for your suggestions.

It appears that the issue was due to a compiler mismatch: spack-stack was built with GCC 11.5, while the MPAS bundle was using GCC 13. I have now rebuilt both spack-stack and the MPAS bundle with GCC 11 on Ubuntu 22.04.

My current setup is as follows:

– spack-stack version 1.6.0

– mpas-bundle version 3.0

With this setup, I am able to successfully complete both the CMake configuration and the build for MPAS-JEDI without errors. However, I am now encountering issues when running `ctest`, and I am currently investigating them.
