mimesis-inria / caribou

Multi-physics computation library
GNU Lesser General Public License v3.0
29 stars 17 forks source link

Problem with Caribou compilation #96

Closed ateixeira0163 closed 2 years ago

ateixeira0163 commented 2 years ago

After updating SOFA to v21.12.00 (compiling from the source) and recompiling Caribou also from the sources I got some problems apparently with the variable SOFA_VERSION. The error while building caribou starts as follow:

[ 20%] Building CXX object src/SofaCaribou/CMakeFiles/SofaCaribou.dir/Algebra/BaseVectorOperations.cpp.o
In file included from /home/user/Sofa/caribou/src/SofaCaribou/Algebra/BaseVectorOperations.cpp:7:
/home/user/Sofa/build/install/include/Sofa.Compat/sofa/defaulttype/BaseVector.h:31:11: error: conflicting declaration ‘using BaseVector = class sofa::linearalgebra::BaseVector’
   31 |     using BaseVector = sofa::linearalgebra::BaseVector;
      |           ^~~~~~~~~~
In file included from /home/user/Sofa/caribou/src/SofaCaribou/Algebra/BaseVectorOperations.cpp:2:
/home/user/Sofa/caribou/src/SofaCaribou/../SofaCaribou/Algebra/BaseVectorOperations.h:14:11: note: previous declaration as ‘class sofa::defaulttype::BaseVector’
   14 |     class BaseVector;
      |           ^~~~~~~~~~

Upon research on the file ~/Sofa/build/install/include/Sofa.Config/sofa/version.h, I saw that the SOFA_VERSION seems well defined :

#ifndef SOFA_VERSION_H
#define SOFA_VERSION_H

#define SOFA_VERSION_STR "21.12.00"

// We use version numbers based on the date: yy.mm.pp (year, month, patch).
// - SOFA_VERSION / 10000 is the year number
// - SOFA_VERSION / 100 % 100 is the month number
// - SOFA_VERSION % 100 is the patch number
#define SOFA_VERSION 211200

#endif

And as for the the file Algebra/BaseVectorOperations.cpp:

#include <sofa/version.h>
#if (defined(SOFA_VERSION) && SOFA_VERSION < 211299)
#include <sofa/defaulttype/BaseVector.h>
#else
#include <sofa/linearalgebra/BaseVector.h>
#endif // #if (defined(SOFA_VERSION) && SOFA_VERSION < 211299)
#include <SofaBaseLinearSolver/FullVector.h>

Thanks.

jnbrunet commented 2 years ago

Hey @ateixeira0163

Thanks for the report. This issue should be fix by https://github.com/jnbrunet/caribou/pull/95 . I'm struggling a bit with MacOS CI but I will try to merge it this evening or tomorrow. If you can't wait, you can safely checkout the PR's branch or simply cherry-pick this commit, the CI issue isn't related.

jnbrunet commented 2 years ago

Alright, #95 has been merged. I will therefore close this issue. Don't hesitate to reopen it if it didn't help.

Thanks again for the report.

ateixeira0163 commented 2 years ago

Thanks! Everything is working fine!