DTITK Source Code on 64 bit Linux

352 views
Skip to first unread message

mjirjis

unread,
May 4, 2012, 4:29:48 PM5/4/12
to DTI-TK
Hi,

I am having trouble making dtitk on a 64 bit ubuntu linux computer. I
have gone through and compiled VTK (5.10.0) and ITK (3.20.1) from
source with no issues. Following the instructions online I have gone
through and created rel.build, ran cmake without any issues. When
running make afterwords I get the following problem, found below.

As far as trouble shooting I have tried compiling ITK with and without
ITK_USE_SYSTEM_ZLIB, and I have tried compiling on another 64 bit
ubuntu computer. Looking through the source code and make files, I
feel like it should work, it is referencing the right location for
zlib libraries and path and in a normal znzlib reference there is the
proper -lz at the end of the compiling line.

I am probably missing something simple, do you have any suggestions?

[ 51%] Building CXX object applications/ctbss/CMakeFiles/
medialScalarField.dir/medialScalarField.cxx.o
Linking CXX executable ../../bin/medialScalarField
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzopen':
znzlib.c:(.text+0x92): undefined reference to `gzopen'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzdopen':
znzlib.c:(.text+0x181): undefined reference to `gzdopen'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `Xznzclose':
znzlib.c:(.text+0x1f5): undefined reference to `gzclose'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzread':
znzlib.c:(.text+0x2bd): undefined reference to `gzread'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzwrite':
znzlib.c:(.text+0x3e1): undefined reference to `gzwrite'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzseek':
znzlib.c:(.text+0x4cd): undefined reference to `gzseek'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzrewind':
znzlib.c:(.text+0x52e): undefined reference to `gzseek'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znztell':
znzlib.c:(.text+0x57e): undefined reference to `gztell'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzputs':
znzlib.c:(.text+0x5d4): undefined reference to `gzputs'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzgets':
znzlib.c:(.text+0x637): undefined reference to `gzgets'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzflush':
znzlib.c:(.text+0x690): undefined reference to `gzflush'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzeof':
znzlib.c:(.text+0x6db): undefined reference to `gzeof'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzputc':
znzlib.c:(.text+0x72e): undefined reference to `gzputc'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzgetc':
znzlib.c:(.text+0x77e): undefined reference to `gzgetc'
/usr/local/dtitk/rel.build/CMakeExternals/Install/NIFTI/lib/
libznz.a(znzlib.o): In function `znzprintf':
znzlib.c:(.text+0x91c): undefined reference to `gzprintf'
collect2: ld returned 1 exit status
make[2]: *** [bin/medialScalarField] Error 1
make[1]: *** [applications/ctbss/CMakeFiles/medialScalarField.dir/all]
Error 2
make: *** [all] Error 2

Hui Zhang

unread,
May 5, 2012, 12:09:51 AM5/5/12
to dt...@googlegroups.com
I have seen this problem before. I don't understand why it happens in
the first place. I think I fixed it by appending "-lz" to the linker
command in the ccmake dialog, or something along this line.

Gary

mjirjis

unread,
May 6, 2012, 7:37:29 PM5/6/12
to DTI-TK
Hi Gary,

I managed to figure out a fix for the issue I was having.
It seems that with my ubuntu platform (11.10) the libz.so file is
stored in /usr/lib/x86_64-linux-gnu/

I ended up going to rel.build/applications/ctbss/CMakeFiles/
medialScalarField.dir/
and then editing link.txt to include "/usr/lib/x86_64-linux-gnu/
libz.so"

This allowed me to proceed on in the make process, I did have to add
the same line to other applications (affine3dshapeaverage, asvcgm,
etc...)

That was the only issue though. I managed to make it the entire way
through make and successfully install after it.

Hopefully this will help anyone else that runs into this issue.

Thanks,

Michael

On May 4, 11:09 pm, Hui Zhang <garyhuizh...@gmail.com> wrote:
> I have seen this problem before. I don't understand why it happens in
> the first place.  I think I fixed it by appending "-lz" to the linker
> command in the ccmake dialog, or something along this line.
>
> Gary
>

Hui Zhang

unread,
May 8, 2012, 1:52:05 AM5/8/12
to dt...@googlegroups.com
Hi Michael,

Thanks very much for sharing this.  Glad you are able to compile the code yourself.

Gary
Reply all
Reply to author
Forward
0 new messages