The OASIS Coupler Forum

  HOME

OASIS-NEMO4 coupling error at compilation

Up to Specific issues in real coupled models

Posted by Anonymous at May 15 2020

Hi,

I'm tyring to compile NEMO4 with OASIS3-mct4, but I'm facing a problem when compiling NEMO. I get "undefined reference" errors in the OASIS library. OASIS compiled without issue, but since the error is related to OASIS library, I don't think the problem comes from NEMO4, hence my message here.

The errors are the like the following

/nobackup/fouo6/sm_jongr/oasis3-mct/BI/lib//libpsmile.MPI1.a(mod_oasis_io.o): In function `oasis_io_read_avfbf':

/nobackup/fouo6/sm_jongr/oasis3-mct//lib/psmile/src/mod_oasis_io.F90:1149: undefined reference to `m_attrvectcomms_mp_gsm_gather__'

/nobackup/fouo6/sm_jongr/oasis3-mct//lib/psmile/src/mod_oasis_io.F90:1151: undefined reference to `m_attrvect_mp_nrattr__'

/nobackup/fouo6/sm_jongr/oasis3-mct//lib/psmile/src/mod_oasis_io.F90:1152: undefined reference to `m_attrvect_mp_getrlist__'

/nobackup/fouo6/sm_jongr/oasis3-mct//lib/psmile/src/mod_oasis_io.F90:1240: undefined reference to `m_attrvectcomms_mp_gsm_scatter__'

/nobackup/fouo6/sm_jongr/oasis3-mct//lib/psmile/src/mod_oasis_io.F90:1242: undefined reference to `m_attrvect_mp_clean__'

/nobackup/fouo6/sm_jongr/oasis3-mct/BI/lib//libpsmile.MPI1.a(mod_oasis_map.o): In function `oasis_map_smatreaddnc_orig':

I have them on several functions, with several references, and in all the libs created by OASIS. I can give a full list if needed (as a first post, it might have been a bit hard to go through...).

My compilation command at this stage (from the automatic make command from NEMO): mpif90 -O3 -fp-model precise -assume byterecl -convert big_endian -Nmpi -o nemo.exe /nobackup/fouo6/sm_jongr/release-4.0.1/cfgs/NORDIC_OASIS/BLD/obj/nemo.o -L/nobackup/fouo6/sm_jongr/release-4.0.1/cfgs/NORDIC_OASIS/BLD/lib -l__fcm__nemo -Nmpi -O2 -traceback -r8 -lstdc++ -L/nobackup/fouo6/sm_jongr/oasis3-mct/BI/lib/ -lmct -lpsmile.MPI1 -lscrip -lmpeu -L/nobackup/fouo6/sm_jongr/xios-2.5/lib -lxios -L/software/apps/netcdf/4.3.2/i1501-impi-5.0.2.044-hdf5-1.8.14/lib -lnetcdff -lnetcdf

My guess is that something is wrong with the linking of the library. I'm probably forgetting a flag to pass to the compiler, or maybe openmp has an issue, but I have no idea what exactly and why.

Anyone has an idea? Thanks!

Posted by Anonymous at May 18 2020

Hi

I'm no expert, but I generally find that if you compile OASIS with OpenMP, then all other components must also be compiled with OpenMP. Don't know what happens when you compile NEMO with OpenMP. I guess nothing happens since there are no OpenMP directives in NEMO.

Cheers Joakim

PS. The OpenMP stuff in OASIS is just to speed up the generation of remapping files on the very first time step. If you're ok with this taking a while (just like it did with MCT3), try removing the OpenMP flag from the OASIS compile settings and see if that works.

Posted by Anonymous at May 19 2020

Thanks for your reply.

It makes sense. But then... how do I remove the OpenMP flag in OASIS? My make file is modified from make.gfortran_impi_neptune and I couldn't find any option for that.

Cheers, Nathan

Posted by Anonymous at May 20 2020

Hi Nathan, 
I am not convinced that your problem is linked to openMP. In the messages you sent, the Undefined reference relate to MCT routines. Can you send me your mail by sending a mail to oasishelp@cerfacs.fr so that we can interact off the forum? 

Regards, Sophie, for the OASIS team

Posted by Anonymous at May 25 2020

Hi Sophie.

Joakim was right, it was OpenMP. I was able to compile NEMO with the -qopenmp flag set up during NEMO's compilation.

My guess is that since OpenMP is used in the library that is called when compiling NEMO (OASIS), NEMO has to be compiled using the same library (OpenMP), regardless of the fact that it doesn't use this library itself. If not, the compiler won't be able to link properly the required library (OASIS), and undefined reference will occur in the library needing OpenMP, not in the main program. It could be a good idea to add in the documentation a way to compile OASIS without OpenMP. To be able to easily test this kind of linking problem.

Cheers, Nathan
Reply to this