Build failed: undefined reference to _gfortran_transfer_real_write during linking #1946
-
|
Hello, I'm using spack-stack for first time, I'm trying to install the MPAS-JEDI bundle using spack-stack on Ubuntu (WSL) . The configuration step with cmake ../code completes successfully, but the build fails during the make stage with a linking error involving libgfortran from the ESMF library. The error occurs during the final linking stage. The relevant part of the error message is: /usr/bin/ld: /home/shivani/JEDI_work/spack-stack/envs/mpas-env/install/gcc/11.5.0/esmf-8.5.0-mboaynb/lib/libesmf.a(ESMF_LocStream.o): undefined reference to symbol '_gfortran_transfer_real_write@@GFORTRAN_8'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgfortran.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [mpas-jedi/src/mains/CMakeFiles/mpasjedi_saca.x.dir/build.make:160: bin/mpasjedi_saca.x] Error 1
make[1]: *** [CMakeFiles/Makefile2:25908: mpas-jedi/src/mains/CMakeFiles/mpasjedi_saca.x.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 99%] Linking CXX executable ../../../bin/mpasjedi_enshofx.x
/usr/bin/ld: /home/shivani/JEDI_work/spack-stack/envs/mpas-env/install/gcc/11.5.0/esmf-8.5.0-mboaynb/lib/libesmf.a(ESMF_LocStream.o): undefined reference to symbol '_gfortran_transfer_real_write@@GFORTRAN_8'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgfortran.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [mpas-jedi/src/mains/CMakeFiles/mpasjedi_enshofx.x.dir/build.make:160: bin/mpasjedi_enshofx.x] Error 1
make[1]: *** [CMakeFiles/Makefile2:25946: mpas-jedi/src/mains/CMakeFiles/mpasjedi_enshofx.x.dir/all] Error 2
make: *** [Makefile:166: all] Error 2I am wondering if this issue could be related to the presence of multiple GCC compilers on my system (gcc@13 as the default and gcc@11 used by spack-stack). I also attempted to install the shared ESMF package (esmf@8.5.0+shared), but during runtime, the build still seems to reference the static library. I have been trying to resolve this issue for about a week, but have not been able to identify the correct solution. I would greatly appreciate any guidance on how to proceed. Thank you for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
I think you are on the right track, this looks like a compiler mismatch. It looks like it's pulling in gcc@13 libraries from the OS and as you said gcc in spack-stack is 11. First question: why gcc@11 for spack-stack? gcc@13 works fine and is actually preferred and better supported. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the reply. I remember that some of the dependencies required for installing MPAS-JEDI do not support gcc@13, so I switched to gcc@11.5.0. I will try rebuilding the stack using a single compiler and check whether the error still persists. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @climbfuji, Thank you for your insight. It seems to be a compiler mismatch. After reinstalling spack-stack (v1.6.0) and mpas-bundle (v3.0) with GCC 11 on Ubuntu 22.04, I am now able to complete both the CMake configuration and the build for MPAS-JEDI successfully. Just curious - is the current spack-stack version (1.9.0) compatible with MPAS-JEDI? Also, is there typically a recommended pairing between spack-stack and MPAS-JEDI versions? For example, MPAS-JEDI 2.0 seemed to align with spack-stack 1.3.0, and MPAS-JEDI 3.0 with spack-stack 1.6.0. I’m wondering if similar version alignment is expected for newer releases, or if newer spack-stack versions are generally backwards compatible. |
Beta Was this translation helpful? Give feedback.
@Astrogirlanajli
The current spack-stack version is 2.1.0.
MPAS-JEDI alignment is best discussed with folks from JCSDA (perhaps try the forums), but this code snippet indicates what seems to be a large lag between the two components, at least on UCAR hosts.