XIOS compilation errors

Dear all
I am a beginner and I tried to run the NEMO (ver 4.0.6) test case (GYRE_PISCES) with a LINUX-GCC environment during this time. A GYRE_testing directory can be created after executing ./makenemo -m linux_gfortran -r GYRE_PISCES -n GRYE_testing -j4, but some error occurred when I ran the command mpirun -n 1 ./nemo. The error information is listed below:

error log
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x2B5CF1FEFB97
#1  0x2B5CF1FEED90
#2  0x3D46C3269F
#3  0x3D46C32625
#4  0x3D46C33E04
#5  0x2B5CF1609B4C
#6  0x2B5CF1607BA5
#7  0x2B5CF1607BF0
#8  0x2B5CF1607E08
#9  0x2B5CF163463E
#10  0x14038A3 in _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag.isra.39 at xml_parser_decl.cpp:0
#11  0x1406BA1 in void xios::xml::CXMLParser::ParseInclude<xios::CGroupTemplate<xios::CField, xios::CFieldGroup, xios::CFieldAttributes> >(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, xios::CGroupTemplate<xios::CField, xios::CFieldGroup, xios::CFieldAttributes>&)
#12  0x1212E22 in xios::CGroupTemplate<xios::CField, xios::CFieldGroup, xios::CFieldAttributes>::parse(xios::xml::CXMLNode&, bool)
#13  0x1081992 in xios::CContext::parse(xios::xml::CXMLNode&)
#14  0x1404693 in void xios::xml::CXMLParser::ParseInclude<xios::CContext>(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, xios::CContext&)
#15  0x1081436 in xios::CContext::parse(xios::xml::CXMLNode&)
#16  0x13FFDA8 in xios::xml::CXMLParser::ParseStream(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)
#17  0x1401DF6 in xios::xml::CXMLParser::ParseFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)
#18  0x108FC2B in xios::CXios::parseFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#19  0x1090B4B in xios::CXios::initialize()
#20  0x1090B71 in xios::CXios::initClientSide(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int&, int&)
#21  0x122D288 in cxios_init_client
#22  0xEB9475 in __idata_MOD_xios_initialize
#23  0x48502D in __nemogcm_MOD_nemo_init
#24  0x4864E5 in __nemogcm_MOD_nemo_gcm

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   PID 16121 RUNNING AT lon61
=   EXIT CODE: 134
=   CLEANING UP REMAINING PROCESSES
=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Aborted (signal 6)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

The results are the same whether xios 2.0 or xios 2.5 is used to run this test case. The information of my arch file:

NEMO arch file
%NCDF_HOME           /WORK/sio_xmzhang_4/install
%HDF5_HOME           /WORK/sio_xmzhang_4/install
%XIOS_HOME           /WORK/sio_xmzhang_4/Build_NEMO/xios-2.5

%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lstdc++
%XIOS_INC            -I%XIOS_HOME/inc
%XIOS_LIB            -L%XIOS_HOME/lib -lxios


%CPP                 cpp -Dkey_nosignedzero
%FC                  /WORK/app/MPI/Gnu/MPICH/3.2-gcc5.4.0-dyn/bin/mpif90
%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer -cpp -ffree-line-length-none

%FFLAGS              %FCFLAGS
#%LD                  /usr/bin/mpif90 -Wl,-rpath=$HOME/INSTALL/lib:/usr/lib
%LD                  /WORK/app/MPI/Gnu/MPICH/3.2-gcc5.4.0-dyn/bin/mpif90 -Wl,-rpath=/WORK/sio_xmzhang_4/install/lib:/usr/lib
%LDFLAGS
%FPPFLAGS            -P -C -traditional
%AR                  ar
%ARFLAGS             -rs
%MK                  make
%USER_INC            %XIOS_INC  %NCDF_INC
%USER_LIB            %XIOS_LIB  %NCDF_LIB

