How to use MEI in 2.0-rc1

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
salad

How to use MEI in 2.0-rc1

Post by salad »

Hi,
I want to try the MEI in 2.0-rc1. I tried but found, for example, on the 'Fluid properties' page of the GUI, the 'user law' option is still grey, and as such I cannot click the following button either.
I newly compiled and installed 2.0-rc1. The install procedure was recorded into my post 'http://code-saturne.blogspot.com/2010/03/installation-of-codesaturne-20-rc1-on.html'
I compiled MEI in and I am not sure whether I need to configure anything more to enable the MEI options.
 
Many thanks in advance.
Best regards,
Wayne
Brennan Sharp

Re: How to use MEI in 2.0-rc1

Post by Brennan Sharp »

When I build mei, I told the configure script explicitly where to find the bft installation. If I remember correctly, the script didn't find it, and said so while running. although I'm not sure whether the compilation will fail without bft.
 
i.e. ./configure --with-bft=$INSTALLROOT  
My $INSTALLROOT is /usr or /usr/local depending on how I'm installing.
David Monfort

Re: How to use MEI in 2.0-rc1

Post by David Monfort »

Hello Wayne,

The graphical interface needs to find the Python module mei to enable the definition of user law from itself. You may need to provide Code_Saturne configure with the following option to ensure it (the Python module) is properly found: --with-mei=/usr/local (like for the preprocessor).

Actually, I've never installed the code without specifying a --prefix option for the different packages, so I don't know which options to give...

Let me know if it works (or not...) and if not, could you attach the result of the command code_saturne config ? And perhaps also, the result of locate _mei.so (with underscore), if any.

David

ps : I'll look read more thoroughly your guide asap and provide you with some feedback pps: I don't think you can compile MEI without BFT in this specific version of the library ; here, the BFT library may be found thanks to ldconfig, but perhaps not the Python module
salad

Re: How to use MEI in 2.0-rc1

Post by salad »

Hi,
 
Thanks for your help :)
 
I used ./configure
to configure mei without specifying anything, but it seems it can find the bft, because of the output saying
 
...
checking for library containing pow... -lm
checking for bft version >= "1.0.0"... compatible bft version found
checking for ANSI C header files... (cached) yes
...
 
 
I didn't specify the mei location when ./configure ncs, because for the first time when I didn't have mei compiled and installed, the ./configure complained about the absence of mei. Please see the piece, from the config.log
of ncs, below, and I think ncs found mei and would use it.
 
...
configure:15854: checking mei_evaluate.h usability
configure:15854: gcc -c -std=c99 -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal    -D_POSIX_SOURCE -DNDEBUG    conftest.c >&5
configure:15854: $? = 0
configure:15854: result: yes
configure:15854: checking mei_evaluate.h presence
configure:15854: gcc -E   -D_POSIX_SOURCE -DNDEBUG    conftest.c
configure:15854: $? = 0
configure:15854: result: yes
configure:15854: checking for mei_evaluate.h
configure:15854: result: yes
configure:15861: checking for mei_evaluate in -lmei
configure:15886: gcc -o conftest -std=c99 -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal    -D_POSIX_SOURCE -DNDEBUG    -Wl,-export-dynamic  -O    conftest.c -lmei    -lmei -lbft >&5
conftest.c:46: warning: function declaration isn't a prototype
conftest.c:49: warning: function declaration isn't a prototype
configure:15886: $? = 0
configure:15895: result: yes
...
 
The output of code_saturne config
is
 
$ code_saturne config
Directories:
  dirs.prefix = /usr/local
  dirs.exec_prefix = /usr/local
  dirs.bindir = /usr/local/bin
  dirs.includedir = /usr/local/include
  dirs.libdir = /usr/local/lib
  dirs.datarootdir = /usr/local/share
  dirs.datadir = /usr/local/share
  dirs.pkgdatadir = /usr/local/share/ncs
  dirs.docdir = /usr/local/share/doc/ncs
  dirs.pdfdir = /usr/local/share/doc/ncs
 
Auxiliary information:
  dirs.ecs_bindir = /usr/local/bin
  dirs.syrthes_prefix =
 
MPI library information:
  mpi_lib.type = OpenMPI
  mpi_lib.bindir = /usr/lib/openmpi/bin
  mpi_lib.libdir = /usr/lib/openmpi/lib
 
