您的位置:首页 > 其它

Ubuntu下运行HUGS程序,遇见的各种问题

2018-03-22 14:47 429 查看

Ubuntu 编译     ITK 库 : ubuntu编译 ITK 库

失败

[ 30%] Building CXX object Utilities/DICOMParser/CMakeFiles/ITKDICOMParser.dir/DICOMSource.o
[ 30%] Building CXX object Utilities/DICOMParser/CMakeFiles/ITKDICOMParser.dir/DICOMBuffer.o
[ 30%] Building CXX object Utilities/DICOMParser/CMakeFiles/ITKDICOMParser.dir/DICOMFile.o
[ 30%] Building CXX object Utilities/DICOMParser/CMakeFiles/ITKDICOMParser.dir/DICOMParser.o
[ 30%] Building CXX object Utilities/DICOMParser/CMakeFiles/ITKDICOMParser.dir/DICOMAppHelper.o
[ 30%] Linking CXX shared library ../../bin/libITKDICOMParser.so
[ 30%] Built target ITKDICOMParser
Scanning dependencies of target itkvcl
[ 30%] Building CXX object Utilities/vxl/vcl/CMakeFiles/itkvcl.dir/vcl_deprecated.o
In file included from /home/hadoop/software/HUGS/ITK/ITK_3201/Utilities/vxl/vcl/vcl_iosfwd.h:8:0,
from /home/hadoop/software/HUGS/ITK/ITK_3201/Utilities/vxl/vcl/vcl_iostream.h:28,
from /home/hadoop/software/HUGS/ITK/ITK_3201/Utilities/vxl/vcl/vcl_deprecated.cxx:4:
/home/hadoop/software/HUGS/ITK/ITK_3201/Utilities/vxl/vcl/vcl_compiler.h:123:4: error: #error "Dunno about this gcc"
#  error "Dunno about this gcc"
^
Utilities/vxl/vcl/CMakeFiles/itkvcl.dir/build.make:62: recipe for target 'Utilities/vxl/vcl/CMakeFiles/itkvcl.dir/vcl_deprecated.o' failed
make[2]: *** [Utilities/vxl/vcl/CMakeFiles/itkvcl.dir/vcl_deprecated.o] Error 1
CMakeFiles/Makefile2:1162: recipe for target 'Utilities/vxl/vcl/CMakeFiles/itkvcl.dir/all' failed
make[1]: *** [Utilities/vxl/vcl/CMakeFiles/itkvcl.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

问题: 我的GCC和G++与 ITK3.20.1 版本不容(百度不行,github才有)

解决方法: GCC编译器安装与切换

编译 HUGS 出错:

hadoop@Master:~/software/HUGS/HUGS_CMAKE_RELEASE$ sudo make
[sudo] password for hadoop:
[ 50%] Linking CXX executable HUGS
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `itkdicomparser::DICOMAppHelper::GetBodyParts(std::vector<std::string, std::allocator<std::string> >&)'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `itkdicomparser::DICOMAppHelper::GetScanOptions(std::vector<std::string, std::allocator<std::string> >&)'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `itkdicomparser::DICOMParser::OpenFile(std::string const&)'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `gdcm::GDCM_BINLOADED'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `gdcm::Util::CreateUniqueUID(std::string const&)'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `gdcm::File::GetPixelType()'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `itksys::SystemTools::GetFilenameName(std::string const&)'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKCommon.so: undefined reference to `itksys::SystemTools::GetCurrentDateTime(char const*)'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `itksys::SystemTools::GetLastSystemError()'
/home/hadoop/software/HUGS/InsightToolkit-3.20.1/bin/bin/libITKIO.so: undefined reference to `gdcm::DictSet::GetDict(std::string const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/HUGS.dir/build.make:94: recipe for target 'HUGS' failed
make[2]: *** [HUGS] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/HUGS.dir/all' failed
make[1]: *** [CMakeFiles/HUGS.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
hadoop@Master:~/software/HUGS/HUGS_CMAKE_RELEASE$


运行  HUGS 程序 出错:

Start registration 1:
1;2;3;4;
itk::ExceptionObject (0x2731500)
Location: "virtual void itk::AnalyzeImageIO::WriteImageInformation()"
File: /home/hadoop/software/HUGS/ITK/ITK_3201/Code/IO/itkAnalyzeImageIO.cxx
Line: 1244
Description: itk::ERROR: AnalyzeImageIO(0x271d990): File cannot be written

*** buffer overflow detected ***: ./HUGS terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fd6423f77e5]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fd64249915c]
/lib/x86_64-linux-gnu/libc.so.6(+0x117160)[0x7fd642497160]
/lib/x86_64-linux-gnu/libc.so.6(__strcat_chk+0x5d)[0x7fd64249646d]
./HUGS(main+0x19c3)[0x462423]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd6423a0830]
./HUGS(_start+0x29)[0x4631d9]
======= Memory map: ========
00400000-0056d000 r-xp 00000000 08:06 8536758                            /home/hadoop/software/HUGS/HUGS_RELEASE/HUGS
0076c000-0076d000 r--p 0016c000 08:06 8536758                            /home/hadoop/software/HUGS/HUGS_RELEASE/HUGS
0076d000-0076e000 rw-p 0016d000 08:06 8536758                            /home/hadoop/software/HUGS/HUGS_RELEASE/HUGS
0076e000-00770000 rw-p 00000000 00:00 0
014df000-02961000 rw-p 00000000 00:00 0                                  [heap]
7fd59473b000-7fd59ad26000 rw-p 00000000 00:00 0
7fd632f20000-7fd632f21000 ---p 00000000 00:00 0
7fd632f21000-7fd633721000 rw-p 00000000 00:00 0
7fd634f24000-7fd63f901000 rw-p 00000000 00:00 0
7fd63f901000-7fd63f903000 r-xp 00000000 08:06 8536812                    /home/hadoop/software/HUGS/ITK/itk_build/bin/libITKznz.so.3.20.1
7fd63f903000-7fd63fb02000 ---p 00002000 08:06 8536812                    /home/hadoop/software/HUGS/ITK/itk_build/bin/libITKznz.so.3.20.1
7fd63fb02000-7fd63fb03000 r--p 00001000 08:06 8536812                    /home/hadoop/software/HUGS/ITK/itk_build/bin/libITKznz.so.3.20.1
7fd63fb03000-7fd63fb04000 rw-p 00002000 08:06 8536812                    /home/hadoop/software/HUGS/ITK/itk_build/bin/libITKznz.so.3.20.1

。。。。。。。。。。。。。

7fd6447a9000-7fd6447aa000 rw-p 00026000 08:06 9699414                    /lib/x86_64-linux-gnu/ld-2.23.so
7fd6447aa000-7fd6447ab000 rw-p 00000000 00:00 0
7fff3bcd7000-7fff3bcf8000 rw-p 00000000 00:00 0                          [stack]
7fff3bdfb000-7fff3bdfe000 r--p 00000000 00:00 0                          [vvar]
7fff3bdfe000-7fff3be00000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
1;2;3;4;Aborted (core dumped)

不写入变形场,结果:
The Graph was constructed successfully!
Start iteration!

Start registration 1:
1;2;3;4;5;
itk::ExceptionObject (0x24ac700)
Location: "virtual void itk::AnalyzeImageIO::WriteImageInformation()"
File: /home/hadoop/software/HUGS/ITK/ITK_3201/Code/IO/itkAnalyzeImageIO.cxx
Line: 1244
Description: itk::ERROR: AnalyzeImageIO(0x24cd4a0): File cannot be written

itk::ExceptionObject (0x24ac700)
Location: "virtual void itk::AnalyzeImageIO::WriteImageInformation()"
File: /home/hadoop/software/HUGS/ITK/ITK_3201/Code/IO/itkAnalyzeImageIO.cxx
Line: 1244
Description: itk::ERROR: AnalyzeImageIO(0x24ce0f0): File cannot be written

Start registration 2:


原来的程序:
// ostringstream tmp3;
// tmp3 << "./Output/" << DisplacementFieldFileName;
// cout << "filename" << tmp.str() << endl;
// WriteImage(const_cast<char*>(tmp3.str().c_str()), movedImage[i],"short");

char path31[] = "./Output/";
strcat(path31, DisplacementFieldFileName);
WriteDeformationField(path31, currentDisplacementField[i]);
改过的程序:
ostringstream tmp3;
tmp3 << "J:/HUGS/HUGS/HUGS_CMAKE_RELEASE/output/" << DisplacementFieldFileName;
// cout << "filename" << tmp
4000
.str() << endl;
// WriteImage(const_cast<char*>(tmp3.str().c_str()), movedImage[i],"short");

// char path31[] = "./Output/";

// char path31[] = "J:/HUGS/HUGS/HUGS_CMAKE_RELEASE/output/";
// strcat(path31, DisplacementFieldFileName);
// WriteDeformationField(path31, currentDisplacementField[i]);
WriteDeformationField(const_cast<char*>(tmp3.str().c_str()), currentDisplacementField[i]);
为什么   strcat 函数 在 linux系统下运行出错???????????????????
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: