[gmx-developers] pedantic change to gmx_chi.c (3.3.1) suggested

chris.neale at utoronto.ca chris.neale at utoronto.ca
Tue Nov 13 05:55:03 CET 2007

The following change to the source code of 3.3.1 gmx_chi.c was  
required on a new machine on which I have recently compiled the code.  
I believe that the error here is in a perl script that the sysadmin  
has written to wrap 'cc' for equivalent usage on different  
architectures. In any event the change to the source code should not  
hurt gromacs and may avoid a similar problem in the future for other  
users. I do realize that it makes no sense that this affects  
compilation. The difference is removal of a double semicolon in the  
first line and removal of a space before the semicolon in the second  
line. I am not sure which one didn't react well with the in-house 'cc'  
perl script.

$ diff tools/gmx_chi_original.c tools/gmx_chi.c
<   static bool  
<   static real core_frac=0.5 ;
>   static bool  
>   static real core_frac=0.5;

Here is the last few lines of output from the make install command  
before I made the change:


Making install in tools
make[2]: Entering directory `/home/cneale/exe/gromacs-3.3.1/src/tools'
source='gmx_chi.c' object='gmx_chi.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../../config/depcomp \
/bin/sh ../../libtool --tag=CC --mode=compile ccc -DHAVE_CONFIG_H -I.  
-I. -I../../src -I/usr/X11R6/include  -I../../include  
-I/home/cneale/exe/fftw-3.1.2/exec/include  -std1 -fast -O4 -no_ifo  
-arch ev6 -unroll 2 -fp_reorder -c -o gmx_chi.lo gmx_chi.c
  ccc -DHAVE_CONFIG_H -I. -I. -I../../src -I/usr/X11R6/include  
-I/home/cneale/exe/fftw-3.1.2/exec/include -std1 -fast -O4 -no_ifo  
-arch ev6 -unroll 2 -fp_reorder -c gmx_chi.c -o gmx_chi.o
cc: Error: gmx_chi.c, line 1031: Invalid statement. (badstmt)
   static real core_frac=0.5 ;
cc: Error: gmx_chi.c, line 1032: Missing ";". (nosemi)
   t_pargs pa[] = {
cc: Error: gmx_chi.c, line 1033: Invalid expression. (badexpr)
     { "-r0",  FALSE, etINT, {&r0},



Manufacturer: Compaq
Operating system: Red Hat Linux 7.2
Interconnect: Quadrics Elan3

$ gcc --version
$ f77 --version

$which cc
$ ls -l /opt/compile/bin/cc
lrwxrwxrwx    1 root     root            7 Mar  7  2007  
/opt/compile/bin/cc -> compile
$ ls -l /opt/compile/bin/compile
-rwxr-xr-x    1 root     root        13153 Mar  7  2007  

compile is a perl script written in-house by the maintainers of our cluster

$head -30 compile
# wrapper to do several things:
#       - arrange for sensible defaults, since users often forget -O
#       - optionally log compiler usage (timestamp, user, flags)
#       - hide ugly library stuff, especially MPI
#       - address these across different langs, systems, compilers, MPI's.
# the goal is to make it possible for a user to compile everywhere
# without changing their makefile/etc, using the obvious switches.
# they could put all this intelligence in the makefile, and we could
# factor the intelligence into a system-specific make include,
# but putting it in one place and using perl is more powerful.
# records each invocation to syslog.  it is installed with several
# aliases (symlinks in the bin directory) to make it run whenever someone
# uses a generic cc/c++/f77/f90/mpicc/etc command.
# written by XXXXXXX--hidden by C. Neale (without premission)-XXXXX

use strict;
use User::pwent;
use Sys::Syslog;
use Pod::Usage;

=head1 NAME

     compile - compile, with intelligence about language, mpi, etc.



More information about the gromacs.org_gmx-developers mailing list