Compilers and associated options:
  cc = gcc
  fc = gfortran
  cppflags =   -D_POSIX_SOURCE -DNDEBUG      -I/usr/lib/openmpi/include -I/usr/include/libxml2
  cflags = -std=c99 -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal   -funroll-loops -O2 -Wuninitialized -march=i686
  fcflags = -x f95-cpp-input -Wall -Wno-unused  -D_CS_FC_HAVE_FLUSH  -O
  ldflags =         -L/usr/lib/openmpi/lib   -Wl,-export-dynamic  -O
  libs = -lfvm -lm  -lmedC -lhdf5 -lfvm_coupl -lmei -lbft -lz -lmpi  -lxml2 -lcblas -latlas  -L/usr/lib/gcc/i486-linux-gnu/4.4.1 -L/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.4.1/../../.. -L/usr/lib/i486-linux-gnu -lgfortranbegin -lgfortran -lm   -ldl
  rpath = -Wl,-rpath -Wl,
 
Compilers and associated options for SYRTHES build:
  cc =
  fc =
  cppflags =
  cflags =
  fcflags =
  ldflags =
  libs = 
 
The output of locate _mei.so
is (/home/salad is my user home directory and mei-1.0.1 is the source code location, from which I compile and install mei)
 
$ locate _mei.so
/home/salad/saturne/mei-1.0.1/swig/.libs/_mei.so
/home/salad/saturne/mei-1.0.1/swig/.libs/_mei.so.0
/home/salad/saturne/mei-1.0.1/swig/.libs/_mei.so.0.0.0
/home/salad/saturne/mei-1.0.1/swig/.libs/_mei.so.0.0.0T
/usr/local/lib/python2.6/dist-packages/mei/_mei.so
/usr/local/lib/python2.6/dist-packages/mei/_mei.so.0
/usr/local/lib/python2.6/dist-packages/mei/_mei.so.0.0.0
 
Anyway, as you advised, I will try to compile mei again with specifying bft. If problem is solved, I will report here :)
 
Many thanks again.
 
Wayne
 
ps : Take your time and thanks a lot for your time on the posts :p
salad

Re: How to use MEI in 2.0-rc1

Post by salad »

Hi,

I just re ./configure and compile the MEI and ncs souce codes and found the problem has been solved.

Firstly, I specified --with-bft=/usr/local for mei. (I use /usr/local for all self compiled software)

Then I compiled ncs again without specifying mei location. I thought ncs could find it, because the output said
...
Configuration options:  use debugging code: false  use graphical user interface: yes  MPI (Message Passing Interface) support: yes  OpenMP support: no  BLAS (Basic Linear Algebra Subprograms) support: yes  Libxml2 (XML Reader) support: yes  MEI (Mathematical Expressions Interpreter) support: yes  SYRTHES 3 coupling support: no  IP socket support (for SYRTHES 3 or CFD_Proxy): yes  Dynamic loader support (for YACS): yes
...
However as you predicted, the problem was still there.

Finally I specified --with-mei=/usr/local and re-compiled the source code again. I could then use the option 'user law' and open the edit dialog.

I will try to use the function tonight since my example case is saved at home.

Many thanks for all your help.

Wayne
David Monfort

Re: How to use MEI in 2.0-rc1

Post by David Monfort »

Great !

Actually, you don't need to precise anything like --with-bft or --with-mei as long as what you are looking for is only the dynamic libraries (libmei.so and libbft.so). And this is indeed what says the ncs configure output:

MEI (Mathematical Expressions Interpreter) support: yes  <=>  cs_solver can read XML file with formulae thanks to the libmei.so library

But, the other side of MEI is _mei.so and its companion mei.py (the Python module). These ones are handled differently, and obviously not found by the standard method (see the code of the "code_saturne" script) when not specifying --with-mei.

Anyway, now it seems to work ;)

David
salad

Re: How to use MEI in 2.0-rc1

Post by salad »

Hi,

Thanks to your help, I finished another post on MEI.
MEI is easy to use and works like a charm!
 
Please read when you have time and any comments are welcome.
 
Wayne
http://code-saturne.blogspot.com/
 
David Monfort

Re: How to use MEI in 2.0-rc1

Post by David Monfort »

Hi Wayne,

Nice feedback again ;) No specific comment here... everything's fine. Just keep playing with MEI in the different available places :)

David
Post Reply