Home › Forum › SOFA › Building SOFA › [SOLVED] Building SOFACUDA plugin on Windows
Tagged: Cuda
- This topic has 5 replies, 4 voices, and was last updated 8 years, 7 months ago by sergioteovit.
-
AuthorPosts
-
12 November 2015 at 00:23 #3996JasonBlocked
Hi Everyone,
I am trying to build the SOFACUDA plugin on a Windows 10 64bit machine.
Using VS2013, I have successfully built SOFA, as well as some of the plugins (Flexible, image, SOFAPYTHON…)
However when I try to compile SOFACUDA, I encountered several problems.
First, the nvcc compiler failed to recognize the sofa include paths. I solved this by editing the CMakeLists.txt file to include the following:
cuda_include_directories(“/path/to/sofa/framework”)
cuda_include_directories(“/path/to/windows/dependencies/include”)However, when I build, I now get a series of C2491 compiler errors in CudaMeshMatrixMass.cpp
Everything builds correctly on my Ubuntu box.
Does anyone have any suggestions?
Thanks for your kind help.
-Jason
19 November 2015 at 12:51 #4283GuillaumeKeymasterHi Jason,
To make your problem easier for us, could you tell what version of SOFA you are using ?
Also please copy/paste some of the errors you got from CudaMeshMatrixMass.cpp
Regards,
Guillaume.1 January 2016 at 19:48 #5255SenBlockedHi Guillaume,
I get the same error while compiling CudaMeshMatrixMass.C:\Haptics\sofasrc.29112015\modules\SofaMiscForceField/MeshMatrixMass.inl(79): error C2491: 'sofa::component::mass::MeshMatrixMass<DataTypes,TMassType>::MeshMatrixMass' : definition of dllimport function not allowed C:\Haptics\sofasrc.29112015\modules\SofaMiscForceField/MeshMatrixMass.inl(87): error C2491: 'sofa::component::mass::MeshMatrixMass<DataTypes,TMassType>::~MeshMatrixMass' : definition of dllimport function not allowed
I use the head version of master branch on VS2012 / Windows10.
I believe a similar error was happening in the past with TetraHedronFEMForceField and response on the forum was related to inconsistent use of “using namespace” in inline files.
I couldnt apply the same soln to this case.
Best
Sourav25 February 2016 at 07:22 #5945sergioteovitBlockedHi everyone,
I have the same problem compiling CudaMeshMatrixMass and MeshMatrixMass in Windows 10 64-bits, VS2013 Community, SOFA Framework v15.12.
MeshMatrixMass.inl:
error C2491: ‘sofa::component::mass::MeshMatrixMass<DataTypes,TMassType>::MeshMatrixMass’ : definition of dllimport function not allowed C:\SOFAFramework\sofa-qt5-boost-1-59-msvc2013\v15.12\src\modules\SofaMiscForceField\MeshMatrixMass.inl
error C2491: ‘sofa::component::mass::MeshMatrixMass<DataTypes,TMassType>::~MeshMatrixMass’ : definition of dllimport function not allowed C:\SOFAFramework\sofa-qt5-boost-1-59-msvc2013\v15.12\src\modules\SofaMiscForceField\MeshMatrixMass.inl
error C2491: ‘sofa::component::mass::MeshMatrixMass<DataTypes,TMassType>::init’ : definition of dllimport function not allowed C:\SOFAFramework\sofa-qt5-boost-1-59-msvc2013\v15.12\src\modules\SofaMiscForceField\MeshMatrixMass.inl
… (and other 15)
CudaMeshMatrixMass.inl
error C2491: ‘sofa::component::mass::MeshMatrixMass<sofa::gpu::cuda::CudaVec2fTypes,float>::copyVertexMass’ : definition of dllimport function not allowed C:\SOFAFramework\sofa-qt5-boost-1-59-msvc2013\v15.12\src\applications\plugins\SofaCUDA\sofa\gpu\cuda\CudaMeshMatrixMass.inl
error C2491: ‘sofa::component::mass::MeshMatrixMass<sofa::gpu::cuda::CudaVec2fTypes,float>::addMDx’ : definition of dllimport function not allowed C:\SOFAFramework\sofa-qt5-boost-1-59-msvc2013\v15.12\src\applications\plugins\SofaCUDA\sofa\gpu\cuda\CudaMeshMatrixMass.inl
… (and other 2)
Regards,
Sergio29 March 2016 at 13:29 #6389GuillaumeKeymasterHi guys,
Sorry for the very late reply.
Indeed, v15.12 version of SofaCuda plugin does not compile on Windows.However, this problem has already been fixed in the master branch by commits #eee8ff and #b7ee04.
Feel free to cherry-pick them 🙂I will propose to integrate these fixes to v15.12.
Cheers,
Guillaume.2 April 2016 at 18:14 #6448sergioteovitBlockedHi Guillaume, It works for me!. Now to test!.
Thanks 😉
Cheers,
Sergio -
AuthorPosts
- You must be logged in to reply to this topic.