febiosoftware / FEBio

FEBio Suite Solver
https://febio.org/
MIT License
174 stars 65 forks source link

Compilation error #54

Closed TS-CUBED closed 11 months ago

TS-CUBED commented 1 year ago

I'm trying to install FEBio 3.8 from source and get:

[ 54%] Building CXX object CMakeFiles/febiomix.dir/FEBioMix/FESBMPointSource.cpp.o
/home/thor/software/FEBio-3.8/FEBioMix/FESBMPointSource.cpp: In member function ‘void FESBMPointSource::FindNodesInRadius(std::vector<FEMaterialPoint*>&, double&)’:
/home/thor/software/FEBio-3.8/FEBioMix/FESBMPointSource.cpp:360:53: error: ‘numeric_limits’ is not a member of ‘std’
  360 |                                 double min_d = std::numeric_limits<double>::max();
      |                                                     ^~~~~~~~~~~~~~
/home/thor/software/FEBio-3.8/FEBioMix/FESBMPointSource.cpp:360:68: error: expected primary-expression before ‘double’
  360 |                                 double min_d = std::numeric_limits<double>::max();
      |                                                                    ^~~~~~
make[2]: *** [CMakeFiles/febiomix.dir/build.make:972: CMakeFiles/febiomix.dir/FEBioMix/FESBMPointSource.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:185: CMakeFiles/febiomix.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

System is Pop-OS (Ubuntu 22.04 LTS based), gcc 11.3.

I have installed LEVMAR, MKL, and MMG.

TS-CUBED commented 1 year ago

The problem seems to be the 'numeric_limits' is not in std anymore with libgcc11. So limits needs to be included now.

I cannot test this on older compilers, so cannot do a PR on this.

All I changed was add:

#include <limits>

to FESBMPointSource.cpp

SteveMaas1978 commented 11 months ago

The "limits" file is now included in FESBMPointSource.cpp.