ICON installed with NAG Fortran compiler and external YAC and YAXT libraries

Dear Colleagues,

I want to install ICON with the NAG Fortran Compiler, but in addition with more recent yaxt and yac libraries (which I need for debugging our ComIn plugin). I tried to configure with –with-external-yaxt --with-external-yac and set

YAXT_LIBS="-lyaxt -lyaxt_c"
YAC_LIBS="-lyac -lm -lyac_clapack -lyac_mtime -lfyaml -lnetcdf -lmpi"

YY_FCFLAGS="-I${YAXT_ROOTDIR}/include -I${YAC_ROOTDIR}/include"
YY_LDFLAGS="-L${YAXT_ROOTDIR}/lib -L${YAC_ROOTDIR}/lib"
YY_LIBS="${YAC_LIBS} ${YAXT_LIBS}"

Next, I added this to LDFLAGS, LIBS, and FCFALGS, respectively.
The configuration runs smoothely wihtout errors, but when I try to compile, I receive the error
./conftest: error while loading shared libraries: libyaxt.so.1: cannot open shared object file: No such file or directory
at configuration of basically all external packages … despite the fact that this shared library is present.

Thus my question: What do I need to set in the levante.nag configure script in order to assure that the configure scripts correctly inherit the library paths settings in case of the NAG compiler?
Note that the same approach shown above, worked for the GNU and the INTEL compiler suite without issues.

Any hint is very much appreciated.

OK, the solution was to add ${YAXT_ROOTDIR}/lib: to the BUILD_ENV="export LD_LIBRARY_PATH= ...

Hi Patrick!

IMO the clean way to do this is to build an install yac, yaxt or another of the bundles library into some directory and then use the appropriate configure option to tell the ICON building, where to find that externally build installation.

Running ./configure --help you get besides other output this section:

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-external-rte-rrtmgp
                          use external RTE+RRTMGP library [default=no]
  --with-external-ecrad   use external ECRAD library [default=no]
  --with-external-sct     use external SCT library [default=no]
  --with-external-yaxt    use external YAXT library [default=no]
  --with-external-ppm     use external PPM library [default=no]
  --with-external-cdi     use external CDI library [default=no]
  --with-external-mtime   use external MTIME library [default=no]
  --with-external-yac     use external YAC library [default=no]
  --with-external-tixi    use external TIXI library [default=no]
  --with-external-fortran-support
                          use external FORTRAN-SUPPORT library [default=no]

The default is of course to build the shipped library versions.

cheers
ralf

OK, thanks a lot for this info. But, as far as I see it, it is not sufficient to set --with-external-yac and / or --with-external-yaxt … you need to specify LIBS, FCFLAGS, LDFLAGS etc. manually in the environment?

Or is it that I can simply set?:
--with-external-yaxt=/path/to/my/specific/yaxt-installation. At least configure --help does not suggest it that way?

These external switches are only for disabling the building for the internal submodules, but the configure script will run the compile and linking tests to make sure the installation you want to use, will work properly.

external libraries are all handled the same way: for each of them you have to provide the needed FCFLAGS, LDFLAGS and LIBS. Esp. the LDFLAGS are important, because the build system of ICON will create rpath-linking calls for all given locations.

in the end you have to provide flags very similar to ./config/dkrz/levante.intel or ./config/dkrz/levante.gcc

Thanks Ralf, that means I got it right, since this was exactly what I did.
Thanks a lot for the valuable feedback!!

1 Like