%CC                  cc
%CFLAGS              -O0
libhdf5.setting

                     AM C Flags:
               Shared C Library: yes
               Static C Library: yes


                        Fortran: yes
               Fortran Compiler: /WORK/app/MPI/Gnu/MPICH/3.2-gcc5.4.0-dyn/bin/mpif90 ( MPICH version 3.2.1 built with gcc version 5.4.0 (GCC))
                  Fortran Flags: -O3 -fPIC
               H5 Fortran Flags:  -std=f2008ts  -Waliasing -Wall -Wcharacter-truncation -Wextra -Wimplicit-interface -Wsurprising -Wunderflow -pedantic -Warray-temporaries -Wintrinsics-std -Wimplicit-procedure -Wreal-q-constant -Wfunction-elimination -Wrealloc-lhs -Wrealloc-lhs-all -Wno-c-binding-type -Wuse-without-only   -s -O3
               AM Fortran Flags:
         Shared Fortran Library: yes
         Static Fortran Library: yes

                            C++: no

                           Java: no


Features:
---------
                   Parallel HDF5: yes
Parallel Filtered Dataset Writes: yes
              Large Parallel I/O: yes
              High-level library: yes
                Build HDF5 Tests: yes
                Build HDF5 Tools: yes
                    Threadsafety: no (recursive RW locks: no)
             Default API mapping: v18
  With deprecated public symbols: yes
          I/O filters (external): deflate(zlib)
                             MPE:
                   Map (H5M) API: no
                      Direct VFD: no
                      Mirror VFD: no
              (Read-Only) S3 VFD: no
            (Read-Only) HDFS VFD: no
                         dmalloc: no
  Packages w/ extra debug output: none
                     API tracing: no
            Using memory checker: no
 Memory allocation sanity checks: no
          Function stack tracing: no
                Use file locking: best-effort
       Strict file format checks: no
    Optimization instrumentation: no

The information of the libnetcdf.setting:

# NetCDF C Configuration Summary
==============================

# General
-------
NetCDF Version:         4.8.0
Dispatch Version:       3
Configured On:          Sun Jun  5 21:38:20 CST 2022
Host System:            x86_64-pc-linux-gnu
Build Directory:        /WORK/sio_xmzhang_4/gccbuild/build/netcdf-c-4.8.0
Install Prefix:         /WORK/sio_xmzhang_4/install

# Compiling Options
-----------------
C Compiler:             /WORK/app/MPI/Gnu/MPICH/3.2-gcc5.4.0-dyn/bin/mpicc
CFLAGS:                 -O3 -fPIC
CPPFLAGS:               -I/WORK/sio_xmzhang_4/install/include
LDFLAGS:                -L/WORK/sio_xmzhang_4/install/lib
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library:         yes
Static Library:         yes
Extra libraries:        -lhdf5_hl -lhdf5 -lm -lcurl

# Features
--------
NetCDF-2 API:           yes
HDF4 Support:           no
HDF5 Support:           yes
NetCDF-4 API:           yes
NC-4 Parallel Support:  yes
PnetCDF Support:        no
DAP2 Support:           yes
DAP4 Support:           yes
Byte-Range Support:     no
Diskless Support:       yes
MMap Support:           no
JNA Support:            no
CDF5 Support:           yes
ERANGE Fill Support:    no
Relaxed Boundary Check: yes
SZIP Support:           no
SZIP Write Support:     no
Parallel Filters:       yes
NCZarr Support:         no
Multi-Filter Support:   yes
libnetcdff.setting
# NetCDF Fortran Configuration Summary
==============================

# General
-------
Library Version:                4.5.3
Configured On:                  Sun Jun  5 21:44:50 CST 2022
Host System:                    x86_64-pc-linux-gnu
Build Directory:                /WORK/sio_xmzhang_4/gccbuild/build/netcdf-fortran-4.5.3
Install Prefix:                 /WORK/sio_xmzhang_4/install

