[MINC-users] mni_autoreg compilation failed

Steve ROBBINS minc-users@bic.mni.mcgill.ca
Sat, 20 Dec 2003 07:19:51 -0500


On Fri, Dec 19, 2003 at 03:53:37PM -0500, Andre MATOS wrote:
> Hi,
> 
> I got this error when I was compiling the mni_autoreg-0.98k:
> 
> make[3]: Entering directory 
> `/scratch/amatos/local/mni_source/mni_autoreg-0.98k/minctracc/Optimize'
> if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./../Include -I../../Proglib   
> -Df2cFortran -DNDEBUG -I/scratch/amatos/local/mni/include  -O -MT 
> optimize.o -MD -MP -MF ".deps/optimize.Tpo" \
>   -c -o optimize.o `test -f 'optimize.c' || echo './'`optimize.c; \
> then mv -f ".deps/optimize.Tpo" ".deps/optimize.Po"; \
> else rm -f ".deps/optimize.Tpo"; exit 1; \
> fi
> optimize.c: In function `optimize_linear_transformation':
> optimize.c:732: parse error before `void'
 
 
> Is this related to any required lib?
 
No.

There are two likely possibilities.  First, it is possible that your
copy of mni_autoreg is corrupted.  Try downloading it again and comparing
the two copies of optimize.c using diff.

The second possibility is that declaring a function in the middle of
another function is a nonstandard extension that has been removed.
What does "gcc --version" say?  Does the following patch fix the problem?

 
--- /home/steve/bicsrc/cvs/registration/mni_autoreg/minctracc/Optimize/optimize.c	2003-07-27 11:30:55.000000000 -0400
+++ minctracc/Optimize/optimize.c	2003-12-20 07:14:00.000000000 -0500
@@ -179,6 +179,10 @@
     amoeba_struct  *amoeba );
 
 
+public void normalize_data_to_match_target(Volume d1, Volume m1, Real thresh1,
+                                           Volume d2, Volume m2, Real thresh2,
+                                           Arg_Data *globals);
+
 public void make_zscore_volume(Volume d1, Volume m1, 
 			       Real *threshold); 
 
@@ -729,9 +733,6 @@
 			     __FILE__, __LINE__);
   }    
 
-public void normalize_data_to_match_target(Volume d1, Volume m1, Real thresh1,
-                                           Volume d2, Volume m2, Real thresh2,
-                                           Arg_Data *globals);
 
   /* --------------------------------------------------------------*/
   /* -------- prepare the weighting array for optimization --------*/



-Steve