[gmx-users] how to compile and make a C analyzing code under GROMACS 5.0
mark.j.abraham at gmail.com
Mon Jul 28 18:45:34 CEST 2014
On Mon, Jul 28, 2014 at 6:05 PM, qiaobf <qiaobf at gmail.com> wrote:
> Dear Mark,
> Thanks a lot for your kind help. I have corrected the linkages to the
> heading files. However, I got a few more problems:
> 1) The math library is not recognized when compiling. See below for the
> error message. Is there a way to add the flag of "-lm" under cmake? For
> instance, "gcc test.c -lm -o test" works where sqrt is also used.
>> undefined reference to symbol 'sqrt@@GLIBC_2.2.5'
Yes, you can add linker flags using the normal CMake mechanisms. Google's
your friend here, but probably cmake -DCMAKE_EXE_LINKER_FLAGS=-lm might
> 2) If the line with "sqrt" function is commented out, the g_density2 can
> be successfully generated. however, the "./g_density2 -h" is not working to
> display the help contents. Could you please give me some suggestions?
Things change. ;-) If you're deliberately bypassing the new wrapper binary,
then you won't get the functionality it supports, like the new help module
> I am looking forward to your kind help, and appreciate your time!
> best regards,
> On 07/24/2014 04:47 PM, qiaobf wrote:
>> Dear all,
>> Please help me out. Thanks in advance.
>> I had written some analyzing codes, which can be easily compiled under
>> Gromacs 4.5.5. Since I switched to GMX 5.0 weeks ago, I want to re-compile
>> them under GMX5.0. But the GMX5.0 seems quite different from GMX4.5.5.
>> Anyone can help me? Thanks a lot!
>> I have tried the following methods:
>> 1) (a) save the gmx_density2.c under $HOME/programmes/backup/
>> gromacs-5.0/src/gromacs/gmxana, which is the folder to save all the
>> gmx_XXX.c analyzing codes under the distribution folder;
>> (b) re-install the whole package of GMX5.0 (cmake-->make--->make
>> install). I got no error message. All regular analyzing programs are
>> correctly installed, but not the gmx_density2!
>> 2) (a) run "source $HOME/programmes/GROMACS-5.0/bin/GMXRC";
>> (b) save the gmx_density2.c under $HOME/programmes/GROMACS-5.0/share/gromacs/template,
>> which is under the executable folder;
>> (c) modify the content of CMakeList.txt to change "template" to
>> "gmx_density2", and "template.cpp" to "gmx_density2.c";
>> (d) run "cmake .". No error message, and the Makefile and the folder
>> CMakeFiles are created;
>> (e) run "make". Then I get the error message
>>> gmx_density2.c:42:22: fatal error: sysstuff.h: No such file or directory
>>> #include "sysstuff.h"
>>> compilation terminated.
>>> make: *** [CMakeFiles/gmx_density2.dir/gmx_density2.c.o] Error 1
>>> make: *** [CMakeFiles/gmx_density2.dir/all] Error 2
>>> make: *** [all] Error 2
>> best wishes,
> Baofu Qiao
> Department of Materials Science and Engineering,
> Northwestern University
> Tel: 224-420-1019
> Email: qiaobf at gmail.com
> Gromacs Users mailing list
> * Please search the archive at http://www.gromacs.org/
> Support/Mailing_Lists/GMX-Users_List before posting!
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
More information about the gromacs.org_gmx-users