Home › Forum › SOFA › Using SOFA › [SOLVED] Difficulties compiling my own SOFA plugins on Windows
- This topic has 19 replies, 3 voices, and was last updated 3 years, 5 months ago by Hugo.
-
AuthorPosts
-
11 May 2021 at 11:50 #19429Julien D.Blocked
Hello dear members of the SOFA community ๐
I hope that anyone here could help me to solve an annoying issue…
About 6 months ago, I successfully implemented a SOFA plugin on SOFA v19.06, using a Linux OS Ubuntu 20.04.
The plugin is still in a very experimental state but I can compile it and use it on SOFA v19.06, on my Ubuntu distribution, without any issue.
However, to implement reflections in my SOFA scenes, I am starting to use SOFA Unity.
This plugin, made by InfinyTech 3D Solutions, allow to import SOFA objects into Unity scenes, which is very useful.
This plugin embeds the dll of SOFA v20.12 compiled for Windows. Therefore, since I want to use the plugins I implemented before on SOFA Unity, I have to compile the plugins I made to use them in SOFA v20.12 on Windows, to get their dll and use them with SOFA Unity.I installed SOFA v20.12 on Windows, then, which seems to work perfectly (the RunSofa executable is working fine and can load the example scenes of SOFA without any issue).
Subsequently, I tried to configure my plugins, using CMake GUI, to compile them and export the corresponding dll.
Unfortunately, I keep having CMake errors while I try to configure my project.1) First, I had an error `CMake Error at CMakeLists.txt:9 (find_package):
By not providing “FindSofaFramework.cmake” in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
“SofaFramework”, but CMake did not find one.`So I included in the CMakeLists.txt of my project the line
set(CMAKE_PREFIX_PATH "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake"
2) Then, I add another issue with Glew (which is included in the SOFA dependencies pack for Windows). So I uncluded in my CMAKE_PREFIX_PATH the variable “D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src” (where all my SOFA sources are).
Then, CMAKE provides me the following error:CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestConfig.cmake:33 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:91 (find_package) CMakeLists.txt:10 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:99 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkTargets.cmake Call Stack (most recent call first): CMakeLists.txt:10 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:104 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkTargets.cmake Call Stack (most recent call first): CMakeLists.txt:10 (find_package) CMake Deprecation Warning at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:33 (message): SofaGeneral is deprecated. You must now explicitely find (find_package) and link (target_link_library) the modules you need within: SofaBoundaryCondition;SofaGeneralMeshCollision;SofaGeneralVisual;SofaGraphComponent;SofaGeneralAnimationLoop;SofaGeneralDeformable;SofaGeneralEngine;SofaGeneralExplicitOdeSolver;SofaGeneralImplicitOdeSolver;SofaGeneralLinearSolver;SofaGeneralRigid;SofaGeneralObjectInteraction;SofaGeneralSimpleFem;SofaGeneralTopology;SofaTopologyMapping;SofaUserInteraction;SofaConstraint;SofaGeneralLoader Call Stack (most recent call first): CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaSimulationConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaSimulationTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:33 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaSimulationConfig.cmake:42 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaSimulationTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:33 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseLinearSolverConfig.cmake:35 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseLinearSolverTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaEigen2SolverConfig.cmake:42 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaEigen2SolverTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseTopologyConfig.cmake:36 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseTopologyTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseCollisionConfig.cmake:35 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseCollisionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseMechanicsConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseMechanicsTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/TinyXMLConfig.cmake:33 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/TinyXMLTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseVisualConfig.cmake:33 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseVisualConfig.cmake:36 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseVisualTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseUtilsConfig.cmake:35 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseUtilsTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:38 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:42 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBoundaryConditionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaDeformableConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaDeformableTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaObjectInteractionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMeshCollisionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralMeshCollisionConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaObjectInteractionConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaObjectInteractionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMeshCollisionConfig.cmake:34 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralMeshCollisionConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaRigidConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaRigidTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMeshCollisionConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralMeshCollisionConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMeshCollisionConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMeshCollisionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralMeshCollisionConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralMeshCollisionConfig.cmake:40 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralMeshCollisionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralVisualConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralVisualTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGraphComponentConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGraphComponentTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralAnimationLoopConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralAnimationLoopTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralDeformableConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralDeformableTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralEngineConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralEngineTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralExplicitOdeSolverConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralExplicitOdeSolverTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralImplicitOdeSolverConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralImplicitOdeSolverTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralLinearSolverConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralLinearSolverTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralRigidConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralRigidTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralObjectInteractionConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralObjectInteractionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaSimpleFemConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaSimpleFemTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralSimpleFemConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralSimpleFemConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralSimpleFemTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralTopologyConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralTopologyTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaTopologyMappingConfig.cmake:38 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaTopologyMappingTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaUserInteractionConfig.cmake:43 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaUserInteractionTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaImplicitOdeSolverConfig.cmake:37 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaImplicitOdeSolverTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaConstraintConfig.cmake:35 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaConstraintConfig.cmake:41 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaConstraintTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralLoaderConfig.cmake:43 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralLoaderTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:40 (find_package) CMakeLists.txt:11 (find_package) CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralConfig.cmake:44 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaGeneralTargets.cmake Call Stack (most recent call first): CMakeLists.txt:11 (find_package) CMake Warning at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMacrosInstall.cmake:1041 (message): Deprecated macro. Use 'sofa_create_package_with_targets' instead. Call Stack (most recent call first): CMakeLists.txt:78 (sofa_generate_package) CMake Error: File D:/Utilisateurs/jducrocq/Documents/Developpement/Sofa_workspace/MyPrettyMirror_win/MyPrettyMirrorConfig.cmake.in does not exist. CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakePackageConfigHelpers.cmake:330 (configure_file): configure_file Problem configuring file Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMacrosInstall.cmake:200 (configure_package_config_file) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMacrosInstall.cmake:49 (sofa_create_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaMacrosInstall.cmake:1042 (sofa_create_package_with_targets) CMakeLists.txt:78 (sofa_generate_package)
I have tried to reinstall SOFA, using Visual Studio, taking care to reproduce all the steps explained. I even compiled the INSTALL.sln project in “CMakePredefinedTargets” folder. None of that attemps is working. The files ending by “targets.cmake” are not created at all (or not in any SOFA subdirectories).
If anyone has a hint to help me, please share.
Thank you very much.I wish a great day to all members of SOFA community ๐
11 May 2021 at 15:26 #19430Julien D.BlockedAlso, I don’t know if it’s related, but during SOFA installation (most precisely the library configuration step), I have tons of warnings of that type:
CMake Warning at D:/Cmake/share/cmake-3.20/Modules/FindBoost.cmake:1354 (message): New Boost version may have incorrect or missing dependencies and imported targets Call Stack (most recent call first): D:/Cmake/share/cmake-3.20/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES) D:/Cmake/share/cmake-3.20/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES) D:/Ducrocq/librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:82 (find_package) SofaGui/CMakeLists.txt:7 (find_package)
Perhaps that might help to find a solution.
13 May 2021 at 16:46 #19438TimesBlockedHello @Julien D.
I think this location is not right “D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake”If you built SOFA from the source code could you try “D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/lib/cmake” instead
14 May 2021 at 15:59 #19450Julien D.BlockedHello @akTheTimes, thank you very much for your help ๐
Unfortunately, after I have built SOFA from the source code, this folder is not created (I have sofa/build/lib, yes, but not sofa/build/lib/cmake).
I think my error is connected to glew dependencies.
If I don’t install glew by myself, I mean going to the website and donwloading the latest version instead of just unzipping the SOFA_WIN_DEPENDENCIES_PACK into my sofa/src folder, I got the error:CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message): Could NOT find GLEW (missing: GLEW_INCLUDE_DIRS GLEW_LIBRARIES) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-3.18/Modules/FindGLEW.cmake:207 (find_package_handle_standard_args) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:88 (find_package) CMakeLists.txt:9 (find_package)
If I install glew by myself, I have then other cmake errors:
CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/glew-2.1.0/build/cmake/glew-config.cmake:16 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/glew-2.1.0/build/cmake/glew-targets.cmake Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.18/Modules/FindGLEW.cmake:62 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:88 (find_package) CMakeLists.txt:9 (find_package)
Can you help me with glew installation? Or is there a way to bypass glew research on the cmakelists.txt of my own plugin? I didn’t have this issue on ubuntu, I only have it on windows…
Thank you again for your help ๐
15 May 2021 at 01:26 #19453TimesBlockedHi @Julien D.
Let’s go with the first approach of just unzipping the SOFA_WIN_DEPENDENCIES_PACK into the sofa/src folder
In Cmake, set the path for GLEW_INCLUDE_DIR to “..sofa/src/include”
and GLEW_SHARED_LIBRARY_RELEASE to “..sofa/src/lib/win64/glew32.lib”Hope that helps
15 May 2021 at 11:18 #19454Julien D.BlockedHi @akTheTimes,
I’ll try this solution tomorrow as I can’t use the computer where SOFA is installed today. I’ll keep you in touch then. Thank you again for your help.
I think I’ve already tried something similar and it didn’t work, I set GLEW_INCLUDE_DIR to “…sofa/src/include” but GLEW_LIBRARIES_DIRS to “…sofa/src/lib/win/64”. However, it’s not exactly the same paths and cmake variables, so perhaps your approach will work better. Anyways, if any member of the SOFA community have another idea before I could check that, feel free to share ๐
Thank you a lot,
Best wishes,
Julien
16 May 2021 at 19:40 #19459Julien D.BlockedDear @akTheTimes ,
So I tried your solution and things progressed a little bit for me.
First, I had Eigen not found, but by filling my CmakeModulePath
set(CMAKE_MODULE_PATH "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/cmake/Modules")
, as indicated here https://www.sofa-framework.org/community/forum/topic/cmake-error-in-building-sofa/ , I stopped having glew and eigen3 errors.However, I currently have the same errors that I’ve described in the very beginning of this post:
CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestConfig.cmake:33 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:91 (find_package) CMakeLists.txt:16 (find_package)
and multiple errors like
`CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:104 (include):
include could not find load file:D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkTargets.cmake
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)`I don’t have this file XXXTargets.cmake at all in my Sofa folders.
โD:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/lib/cmakeโ” hasn’t been created on my computer.
If anyone knows the cause of this error, feel free to help.
Thank you again, @akTheTimes, for your advices.
16 May 2021 at 20:44 #19460Julien D.BlockedIf this can be of any help to find a way to solve my issue, I am copying my CMake file below:
cmake_minimum_required(VERSION 3.1) project(MyPrettyMirror VERSION 1.0) # Find Sofa-config.cmake and Visp-config.cmake set(CMAKE_PREFIX_PATH "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake" "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src") set(CMAKE_CXX_FLAGS "-std=c++11") set(CMAKE_MODULE_PATH "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/cmake/Modules") # GLEW set(GLEW_INCLUDE_DIR "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/include") set(GLEW_SHARED_LIBRARY_RELEASE "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/lib/win64/glew32.lib") # SOFA packages containing our dependencies find_package(SofaFramework REQUIRED) # Needed to use SofaCore, SofaHelper and SofaDefaultType find_package(SofaGeneral REQUIRED) # Needed to use SofaBaseTopology # Use external libraries (Visp for instance) find_package(VISP REQUIRED) if(VISP_FOUND) include(${VISP_USE_FILE}) endif(VISP_FOUND) # Config files (tell SOFA this is a plugin) set(CONFIG_FILES share/config.h src/initMyPrettyMirror.cpp ) # New components = piston forces (independant or global area), forces applied to borders) set(HEADER_FILES share/BorderForces.h share/BorderForces.inl share/PistonForce.h share/PistonForce.inl share/PistonFewPoints.h share/PistonFewPoints.inl share/PressurePiston.h share/PressurePiston.inl ) set(SOURCE_FILES src/BorderForces.cpp src/PistonForce.cpp src/PistonFewPoints.cpp src/PressurePiston.cpp ) # SOFA plugin are basically libraries add_library(${PROJECT_NAME} SHARED ${CONFIG_FILES} ${HEADER_FILES} ${SOURCE_FILES}) # Dependencies target_link_libraries(${PROJECT_NAME} PUBLIC SofaCore SofaHelper SofaDefaultType SofaBaseTopology SofaBoundaryCondition ) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_MYPRETTYMIRROR") # Needed to build on Windows (dllimport/dllexport mechanism) ## target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_MYPRETTYMIRROR") # Set include directories to be able to resolve "#include <MyPrettyMirror/XXX.h>" target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>") target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>") # Create package Config, Version & Target files. # Deploy the headers, resources, scenes & examples. sofa_generate_package( NAME ${PROJECT_NAME} TARGETS ${PROJECT_NAME} VERSION ${PROJECT_VERSION} INCLUDE_SOURCE_DIR src INCLUDE_INSTALL_DIR MyPrettyMirror )
Have a good evening/day, dear members of the SOFA community ๐
17 May 2021 at 13:10 #19463TimesBlockedHi @Julien D.,
If you search in “../sofa/build” for “GTestConfig.cmake”, which folder is it located in? Because from your errors, cmake cannot locate “GTestConfig.cmake” and the others.17 May 2021 at 20:48 #19467Julien D.BlockedHi @akTheTimes,
My GTestConfig.cmake file is located in:
D:\Utilisateurs\jducrocq\Documents\Librairies\sofa\build\cmake
which I already put in my cMakeLists.txt.
However, from my errors, it seems that the file GTestConfig.cmake is read by Cmake during the compilation, but then, CMake cannot find GtestTargets.cmake, which is required by GTestConfig.cmake.
CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestConfig.cmake:33 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:91 (find_package) CMakeLists.txt:16 (find_package)
By the way, “D:\Utilisateurs\jducrocq\Documents\Librairies\sofa\build\extlibs\gtest\CMakeFiles\Export\lib\cmake\GTest” contains GTestConfig.cmake
I added this path to CMakePrefixPath but it’s not working, alas.
Thank you again.
18 May 2021 at 11:11 #19468Julien D.BlockedHello everyone,
so apparently the best way of compiling a plugin is to place it inside the root tree of SOFA, according to the documentation in https://www.sofa-framework.org/community/doc/programming-with-sofa/create-your-plugin/
When I first compiled my plugin on SOFA v19.06 on Ubuntu it was perfectly fine to compile it outside of SOFA root directories, I don’t know what’s avoiding me to do the same on SOFA v20.12.
So, I am going to try a compilation of my plugin inside SOFA root.However, if you have another idea, feel free to keep me in touch ๐
Thank you ๐
18 May 2021 at 12:18 #19470Julien D.BlockedSo I tried the example plugin in “sofa\src\applications\plugins\PluginExample” and even in that case I had to modify the CMakeLists.txt to make it work.
And I’m having errors with glew again.I have added the 4 lines below to my CMakeLists to find glew required files, but
set(GLEW_INCLUDE_DIR "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/include") set(GLEW_SHARED_LIBRARY_RELEASE "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/lib/win64/glew32.lib") set(GLEW_STATIC_LIBRARY_RELASE "D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/include/GL/glew.h") set(GLEW_LIBRARIES GLEW::GLEW)
and I’m having the error
CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/extlibs/eigen-3.3.8/cmake/FindGLEW.cmake:96 (MESSAGE): Could not find Glew Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:88 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:32 (find_package) CMakeLists.txt:17 (find_package)
I really don’t know what is not found by the script FindGLEW.cmake launched in GLEW_LIBRARY.
EDIT: I added set(GLEW_GLEW_LIBRARY “D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/src/lib/win64/”) and the glew detection step worked again!
However, I still have the multiples errors likeCMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestConfig.cmake:33 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/GTestTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:91 (find_package) D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:32 (find_package) CMakeLists.txt:17 (find_package)
and
CMake Error at D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkConfig.cmake:99 (include): include could not find load file: D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaFrameworkTargets.cmake Call Stack (most recent call first): D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/cmake/SofaBaseConfig.cmake:32 (find_package) CMakeLists.txt:17 (find_package)
So I’m having the same error while I’m trying to compile the plugin example of SOFA inside Sofa source directory than when I compile my own plugin outside of sofa directories.
CMake is looking for files “GTestTargets.cmake” and “SofaXXXTargets.cmake” which do not even exist on my system folders. I have followed all the instructions steps several times to install SOFA and I don’t know what I missed.Sorry for all those posts in this thread, but I really don’t understand why plugin compilation is not working on my Sofa installation on Windows. Thank you again for your help.
15 June 2021 at 15:59 #19703Julien D.BlockedHello everyone ๐
@Hugo Talbot tried to help me fixing my issues, by adding other file paths to my CMake prefix path, and it is not working…When I install Sofa, no TargetsXXX.cmake files are created. I think my issue comes from the lack of these files. Does anyone have these files created properly, and if so, in which folder ?
Thank you in advance a lot for your help.
Have a good week everyone ๐
15 June 2021 at 18:44 #19704HugoKeymasterHi @jducrocq007
When you say that you installed SOFA v20.12 yourself : did you downloaded the binary version from the sofa-framework.org/download page?
Or did you compile SOFA v20.12 from sources?
What is your CMake version?
Best,
Hugo
PS: do not hesitate to join us on Wednesday for the SOFA dev meeting
15 June 2021 at 23:04 #19706Julien D.BlockedHello, I have compiled SOFA v20.12 from the sources. I have tried to install the binaries directly beforehand, but it was not working either.
My CMake version is 3.18.4.Thank you for your help ๐
I’ll try to join on wednesday (tomorrow)
16 June 2021 at 11:26 #19708Julien D.BlockedHello everyone
Thanks to Guillaume and Hugo’s advices, I moved forward and almost solved the error.
During the SOFA installation, I forgot to compile the INSTALL project. Compiling this project placed all the files TargetsXXX.cmake inside subdirectories of sofa/build/install.By setting CMAKE_PREFIX_PATH to the root path of the TargetsXXX.cmake files, my CMake configuration is working out nicely. However, after the configuration and generation steps on Cmake have been done, I have other issues of type
Erreur C2011 'sockaddr'ย : redรฉfinition du type 'struct'
and
Erreur (active) E0484 dรฉclaration d'instanciation explicite non valide MyPrettyMirror D:\Utilisateurs\jducrocq\Documents\Developpement\Sofa_workspace\MyPrettyMirror_win\share\BorderForces.h
About to try solving it with Guillaume.
Thanks for your help, again
16 June 2021 at 11:49 #19710Julien D.BlockedSo thanks to @Guillaume , I solved these issues by adding the line
#define WIN32_LEAN_AND_MEAN
to my file config.hNow I have Linkers errors, which comes from the fact that I did the plugin on SOFA v19.04 and now want to move it to v20.12.
EDIT: I also had to set my C++ compile option in Visual Studio to /std::c++17 in Visual Studio.
I have to include inline files from SOFA to solve this error, according to Guillaume. I’m trying that and keeping you in touch. Hope that this post will help someone else someday ๐
16 June 2021 at 12:25 #19711Julien D.BlockedHello again,
so I’ve added the line
#include <SofaBaseTopology/TopologySubsetData.inl>
to the file config.h of my plugin.And it worked ! I could go up to the generation of my plugin and got MyPrettyMirror.dll created without anymore issue ๐
However, when I tried to import the plugin thanks to the plugin manager of SOFA, I add the following error
[ERROR] [PluginManager] Plugin loading failed (D:/Utilisateurs/jducrocq/Documents/Librairies/sofa/build/plugins/MyPrettyMirror.dll): Le module spรcifiร est introuvable.
I tried to copy my dll to the sofa/build/plugins but it is not working…
I also tried to compile it in both debug and release mod, without any more success…Thanks again for your help, all ๐
16 June 2021 at 19:09 #19737Julien D.BlockedI solved this isssue, it was just that I needed to add an environment variable to my PATH to use my files compiled with VISP.
So I can compile my plugin completely on one of my computer using Windows ๐However, in the second Windows computer I’m using, I still have another compiler CXXX errors even after having added the #define WIN32_LEAN_AND_MEAN to my config.h file.
These errors are not a priority to solve, since I can compile the plugin in a computer, I can still export the dlls to use them in the other one.
However, if I solve this little issue or if anyone find a solution, feel free to share it ๐
Have a good end of day everyone ๐
16 June 2021 at 22:57 #19741HugoKeymasterHi @jducrocq007
Since your initial problem is solved I will close the issue.
If anyone else face & solve the issue you pointed out, we could discuss it later on here or in another forum topic.Best wishes,
Hugo
PS: feel free to reopen it anytime !
-
AuthorPosts
- You must be logged in to reply to this topic.