#3303 closed help (fixed)

iso_c_binding on MONSOON

Reported by: pmcguire Owned by: um_support
Component: Monsoon Keywords: ANTS, MONSOON, iso_c_binding, ftn, fortran, c, shumlib, spiral_search
Cc: Platform: Monsoon2
UM Version:

Description

I am trying to get ANTS working on Monsoon (external).
My current stumbling block is that the spiral_search shared object library is missing iso_c_binding_, which one can see by:

nm /projects/um1/shumlib/shumlib-2020.01.1/meto-xc40-ivybridge-crayftn-8.5.8-craycc-8.5.8/openmp/lib/libshum_spiral_search.so

Is there a module that I should have loaded in order to get access to the FORTRAN iso_c_binding_ module?
Thanks
Patrick

Change History (11)

comment:1 Changed 10 months ago by ros

Are you following the ANTS instructions from: ​https://code.metoffice.gov.uk/doc/ancil/ants/latest/install.html ?

Maybe the recipe in Vittoria's ticket #3256 might also help as she installed ANTS on Monsoon very recently:
http://cms.ncas.ac.uk/ticket/3256#comment:13

comment:2 Changed 10 months ago by pmcguire

Yes, I followed those instructions.
Should I try to repeat the process again?

The file:

/projects/um1/shumlib/shumlib-2020.01.1/meto-xc40-ivybridge-crayftn-8.5.8-craycc-8.5.8/openmp/lib/libshum_spiral_search.so

was made by someone else, but when I look for the iso_c_binding_ variable with nm, it's not there.

When I try to compile the libshum_spiral_search.so shared object library myself, I have the same problem.

The spiral_search and shumlib has to be installed separately for mule.
See:
https://code.metoffice.gov.uk/trac/um/browser/mule/trunk/um_spiral_search/README

Is there somebody else I should talk to about this?
Patrick

comment:3 Changed 10 months ago by ros

Hi Patrick,

If they don't work I think you'll need to contact the metoffice for advice. monsoon at metoffice.gov.uk

Cheers,
Ros.

comment:4 Changed 10 months ago by pmcguire

OK, thanks!
I'll do that.
Patrick

comment:5 Changed 10 months ago by simon

Hi Patrick.

I think what's happening is that there's an issue loading the correct symbols when using cray fortran with gcc to create shared objects. You could tried building shumlib with the vm-x86-gfortran-gcc.mk config and reinstalling ANTS.

Simon.

comment:6 Changed 10 months ago by pmcguire

Hi Simon:
I tried previously to build for myself the shumlib on the external MONSOON. But I had had the same problem when I tried to import ants in python3.7. That's when I looked for prebuilt versions, and this is one of them, presumably built with crayftn and craycc.

/projects/um1/shumlib/shumlib-2020.01.1/meto-xc40-ivybridge-crayftn-8.5.8-craycc-8.5.8/openmp/lib/libshum_spiral_search.so

This one had similar problems to the one I built myself, with a missing iso_c_binding_ variable/module. There are other versions of this library in /projects/um1/shumlib/shumlib-2020.01.1/, built with different compilers, but they all are missing the iso_c_binding_ variable/module.

When I built it for myself, the standard vm-x86-gfortran-gcc.mk didn't work since gfortran doesn't exist with the defaut configuration on the external MONSOON. So I adapted that file to make a vm-ftn-gcc.mk version of it. But maybe the ftn compiler flags that allowed me to compile shum_spiral_search.so need to be adapted further, since there is a missing iso_c_binding_ variable/module even when I build it myself.
Patrick

comment:7 Changed 10 months ago by simon

Hi Patrick,

I've got it working (for me at least) with /projects/um1/shumlib/shumlib-2020.01.1/meto-xc40-haswell-gfortran-6.3.0-gcc-6.3.0.
Try starting python with
LD_PRELOAD=/home/d03/hadsu/um_spiral_search/um_spiral_search.cpython-37m-x86_64-linux-gnu.so:/home/d01/pamcg/anaconda3/envs/ants/lib/libpython3.so python
and then import ants
However, I don't recommend using this method in general, I had to to nasty things to the um_spiral_search.cpython-37m-x86_64-linux-gnu.so shared object (which originally lived in the site-packages area of ants) internal RPATH to get it to work.

Try re-installing ants using /projects/um1/shumlib/shumlib-2020.01.1/meto-xc40-haswell-gfortran-6.3.0-gcc-6.3.0

comment:8 Changed 10 months ago by pmcguire

Hi Simon
This is the most excellent news! Thank you!
I will try it out as soon as Monsoon is turned back on.
Patrick

comment:9 Changed 10 months ago by pmcguire

Hi Simon
I tried it out, and it works! Thank you once again!
I was able to run an ANTSv0.13.0 Rose/Cylc suite on the external MONSOON using this library that you built
/home/d03/hadsu/um_spiral_search/um_spiral_search.cpython-37m-x86_64-linux-gnu.so.
Patrick

comment:10 Changed 10 months ago by simon

Hi Patrick,

Excellent. A couple of things:

1) I suggest having a look at the output ancillaries to see if there are as expected.

2) Rebuilding ants using /projects/um1/shumlib/shumlib-2020.01.1/meto-xc40-haswell-gfortran-6.3.0-gcc-6.3.0 The file under my filespace is actually a copy of a file from your anaconda installation with some nasty hacking to the header in the shared object to get it to work and may not work in all instances. It also protects you if, for some reason, the files in /home/d03/hadsu/um_spiral_search get deleted.

Simon.

comment:11 Changed 10 months ago by simon

  • Resolution set to fixed
  • Status changed from new to closed

Hi Patrick,

I'm closing the ticket. If there's any more problems, let me know.

Simon.

Note: See TracTickets for help on using tickets.