5.1 Compilation problems with PLUMED
Keywords: user_guide

Next: About this document ... Up: 5 Troubleshooting Previous: 5 Troubleshooting Contents
Subsections

- - 5.1.0.1 xlc compiler
  - 5.1.0.2 Calling C from fortran

## 5.1 Compilation problems with `PLUMED`

#### 5.1.0.1 xlc compiler

If you get an error message like:

    Operation between types "char**" and "int" is not allowed.

change in file `clib/metadyn.h`

    #define snew(ptr,nelem) (ptr)= (nelem==0 ? NULL : (typeof(ptr)) calloc(nelem, sizeof(*(ptr))))
    #define srenew(ptr,nelem) (ptr)= (typeof(ptr)) realloc(ptr,(nelem)*sizeof(*(ptr)))

with

    #define snew(ptr,nelem) (ptr)= (nelem==0 ? NULL : (void*) calloc(nelem, sizeof(*(ptr))))
    #define srenew(ptr,nelem) (ptr)= (void*) realloc(ptr,(nelem)*sizeof(*(ptr)))

#### 5.1.0.2 Calling C from fortran

PLUMED assumes that fortran compilers add a single `_` at the end of C routines. You may get an error message as :

    ERROR: Undefined symbol: .init_metadyn
    ERROR: Undefined symbol: .meta_force_calculation

eliminate the `_` from the definition of init_metadyn and meta_force_calculation, i. e. change at line 529

    void meta_force_calculation_(real *cell, int *istep, real *xxx, real *yyy, real *zzz,

with

    void meta_force_calculation(real *cell, int *istep, real *xxx, real *yyy, real *zzz,

, and at line 961

      void init_metadyn_(int *atoms, real *ddt, real *mass,
      void init_metadyn_(int *atoms, real *ddt, real *mass,