Home › Forum › SOFA › Using SOFA › [SOLVED] Building VRPN plugin on linux
Tagged: 64_bits, Linux_ubuntu, SOFA_1512
- This topic has 18 replies, 3 voices, and was last updated 7 years ago by ErwanDouaille.
-
AuthorPosts
-
15 November 2017 at 22:00 #10138SarathBlocked
I am getting the following error while trying to build the vrpn client on linux
[ 4%] Built target tinyxml [ 28%] Built target SofaHelper [ 33%] Built target SofaDefaultType [ 66%] Built target SofaCore [ 95%] Built target SofaSimulationCommon Scanning dependencies of target SofaVRPNClient [100%] Building CXX object applications/plugins/SofaVRPNClient/CMakeFiles/SofaVRPNClient.dir/VRPNImager.cpp.o In file included from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.inl:34, from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.cpp:34: /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.h:139: error: \u2018defaulttype\u2019 was not declared in this scope /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.h:139: error: template argument 1 is invalid /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.h:142: error: \u2018defaulttype\u2019 was not declared in this scope /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.h:142: error: template argument 1 is invalid In file included from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.cpp:34:
16 November 2017 at 09:31 #10139HugoKeymasterDear @sarath ,
First of all, I would advise to use a more recent version of SOFA (check out the latest 17.06 release). I did not use the VRPN plugin myself though, not sure to be really helpful.
Maybe anyone else in the community could help ?
I will activate and test the plugin.Keep us updated. Cheers,
Hugo
16 November 2017 at 18:26 #10144SarathBlockedHi Hugo,
Thank you so much for replying. We had problems building SOFA itself with the newer version (V17.06 release). So we resorted to using the older versions. Also my understanding is the plugin named SofaVRPNClient is DEPRICIATED so it may not be compatible with newer builds. Now that you have suggested us to use the latest , we tried to build it again. Building v17.06 linux
This was the procedure we followed . Could you let us know where we went wrong .
Thank you .
16 November 2017 at 18:54 #10146HugoKeymasterAh damed it, I just noticed as weel that the plugin is deprecated in the latest version of SOFA. The error seems to come from the code : VRPNImager.cpp: line 34
I will try to find some time to investigate, if anyone else got an input it would be kind.
Cheers
Hugo
16 November 2017 at 19:03 #10147SarathBlockedI am not sure if you check the link , we also have problems with the sofa build itself (not the plugin), i am just pasting the link again
https://docs.google.com/document/d/1xDNJW5Wz1vedRQYqwbUhjOELk8Sbgf6kmI8l0V0o7TU/edit
Thank you.
17 November 2017 at 12:06 #10148HugoKeymasterDear @sarath ,
It seems you are facing the same issue that this post, but I am not sure of the consequences of the active option: NO_BOOST_CMAKE.
Are you on CentOS ? it seems linked to this distribution.Your error in SOFA comes from FileInfo.h but I guess it has a link with the above mentioned Cmake error:
CMake Error at /usr/lib64/boost/Boost.cmake:536 (message): The imported target "boost_date_time-static" references the file "/usr/lib64/lib64/libboost_date_time.a" but this file does not exist.
Let us know about your investigation.
Hugo
17 November 2017 at 17:41 #10150SarathBlockedHi Hugo,
We are on Scientific Linux.Yeah we tried the NO_BOOST_CMAKE., in that document we mentioned that, but after config and generating in Cmake , we had problem while making(building) , the error was from Fileinfo.h.
[ 8%] Building CXX object SofaKernel/SofaFramework/SofaHelper/CMakeFiles/SofaHelper.dir/StateMask.cpp.o In file included from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/Message.h:38, from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/MessageDispatcher.h:30, from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/Messaging.h:81, from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/LCPcalc.cpp:24: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:57: error: function definition does not declare parameters /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:58: error: function definition does not declare parameters /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfo::FileInfo(const char*, int)\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:59: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018filename\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:59: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018line\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfo::FileInfo()\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:62: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018filename\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:62: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018line\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfoOwningFilename::FileInfoOwningFilename(const char*, int)\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:71: error: \u2018filename\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:72: error: \u2018line\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfoOwningFilename::FileInfoOwningFilename(const std::string&, int)\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:78: error: \u2018filename\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:79: error: \u2018line\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In destructor \u2018sofa::helper::logging::FileInfoOwningFilename::~FileInfoOwningFilename()\u2019:
it seems internal, i will try to compare it with the older version which compiled well , maybe notice some differences .
28 November 2017 at 17:30 #10183SarathBlockedHii Hugo,
We have a little update regarding the VRPN plugin, So we think that the error while trying to build the plugin stems from the VRPNImager.h Specifically from the line 141(and 143),
extern template class SOFA_SOFAVRPNCLIENT_API VRPNImager<defaulttype::Vec3dTypes>;
the defaulttype needs a sofa:: infront of it
extern template class SOFA_SOFAVRPNCLIENT_API VRPNImager<sofa::defaulttype::Vec3dTypes>;
However this causes another error because of the SOFA_SOFAVRPNCLIENT_API template. We are not sure how to resolve this.
There is another plugin called Flexible, and in it there is a header file called FlexibleTetrahedronFEMForceField.h
it is almost same as this VRPNimager.h. The Flexible plugin builds perfectly and we are able to use it . We want to know how was this plugin built, so that we could use the same proceedure for this VRPN as they both seem very similar . As an example a line from that FlexibleTetrahedronFEMForcField.h
extern template class SOFA_Flexible_API FlexibleTetrahedronFEMForceField<defaulttype::Vec3fTypes>;
Could you provide some details on how plugins were written , how they access the sofa core libraries, what type of namespaces and templates were created and how they were used , specifically for this flexible and vrpn plugin (we already tried the Myplugin tutorial it is not that relevant to this problem i believe ).
Thankyou.
29 November 2017 at 05:43 #10185HugoKeymaster30 November 2017 at 17:19 #10194SarathBlockedHii Hugo,
We have some good news, we were almost able to build the plugin, we discoverd what was causing the error default type as mentioned before
[100%] Building CXX object applications/plugins/SofaVRPNClient/CMakeFiles/SofaVRPNClient.dir/VRPNImager.cpp.o In file included from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.inl:34, from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.cpp:34: /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.h:139: error: \u2018defaulttype\u2019 was not declared in this scope
This error was caused because the defaulttype belongs to the namespace sofa , hence it should be sofa::defaulttype instead in the code,also there were minor corrections regarding the namespace sofavrpn, all these changes were made in the VRPNImager.h, we also resolved other issues related to openGL coming from VRPNImager.inl. However we are stuck with the only one issue which stems from the cmakelist of the plugin(SofaVRPNClient)
target_link_libraries(${PROJECT_NAME} SofaCore SofaSimulationCommon vrpn_quat vrpn_client) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SOFAVRPNCLIENT")
here you see that vrpn_quat and vrpn_client are metioned , sofa is unable to link those target libraries because they are not present in the plugin src folder , we dont exactly know what they are (are they libraries? , headers? or folders?) . We just need to know what they are and how to obtain them so that sofa can link them and build the plugin
Once we build the plugin we will post the changes made in the VRPNImager.h and VRPNImager.inl and also pull-request on github, this is the only issue left so please provide a fix at the earliest (we are currently assuming that the actual vrpn needs to be built parallel with sofa from which these vrpn_quat and client will be detected and linked).Awaiting your response .
Thank you.
30 November 2017 at 17:48 #10195HugoKeymasterHi @sarath,
This is a linking error. Only three possibilities:
– the library project does not exist
– the library is not built
– build configurations do not matchCould you check this (mainly two first points) ?
Hugo
30 November 2017 at 17:55 #10196SarathBlockedHi Hugo,
I believe the library project does not exist , i tried to search for vrpn_quat in the build there was nothing by that name. We are thinking it needs to be built, but how ? and what is the source for these library project.
Thank you
30 November 2017 at 17:59 #10197HugoKeymasterAgain, I did do it myself, but I am pretty sure you can follow the guidelines from vprn library : https://github.com/vrpn/vrpn/wiki
Cheers,
Hugo
30 November 2017 at 18:17 #10198SarathBlockedHi hugo,
We built vrpn before, infact we already have the built vrpn but not in the same directory,
the question here is dose VRPN needs to be built along with sofa or should we just simply copy the built folder into the sofa build directory, even if we do this there is no vrpn_quat directory , there is however a quat directory within vrpn build it has a libquat.a . I will try your suggestion and build vrpn again within the sofa build and let you know if i will get any error .Thank you.
30 November 2017 at 18:24 #10199HugoKeymasterHi Sarah,
I don’t think they have to be built in the same directory. However, you will either need a FindVRPN.cmake file in the repository cmake/ at the root of SOFA (it does not exist, but you can find one here) or specify yourself in the CMake configuration the path to the VRPN libs.
Cheers,
Hugo
30 November 2017 at 18:53 #10200SarathBlockedHi Hugo,
Thanks this is what we need , i think. We will try to edit this FindVRPN.cmake and add it and then configure and see what happens .
Thank you.
6 December 2017 at 17:25 #10214SarathBlockedHi Hugo,
Great News, we were finally able to build and load the SofaVRPNClient . We were able to establish connection with a Server as well. We loaded the example that was available called VRPNImagerRigidPhysics1.scn, it established connection with our local machine. While we don’t exactly and fully know what the example is about and we don’t know how these xml or scn scenes work, we are studying sofa and trying to use these examples, a well documented User manual would really help speed the process. We are now working in the direction of establishing a working connection with a haptic device while sofa runs on a grid . As per your suggestion we would place a pull-request soon on Git, for anyone who is planing on using sofavrpn, I believe this would be really helpful .
Thank you.
14 December 2017 at 15:56 #10229HugoKeymasterDear Sarath,
Great news ! Thank you so much !
I am sure the whole community will be greatful for what you succeeded to do !Best,
Hugo
14 December 2017 at 16:01 #10231ErwanDouailleBlockedThanks Sarath !
@Hugo, another protocol we could include/merge in sofa communication plugin. -
AuthorPosts
- You must be logged in to reply to this topic.