[MINC-users] minc2 build error -- resolved

Claude LEPAGE claude at bic.mni.mcgill.ca
Thu Dec 6 18:47:26 EST 2007


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
> 


More information about the MINC-users mailing list