MED and MEDCOUPLING depend on each other

Hi, It seems both git packages depend on each other. How is one supposed to build them? Micromed in med coupling doesn’t remove the medfile requirement. But med needs medcoupling in order to compile.

Many thanks

Can someone weigh in on this? It would be quite good as various packages depend on MED. There is nothing on the compile scripts in sat_salome.

Can you tell what you mean with MED? Do you mean this repository med.git ?
If yes, this is FIELDS module which for historical reasons was named MED.
MEDCOUPLING depends upon medfile which sources are available at this link:medfile-4.1.1

Hi. Yes I am working with med and medcoupling from git. The medfile link doesnt work.

the medfile can be retrieved from the ftp repository link I shared in my reply. Indeed SAT will fetch it from this ftp repository.

cc: @cbourcier

The link doesnt work for me unfortunately :confused:

try:

curl ftp://ftp.cea.fr/pub/salome/prerequisites/med-4.1.1.tar.gz  -o med-4.1.1.tar.gz

Ok thank you. Where do you get XDR from?

you mean xdr.h ? If so, in principle it is shipped by:

  • Fedora, etc…: libtirpc-devel => /usr/include/tirpc/rpc/xdr.h
  • Debian, Ubuntu, …: libtirpc-dev: /usr/include/tirpc/rpc/xdr.h

you can run dnf whatprovides */rpc/xdr.h or apt-file find *rpc/xdr.h to search for this file.

1 Like

This does not compile with hdf5 1.10.2 1.10.9 1.12.2 or 1.14.3…

latest error is the following.

med-4.1.1/src/hdfi/_MEDattributeNumWrByName.c: In function ‘_MEDattributeNumWrByName’:
/include/H5version.h:921:23: error: too few arguments to function ‘H5Oget_info3’
  921 |   #define H5Oget_info H5Oget_info3

Does an ubuntu binary exist?

You need to patch medfile. See here how you can implement it.
Then, if you think this could be useful to other SALOME users, you can ask to have it integrated in SAT_SALOME by opening a pull request on GitHub!

Sure I think it should be part of the git package and that ultimately a super package needs to be created that pulls everything together.

medfile 4.1.1 does not compile despite the patch. On the salome website one may find medfile 5.0.0 which has a typo in MEDfileCompatibility.c on line 118

the compilation error found now is the following with hdf5 1.12.3

libtool: link: g++ -g -O2 -o .libs/mdump3 mdump3.o MED23meshIterators.o MED23fieldIterators.o

/usr/bin/ld: ../../src/.libs/libmed.so: undefined reference to `compress2'
/usr/bin/ld: ../../src/.libs/libmed.so: undefined reference to `inflate'
/usr/bin/ld: ../../src/.libs/libmed.so: undefined reference to `inflateInit_'
/usr/bin/ld: ../../src/.libs/libmed.so: undefined reference to `inflateEnd'

I am not sure what this means. Any help would be much appreciated. I would be happy to post things to the github.

You seem to be missing zlib. Are you using SAT to build MEDCOUPLING ?
Note that MEDCOUPLING native description files are available in SAT_SALOME GitHub repository.

Hi,

I fixed it by exporting the -lzib in the enviroment variable suggested by the configure script and changed the cc compiler to clang as gcc13 caused various compile issues.

I am getting the following error with MEDCOUPLING

/medcoupling/src/MEDLoader/MEDFilterEntity.hxx:102:66: error: cannot convert ‘long int*’ to ‘const med_int*’ {aka ‘const int*’}
  102 |                           ToMedInt(nbOfEltsToLoad), dpdPlus1.data(),
      |                                                     ~~~~~~~~~~~~~^~
      |                                                                  |
      |                                                                  long int*

Has this got something to do with MED_MEDINT_TYPE in the medfile CMakeLists ?
I see no mention of this configuration in MEDCOUPLING-9.13.0-native.pyconf
Many thanks. I have succesfully used medfile to build freecad also with MPI disabled in hdf

seems you mixed types here.
have a look at medfile compilation script (link) as well as medcoupling compilation options (link).
again, better use SAT which ensures options between these two products are consistent with each other.

I used the environment configs for medfile in the script and now I am here. The Medcoupling script doesnt seem to change anything compared to default cmakelist options.

medcoupling/src/MEDLoader/MEDFileEquivalence.cxx:213:133: error: cannot convert ‘int*’ to ‘med_int*’ {aka ‘long int*’}
  213 |       MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,da->getPointer()));
      |                                                                                                                       ~~~~~~~~~~~~~~^~
      |                                                                                                                                     |
      |                                                                                                                                     int*

There is a nominal approach used to compile medfile+medcouping and it is implemented in SAT.
I don’t understand why you don’t use this nominal approach.

If you want some assistance, you need to describe what you are doing step by step (version of medfile, version of hdf5, operating system, compiler, compilation options, etc.).

Regards

I need to link other programs with these tools so I would prefer to have understanding and control over the process, versions and install locations.

In case it helps anyone metis needs to built with 32 bit signed int and you may need to add “z” in target link libraries in the src for MEDLoader and one other component and add FIND_PACKAGE(ZLIB REQUIRED) in the main CMakeLists.txt