[MINC-users] minc2 build error -- resolved

EJ Nikelski nikelski at bic.mni.mcgill.ca
Sat Dec 8 14:48:58 EST 2007


Hi Claude,

   Yes, I agree ... I was more than a little surprised when building
the shared hdf5 libraries made the problem disappear.  At any rate,
you put your finger on the *real* problem.  Rebuilding minc2 with the
modified mincconvert.c cleared up my linking error.  Thanks again.

    Now, off to build the rest of the world ...

-Jim



On Dec 6, 2007 6:47 PM, Claude LEPAGE <claude at bic.mni.mcgill.ca> wrote:
> Hi Jim,
>
> It seems odd that your solution actually works given the nature of the problem.
>
> Here is the "real" fix for it: the global variable 'compress' conflicts with
> another variable named 'compress' in libz. This is very bad programming in
> libz; global variables should be protected in a namespace, in my opinion.
> Anyway, try the following in progs/mincconvert/mincconvert.c:
>
> At line 65:
> static int compress = -1;
>
> In fact, all those global variables should have a static in front. That's bad
> programming too. The linker will not fuss anymore.
>
> Andrew: make sure this goes through the next minc-2.0.15 revision. :-)
>
> bye
>
> Claude
>
>
> >    I just found a solution to my rather bizarre error when building
> > minc2 (2.0.14). It manifested as a "multiple definition of `compress'"
> > linkage error.  To summarize, I did the following:
> >
> > (1) Build zlib-1.2.3
> > (2) Build hdf5-1.6.6
> > (3) Build netcdf-3.6.2
> > (4) Build minc-2.0.14
> >
> >   All steps up to the minc2 build looked good -- and the "make
> > check/test" was OK for everything.  The minc2 build (first on Edgy,
> > then on Feisty) failed with the abovementioned link error.
> >
> > Solution:  Build hdf5 *with* the shared libraries enabled. Nope, dunno
> > why this should make a difference, but it absolutely does (for 1.6.6,
> > anyway).  So, my build options for hdf5 look like this -
> >
> > ./configure
> >     --prefix=/data/raid01/quarantine/Dec2007/minc2
> >     --with-zlib=/data/raid01/quarantine/Dec2007/minc2
> >     --enable-static-exec
> >
> > Note the you can still build statically linked executables without any
> > problem. Only the use of the "--disable-shared" option causes
> > problems.  Without  this option all is well, ... even the "make check"
> > runs to completion when the run_tests.sh & run_test2.sh test scripts
> > are corrected (the list assigned to $tests needs to be quoted).
> >
> > Hope this helps.
> >
> > Cheers,
> >
> > Jim
> > _______________________________________________
> > MINC-users at bic.mni.mcgill.ca
> > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
> >
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>



-- 
=================================
Jim Nikelski, Ph.D.
Postdoctoral Research Fellow
Bloomfield Centre for Research in Aging
Lady Davis Institute for Medical Research
Sir Mortimer B. Davis - Jewish General Hospital
McGill University
Tel: (514) 340-8222 x 2298
Fax: (514) 340-8295


More information about the MINC-users mailing list