# Compiling Options
-----------------
Fortran Compiler:               /WORK/app/MPI/Gnu/MPICH/3.2-gcc5.4.0-dyn/bin/mpif90
FFLAGS:                         -O3 -fPIC
LDFLAGS:                        -L/WORK/sio_xmzhang_4/install/lib
AM_LDFLAGS:
Shared Library:                 yes
Static Library:                 yes
Extra libraries:                -lnetcdf -lm

# Features
--------
F03:                            yes
Dap Support:                    yes
Logging Support:                yes
NetCDF-2 API:                   yes
NetCDF-4 API:                   yes
CDF5 Support:                   yes
Parallel IO:                    yes
NetCDF4 Parallel IO:            yes
PnetCDF Parallel IO:            no
SZIP Write Support:             no

I’d appreciate any suggestions as to how to solve this problem.
Thanks

wangy

Hei,

Obviously you have a problem with xios. Do you have another Nemo configuration running fine in this environment ?

Have a nice day,

Hi
Thank you very much for your reply.
Unfortunately, no other NEMO runs fine in my environment.
I also guess that this might be a problem with XIOS. For this reason, I downloaded XIOS training tests (xios_training in XIOS – XIOS) and ran the tests. Most of the tests passed (hand-on-1 to hand-on-6), but some tests related to spatial filters (hand-on-7) did not pass. This is the same for both XIOS2.0 and XIOS2.5.
My compilation environment :

[sio_xmzhang_4@lon60%tianhe2-C ~]$ module list
Currently Loaded Modulefiles:
  1) zlib/1.2.11-gcc-5.4.0            4) mpc/0.8.1                        7) curl/7.62.0-gcc-5.4.0
  2) gmp/4.3.2                        5) gcc/5.4.0
  3) MPFR/2.4.2                       6) MPI/Gnu/MPICH/3.2-gcc5.4.0-dyn

HDF5-1.12.1, Netcdf-C-4.8.0 and Netcdf-Fortran-4.5.3 were installed in /WORK/sio_xmzhang_4
/install directory with same mpicc and mpif90, and all paths were exported in the .bashrc file.

Thanks ~
wangy

Dear wangy,

I’m not sure you encounter an issue with NEMO but you certainly have a problem with XIOS so I suggest you to solve first it before testing NEMO.
This forum is strictly NEMO-related so you should post your support request related to XIOS on its users mailing list: xios-users@forge.ipsl.jussieu.fr

Hei Wangy,

Did you change something in your xml files ? If yes, try running with the original files from the GYRE config.

Hope this helps,

Hi
I didn’t change anything in XML file. Anyway, I think you and ntmlod are right, I will recheck the XIOS compilation.
Thank you very much

Hei,

Some advice based on experience: make sure you compile xios and nemo with the very same environment (same libraries, same everything…), what you can do for example is open a terminal and first compile xios in it and then nemo.

Hope this helps,

Hi
I seem to have solved this problem after I downloaded NEMO by subversion in Linuxmint instead of Tortoise SVN in Win10. Interestingly, the XIOS download by Tortoise SVN works fine.
Thanks again for your help ~!
wangy

1 Like

Dear wangy,

We are far from familiar in using NEMO under Windows but I really doubt that the application used to deal with the sources via SVN is the culprit. In a way or another you have messed with XIOS routines or misconfigured your compilation environment.
Anyway glad you solved your issue.

Good day to all!
I had another issue due to my XIOS 2.5 compilation. I made everything in accordance to compilation guide (sites.nemo-ocean.io/user-guide website), changed arch files etc.
After that I ran:

$ ./make_xios --full --prod --arch GCC_test -j 2 |& tee compile_log.txt 

Finally, I got this error

Hi,

For XIOS related questions, you may also try XIOS forum:
https://forge.ipsl.jussieu.fr/mailman/listinfo.cgi/xios-users

Thanks for suggestion

By the way, you have to compile the trunk version of XIOS if you want to use the last release of NEMO (v4.2).
See Essential components — NEMO release-4.2.0 documentation