CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
NIFTI_SYSTEM_MATH_LIB (ADVANCED)
linked by target "ITKniftiio" in directory /home/lorenzo/Desktop/antsInstallExample-master/build/ITKv5/Modules/ThirdParty/NIFTI/src/nifti/niftilib-- Configuring incomplete, errors occurred!
See also "/home/lorenzo/Desktop/antsInstallExample-master/build/ITKv5-build/CMakeFiles/CMakeOutput.log".
See also "/home/lorenzo/Desktop/antsInstallExample-master/build/ITKv5-build/CMakeFiles/CMakeError.log".
make[2]: *** [CMakeFiles/ITKv5.dir/build.make:108: ITKv5-prefix/src/ITKv5-stamp/ITKv5-configure] Error 1
make[2]: Leaving directory '/home/lorenzo/Desktop/antsInstallExample-master/build'
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/ITKv5.dir/all] Error 2
make[1]: Leaving directory '/home/lorenzo/Desktop/antsInstallExample-master/build'
make: *** [Makefile:117: all] Error 2
这个错误让我找了三四天才发现问题
首先网上关于这个错的资料很少
我只在github看到有人求助,但是下面回答给的解决方案是用cmake添加变量
Possible workaround is to add the cmake variable "-D NIFTI_SYSTEM_MATH_LIB= "
我按照这个说法试了半天,但是不清楚是我操作的问题,还是这个解决方案本来就不是很靠谱的问题,根本没有任何改变,反而是我的ANTs下了七八遍,搞得心累
直到我看到一个资料上说ccmake版本更新问题导致他编译报错,联想到我以前安装ANTs并没有出这个问题,因为我以前ccmake是直接指令下载版本都很旧,这次则是被某教程误导去网站上下载了最新的ccmake,故我开始怀疑是版本问题(大坑!!!)
由于网上教程建议不要随便卸载ccmake,可能删除掉一些需要的东西
故我直接重新下了一个低版本的ccmake
wget https://cmake.org/files/v3.12/cmake-3.12.1-Linux-x86_64.sh
sh cmake-3.12.1-Linux-x86_64.sh
sudo apt-get install cmake-curses-gui
然后下载安装ANTs
中间编译的时候我没有SuperBuild_ANTS_USE_GIT_PROTOCOL选项,一开始有点慌,但是作者说这个是与github有关的,我想了下我的网还挺稳定的不担心编译失败就没管(没有的朋友可以按t然后向下找一下,我是真没有,有的纯粹是放后面了)
然后ccmake就可以啦
火速在github上留言,外国佬一开始给的方案巨难搞(对电脑小白来说)贴在下面啦,有需要了解的友友自行查看: