VTK编译GrowCut和编译CUDA程序为python库踩坑记录

1

VS2019编译参考:
https://www.bilibili.com/read/cv6734720/

2

编译GrowCut时,参考这个,把文件目录放在remote下:
https://blog.csdn.net/yuxing55555/article/details/125764780?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522169519571716800225597272%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=169519571716800225597272&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allbaidu_landing_v2~default-4-125764780-null-null.142v94chatsearchT3_1&utm_term=ITK%E7%BC%96%E8%AF%91remote%E5%BA%93&spm=1018.2226.3001.4187

3

C:\template\1ThirdLib\ITK\include\ITK-5.3\itkShapedNeighborhoodIterator.h:183: error: C2516: “itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator”: 是非法基类
C:\template\1ThirdLib\ITK\include\ITK-5.3\itkShapedNeighborhoodIterator.h(183): error C2516: “itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator”: 是非法基类
C:\template\1ThirdLib\ITK\include\ITK-5.3\itkShapedNeighborhoodIterator.h(171): note: 参见“itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator”的声明
C:\template\1ThirdLib\ITK\include\ITK-5.3\itkShapedNeighborhoodIterator.h(209): note: 查看对正在编译的 类 模板 实例化“itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::Iterator”的引用
C:\template\1ThirdLib\ITK\include\ITK-5.3\itkShapedNeighborhoodIterator.h(265): note: 查看对正在编译的 类 模板 实例化“itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>”的引用

https://github.com/InsightSoftwareConsortium/ITK/pull/3844

4

发生这个错误Unknown type name ‘NeighborhoodIteratorType’ 只能重新构建VTK,将错误变成非法基类

如果页面没有对齐,那是因为不在同一布局下。

5

cuda编译成python时的cmakeList,在cmakeList下添加两行:

add_definitions(-DAPI_EXPORTS)
add_definitions(-std=c++11)
cmake_minimum_required(VERSION 3.27)

project(SiddonGpu)

enable_language(CUDA)

find_package(CUDAToolkit)

set(CMAKE_C_FLAGS "-fPIC")
set(CMAKE_CXX_FLAGS "-fPIC")
add_definitions(-DAPI_EXPORTS)
add_definitions(-std=c++11)
set_source_files_properties(SiddonLib/siddon_class.cu PROPERTIES LANGUAGE CUDA)

add_library(SiddonGpu SiddonLib/siddon_class.cu SiddonLib/siddon_class.cuh)
target_link_libraries(SiddonGpu ${CUDAToolkit_LIBRARIES})

6

错误为:
错误 MSB3721 命令““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe” -gencode=arch=compute_30,code=“sm_30,compute_30” -gencode=arch=compute_35,code=“sm_35,compute_35” -gencode=arch=compute_37,code=“sm_37,compute_37” -gencode=arch=compute_50,code=“sm_50,compute_50” -gencode=arch=compute_52,code=“sm_52,compute_52” -gencode=arch=compute_60,code=“sm_60,compute_60” -gencode=arch=compute_61,code=“sm_61,compute_61” -gencode=arch=compute_70,code=“sm_70,compute_70” --use-local-env --cl-version 2017 -ccbin “E:\code\visual_studio\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64” -x cu -I./ -I…/…/common/inc -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1/include" -I…/…/common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler “/wd 4819” -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MTd " -o x64/Debug/asyncAPI.cu.obj “C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1\0_Simple\asyncAPI\asyncAPI.cu””已退出,返回代码为 2。 asyncAPI E:\code\visual_studio\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 9.1.targets 707
————————————————
版权声明:本文为CSDN博主「芸编蕴香」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u013894391/article/details/79647618

7

导入python.h报错
https://www.cnblogs.com/xian-yongchao/p/17238684.html

8

由于找不到python37.dll

https://blog.csdn.net/weixin_42741471/article/details/105781468

9

Fatal Python error:
unable to load the file system codec
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named ‘encodings’

是需要设置主目录
//设置主目录,就是python的主目录
Py_SetPythonHome(L"C:\Users\user\anaconda3\envs\2D_3DRegistration");

10

想要下面的两个页面大小随着窗口自适应,需要保证它们处于同一布局下,不用另外添加布局。
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值