difficulty compiling plumed with matheval

1,023 views
Skip to first unread message

Chris Neale

unread,
Jul 18, 2016, 7:47:57 PM7/18/16
to PLUMED users
Dear Users:

I am trying to compile plumed with matheval. I want this so that I can multiply two variable together and then use the produce in metadynamics. Below is my compile script:

module purge
module load slurm/14.11.6 hdf5/1.6.10 gcc/5.1.0

export CC=gcc
export CXX=c++

export CPPFLAGS="-I/home/cneale/exec/LIBTOOL/libtool-2.4.6/exec/include -I/home/cneale/exec/UNISTRING/libunistring-0.9.6/exec/include -I/home/cneale/exec/GUILE/guile-1.8.8/exec/include -I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include"
export LDFLAGS="-L/home/cneale/exec/LIBTOOL/libtool-2.4.6/exec/lib -L/home/cneale/exec/UNISTRING/libunistring-0.9.6/exec/lib -I/home/cneale/exec/GUILE/guile-1.8.8/exec/lib -L/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib"
export PKG_CONFIG_PATH=/home/cneale/exec/FFI/libffi-3.2.1/exec/lib/pkgconfig:/home/cneale/exec/LIBGC/gc-7.4.4/exec/lib/pkgconfig

mkdir exec
./configure  --prefix=$(pwd)/exec --enable-matheval=yes 


################################


But the output from configure looks like this:

checking matheval.h usability... yes
checking matheval.h presence... yes
checking for matheval.h... yes
checking for evaluator_create... no
checking for evaluator_create in -lmatheval... no
configure: WARNING: cannot enable __PLUMED_HAS_MATHEVAL


################################

The matheval compilation looks good to me:

$ ls -ltr /home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib/
total 392
drwxrwxr-x 2 cneale cneale   4096 Jul 18 15:59 pkgconfig
-rwxr-xr-x 1 cneale cneale 139849 Jul 18 15:59 libmatheval.so.1.0.0
lrwxrwxrwx 1 cneale cneale     20 Jul 18 15:59 libmatheval.so.1 -> libmatheval.so.1.0.0
lrwxrwxrwx 1 cneale cneale     20 Jul 18 15:59 libmatheval.so -> libmatheval.so.1.0.0
-rwxr-xr-x 1 cneale cneale   1098 Jul 18 15:59 libmatheval.la
-rw-r--r-- 1 cneale cneale 238178 Jul 18 15:59 libmatheval.a

$ ls -ltr /home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include/
total 4
-rw-r--r-- 1 cneale cneale 3937 Jul 18 15:59 matheval.h


though I have to confess that I couldn't get matheval to compile the tests (problems with guile) so I just took those instructions out of the matheval Makefile. I should also clarify that I'm compiling this on a machine where I don't have root access so no package manager so I had to compile guile, libtool, libunistring, libffi, and libgc to get matheval to compile (which sure is a lot of compiling to get a plumed script to multiply two numbers together!)

davide branduardi

unread,
Jul 19, 2016, 3:02:42 AM7/19/16
to plumed...@googlegroups.com
Hi

I paste here a mail from the libmatheval developer, Aleksandar Samardzic,  that he sent me so to compile matheval without Guile. It was in some thread a while ago. I'll repost here as a refresher. I am not sure this still holds but maybe useful for you in understanding if your matheval setup is ok.
Cheers

D


"Hello Davide, 
Thanks for your feedback. 
In libmatheval, Guile is used for test suite only, so it's relatively 
easy to manually get rid of it.  In order to do so, you should checkout 
libmatheval source: 
    hg clone http://hg.sv.gnu.org/hgweb/libmatheval/ 
Then you should change to newly created libmatheval directory, create 
"m4" subdirectory in-there, and then: 
  - in configure.in file, comment out (or delete) line "GUILE_FLAGS", 
    and also three lines following "Additional Guile feature checks." 
    comment line 
  - in tests/Makefile.am file, comment out (or delete) lines: 
    noinst_PROGRAMS = matheval 
    matheval_SOURCES = matheval.c 
    matheval_CFLAGS = $(GUILE_CFLAGS) 
    matheval_LDADD = $(top_builddir)/lib/libmatheval.la 
    matheval_LDFLAGS = $(GUILE_LDFLAGS) 
Then you can build the code: 
   autoreconf -fi 
   ./configure 
   make 
and then create your own libmatheval source code distribution tarball: 
   make dist 
Everything is going to work as usual, except for "make check" - it will 
report errors as this way libmatheval Guile interface is missing. 
"

******************************************************
Davide Branduardi
davide.b...@gmail.com
Web:
https://sites.google.com/site/davidebranduardi
******************************************************

--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at https://groups.google.com/group/plumed-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/1c8f6ac7-a9a4-4cf5-b13a-60f13970043a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Neale

unread,
Jul 19, 2016, 11:54:06 AM7/19/16
to PLUMED users
Dear Davide:

this is awesome, thank you!

Still, I can not compile plumed with matheval:

checking matheval.h usability... yes
checking matheval.h presence... yes
checking for matheval.h... yes
checking for evaluator_create... no
checking for evaluator_create in -lmatheval... no
configure: WARNING: cannot enable __PLUMED_HAS_MATHEVAL

And that was configured like this:

module purge
module load slurm/14.11.6 hdf5/1.6.10 gcc/5.1.0
export CC=gcc
export CXX=c++
export CPPFLAGS="-I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include"
export LDFLAGS="-L/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib"
mkdir exec
./configure  --prefix=$(pwd)/exec --enable-matheval=yes 

Is the version of matheval that I am using perhaps not supported?

Thank you,
Chris.

Chris Neale

unread,
Jul 26, 2016, 5:26:56 PM7/26/16
to PLUMED users
Can anybody provide detailed instructions for compilation of plumed 2.2.3 with matheval (ideally including the matheval version you used)?

Here is how I build plumed:

module purge
module load slurm/14.11.6 hdf5/1.6.10 gcc/5.1.0
export CC=gcc
export CXX=c++
export CPPFLAGS="-I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include"
export LDFLAGS="-L/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib"
mkdir exec
./configure  --prefix=$(pwd)/exec --enable-matheval=yes 
make -j8
make install -j8

and config.log has:

...

configure:5882: checking matheval.h usability
configure:5882: c++ -c -O -fPIC -Wall -pedantic -ansi -I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include conftest.cpp >&5
configure:5882: $? = 0
configure:5882: result: yes
configure:5882: checking matheval.h presence
configure:5882: c++ -E -I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include conftest.cpp
configure:5882: $? = 0
configure:5882: result: yes
configure:5882: checking for matheval.h
configure:5882: result: yes
configure:5885: checking for evaluator_create
configure:5885: c++ -o conftest -O -fPIC -Wall -pedantic -ansi -I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include -L/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib conftest.cpp -ldl  >&5
/tmp/ccZG41Pi.o: In function `main':
conftest.cpp:(.text+0x5): undefined reference to `evaluator_create'
collect2: error: ld returned 1 exit status
configure:5885: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "PLUMED"
| #define PACKAGE_TARNAME "plumed"
| #define PACKAGE_VERSION "2"
| #define PACKAGE_STRING "PLUMED 2"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __PLUMED_HAS_MOLFILE_PLUGINS 1
| /* end confdefs.h.  */
| /* Define evaluator_create to an innocuous variant, in case <limits.h> declares evaluator_create.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define evaluator_create innocuous_evaluator_create
|
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char evaluator_create (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
|
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|
| #undef evaluator_create
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char evaluator_create ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_evaluator_create || defined __stub___evaluator_create
| choke me
| #endif
|
| int
| main ()
| {
| return evaluator_create ();
|   ;
|   return 0;
| }
configure:5885: result: no
configure:5889: checking for evaluator_create in -lmatheval
configure:5914: c++ -o conftest -O -fPIC -Wall -pedantic -ansi -I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include -L/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib conftest.cpp -lmatheval  -ldl  >&5
/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib/libmatheval.so: undefined reference to `yywrap'
collect2: error: ld returned 1 exit status
configure:5914: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "PLUMED"
| #define PACKAGE_TARNAME "plumed"
| #define PACKAGE_VERSION "2"
| #define PACKAGE_STRING "PLUMED 2"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __PLUMED_HAS_MOLFILE_PLUGINS 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char evaluator_create ();
| int
| main ()
| {
| return evaluator_create ();
|   ;
|   return 0;
| }
configure:5923: result: no
configure:5940: WARNING: cannot enable __PLUMED_HAS_MATHEVAL

...


Thanks for the help!
Chris.

Chris Neale

unread,
Jul 26, 2016, 7:00:26 PM7/26/16
to PLUMED users
Solved. Had to compile flex because although I had the binary on this cluster I did not have the libraries. After that:

module purge
module load slurm/14.11.6 hdf5/1.6.10 openmpi/gcc/64/1.8.5
## can not compile the CUDA with gcc version > 4.9 so dont use gcc 5.1 for this version of plumed
export CC=mpicc
export CXX=mpic++
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib:/home/cneale/exec/FLEX/flex-2.6.0/exec/lib
mkdir exec
./configure  --prefix=$(pwd)/exec --enable-matheval=yes LDFLAGS="-L/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/lib -L/home/cneale/exec/FLEX/flex-2.6.0/exec/lib" CPPFLAGS=-I/home/cneale/exec/MATHEVAL/libmatheval-1.1.11/exec/include LIBS="-lmatheval -lfl"
make -j8
make install -j8


Reply all
Reply to author
Forward
0 new messages