votca / csg

Coarse-graining potentials from atomistic references made easy
26 stars 24 forks source link

GROMACS File Readers #543

Closed JoshuaSBrown closed 2 years ago

JoshuaSBrown commented 4 years ago

@JensWehner you had trouble with gromacs file readers before, did you ever get the problem fixed. I'm getting tones of linker errors now as well.

JoshuaSBrown commented 4 years ago

I'm wondering if all the gmx files now need a refactor.

junghans commented 4 years ago

I'm getting tones of linker errors now as well.

Any details?

JensWehner commented 4 years ago

I had an old version of a gromacs libarray around, which caused those errors. Everything is fine now, it was a user error.

JoshuaSBrown commented 4 years ago

We might need to update cmake,

Found GROMACS: /usr/lib/x86_64-linux-gnu/libgromacs_d.so (found suitable version "2019.6", minimum required is "2018")

Here is a list of the errors

../libcsg/libvotca_csg.so.7: undefined reference to gmx_mtop_t::gmx_mtop_t()' ../libcsg/libvotca_csg.so.7: undefined reference toread_first_frame(gmx_output_env_t const*, t_trxstatus*, char const, t_trxframe, int)' ../libcsg/libvotca_csg.so.7: undefined reference to `open_trx(char const, char const)' ../libcsg/libvotca_csg.so.7: undefined reference to `close_trx(t_trxstatus)' ../libcsg/libvotca_csg.so.7: undefined reference to output_env_init(gmx_output_env_t**, gmx::IProgramContext const&, time_unit_t, bool, xvg_format_t, int)' ../libcsg/libvotca_csg.so.7: undefined reference toread_next_frame(gmx_output_env_t const.,. /t_trxstatuslibcsg/,libvotca_csg.so.7 :t_trxframe undefined) 'reference .to. /libcsggmx_mtop_t/:libvotca_csg.so.7::gmx_mtop_t (undefined) 'reference .to. /libcsggmx_mtop_t/:libvotca_csg.so.7::~ gmx_mtop_tundefined( )reference' to. .`/read_first_framelibcsg(/gmx_output_env_tlibvotca_csg.so.7 :const undefined, referencet_trxstatus to ,` write_trxframechar( t_trxstatusconst,, t_trxframet_trxframe,, gmx_conect_tint*))''

.collect2: error: ld returned 1 exit status ./libcsg/libvotca_csg.so.7: undefined reference to open_trx(char const*, char const*)' ../libcsg/libvotca_csg.so.7: undefined src/tools/CMakeFiles/csg_property.dir/build.make:98: recipe for target 'src/tools/csg_property' failed referencemake[2]: *** [src/tools/csg_property] Error 1 toCMakeFiles/Makefile2:939: recipe for target 'src/tools/CMakeFiles/csg_property.dir/all' failed make[1]: *** [src/tools/CMakeFiles/csg_property.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... close_trx(t_trxstatus)' ../libcsg/libvotca_csg.so.7: undefined reference to `output_env_init(gmx_output_env_t, gmx::IProgramContext const&, time_unit_t, bool, xvg_format_t, int)' ../libcsg/libvotca_csg.so.7: undefined reference to read_next_frame(gmx_output_env_t const*, t_trxstatus*, t_trxframe*)' ../libcsg/libvotca_csg.so.7: undefined reference togmx_mtop_t::~gmx_mtop_t()' ../libcsg/libvotca_csg.so.7: undefined reference to `write_trxframe(t_trxstatus, t_trxframe, gmx_conect_t*)' collect2: error: ld returned 1 exit status src/tools/CMakeFiles/csg_resample.dir/build.make:98: recipe for target 'src/tools/csg_resample' failed make[2]: [src/tools/csg_resample] Error 1 CMakeFiles/Makefile2:976: recipe for target 'src/tools/CMakeFiles/csg_resample.dir/all' failed make[1]: [src/tools/CMakeFiles/csg_resample.dir/all] Error 2

JoshuaSBrown commented 4 years ago

I'll look into this to make sure I'm not doing something wonky with the files in my system library/includes. This passes the ci but I cann't build it locally.

JoshuaSBrown commented 4 years ago

@junghans what versions of gromacs are being used in the ci?

junghans commented 4 years ago

We build against:

JoshuaSBrown commented 4 years ago

There is a problem with the FindGromacs cmake module. Recently the gromacs has switched the api versioning system. Current versions of gromacs are now versioning starting at version 0 which breaks our current cmake module.

JoshuaSBrown commented 4 years ago

Also using the spack gromacs causes problems because it is built with openmpi, gromacs_mpi and libgromacs_mpi need to be added as possible options. I'm working on a solution but welcome feedback.

junghans commented 4 years ago

Also using the spack gromacs causes problems because it is built with openmpi, gromacs_mpi and libgromacs_mpi need to be added as possible options. I'm working on a solution but welcome feedback.

There is something wrong, in spack votca-csg depends on gromacs without mpi: https://github.com/spack/spack/blob/a20ba315f57bcbbb73838d1b67a15a9e14d580cd/var/spack/repos/builtin/packages/votca-csg/package.py#L35

junghans commented 4 years ago

There is a problem with the FindGromacs cmake module. Recently the gromacs has switched the api versioning system. Current versions of gromacs are now versioning starting at version 0 which breaks our current cmake module.

Remember that we have two mechanisms to detect gromacs: https://github.com/votca/csg/blob/master/CMakeLists.txt#L86-L89 First we try gromacs-2021 via cmake config and then <=gromacs-2020 via our custom find module.

junghans commented 4 years ago

Plus whatever you do make sure we can still use gromacs-2018/2019 as this is needed for the coarse-graining part.

JoshuaSBrown commented 4 years ago

First we try gromacs-2021 via cmake config and then <=gromacs-2020 via our custom find module.

I have a question why can't we use the config method for also finding earlier versions?

junghans commented 4 years ago

First we try gromacs-2021 via cmake config and then <=gromacs-2020 via our custom find module.

I have a question why can't we use the config method for also finding earlier versions?

Because it is brocken in earlier versions. I just fixed that recently https://gitlab.com/gromacs/gromacs/-/merge_requests/48

junghans commented 2 years ago

Fixed in #554.