BIC-MNI / minc-toolkit

Metaproject uniting all the available minc tools
GNU General Public License v3.0
37 stars 15 forks source link

build NIFTI fails with zlib.h not found (1.0.08) #40

Open mcvaneede opened 8 years ago

mcvaneede commented 8 years ago

I'm trying to build version 1.0.08 on Ubuntu 16.04. During the installation procedure, ZLIB is build, but when NIFTI is being compiled, the following error occurs:

[  3%] Performing build step for 'NIFTI'
-- Configuring done
-- Generating done
-- Build files have been written to: /axiom2/projects/software/arch/linux-xenial-xerus/src/minc-toolkit-build/NIFTI-build
[  6%] Building C object znzlib/CMakeFiles/znz.dir/znzlib.c.o
In file included from /axiom2/projects/software/arch/linux-xenial-xerus/src/minc-toolkit-build/NIFTI/znzlib/znzlib.c:24:0:
/axiom2/projects/software/arch/linux-xenial-xerus/src/minc-toolkit-build/NIFTI/znzlib/znzlib.h:62:18: fatal error: zlib.h: No such file or directory
 #include "zlib.h"
                  ^
compilation terminated.

Somehow the proper include directories to compile NIFTI are not added in its CMakeLists.txt file. Any clue why that it?

Some sytem information: Ubuntu 16.04 cmake 3.5.1 g++ 4.9.3 gcc 4.9.3

gdevenyi commented 5 years ago

Resurrecting a long dead issue, with #54 and #53 solved, I now run into this.

Given the error and how broken the cmake is in NIFTILIB 2.0 was, I suspect this is the fix: https://github.com/BIC-MNI/minc-toolkit-v2/blob/develop-1.9.17/cmake-modules/BuildNIFTI.cmake#L62-L63

But perhaps we can just pull over the whole BuildNIFTI.cmake from minc-toolkit-v2?

What do you think @vfonov ?

vfonov commented 5 years ago

yes, you can backport it

gdevenyi commented 5 years ago

Fixed by #55