jvgomez / fast_methods

N-Dimensional Fast Methods: Fast Marching, Fast Sweeping, Group Marching, Fast Iterative, etc.
http://jvgomez.github.io/fast_methods/
GNU General Public License v3.0
174 stars 59 forks source link

Help with building #10

Closed kevin-thankyou-lin closed 2 years ago

kevin-thankyou-lin commented 3 years ago

Hi! Thanks for the great code base.

I'm on g++/gcc 7.5 and I followed the instructions here starting in the fast_methods directory.

image

I run this:

fast_methods/build$ make -j4
make: *** No targets specified and no makefile found.  Stop

Do you know what I'm doing wrong?

jvgomez commented 3 years ago

Ouch! I believe the issue is that the doc is missing the cmake command. Can you please try:

mkdir build
cd build
cmake .. 
make -j

That should work.

kevin-thankyou-lin commented 3 years ago

That helps!

Though, I've a new issue, probably because my g++ version is 7.5. Would you know the fix here?

[ 18%] Building CXX object CMakeFiles/fast_methods.dir/src/ndgridmap/fmcell.cpp.o
[ 18%] Building CXX object CMakeFiles/fast_methods.dir/src/ndgridmap/cell.cpp.o
[ 18%] Building CXX object CMakeFiles/fast_methods.dir/src/console/console.cpp.o
[ 25%] Linking CXX shared library libfast_methods.so
[ 25%] Built target fast_methods
Scanning dependencies of target test_fm
Scanning dependencies of target full_example
Scanning dependencies of target fm_benchmark
Scanning dependencies of target test_fm2
[ 31%] Building CXX object examples/CMakeFiles/test_fm.dir/test_fm.cpp.o
[ 37%] Building CXX object examples/CMakeFiles/full_example.dir/full_example.cpp.o
[ 43%] Building CXX object CMakeFiles/fm_benchmark.dir/src/benchmark/fm_benchmark.cpp.o
[ 50%] Building CXX object examples/CMakeFiles/test_fm2.dir/test_fm2.cpp.o
In file included from /home/thankyou-always/fast_methods/include/fast_methods/fm/fmm.hpp:53:0,
                 from /home/thankyou-always/fast_methods/examples/test_fm.cpp:9:
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp: In member function ‘virtual double EikonalSolver<grid_t>::solveEikonal(const int&)’:
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp:55:22: error: there are no arguments to ‘isinf’ that depend on a template parameter, so a declaration of ‘isinf’ must be available [-fpermissive]
                 if (!isinf(minTInDim) && minTInDim < grid_->getCell(idx).getArrivalTime())
                      ^~~~~
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp:55:22: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /home/thankyou-always/fast_methods/include/fast_methods/fm/fmm.hpp:53:0,
                 from /home/thankyou-always/fast_methods/examples/full_example.cpp:12:
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp: In member function ‘virtual double EikonalSolver<grid_t>::solveEikonal(const int&)’:
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp:55:22: error: there are no arguments to ‘isinf’ that depend on a template parameter, so a declaration of ‘isinf’ must be available [-fpermissive]
                 if (!isinf(minTInDim) && minTInDim < grid_->getCell(idx).getArrivalTime())

...

In file included from /home/thankyou-always/fast_methods/include/fast_methods/fm/fmm.hpp:53:0,
                 from /home/thankyou-always/fast_methods/src/benchmark/fm_benchmark.cpp:25:
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp: In instantiation of ‘double EikonalSolver<grid_t>::solveEikonal(const int&) [with grid_t = nDGridMap<FMCell, 2>]’:
/home/thankyou-always/fast_methods/src/benchmark/fm_benchmark.cpp:99:1:   required from here
/home/thankyou-always/fast_methods/include/fast_methods/fm/eikonalsolver.hpp:55:27: error: ‘isinf’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
                 if (!isinf(minTInDim) && minTInDim < grid_->getCell(idx).getArrivalTime())
                      ~~~~~^~~~~~~~~~~
In file included from /home/thankyou-always/fast_methods/src/benchmark/fm_benchmark.cpp:16:0:
/usr/include/c++/7/cmath:612:5: note: ‘template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isinf(_Tp)’ declared here, later in the translation unit
     isinf(_Tp __x)
     ^~~~~
CMakeFiles/fm_benchmark.dir/build.make:62: recipe for target 'CMakeFiles/fm_benchmark.dir/src/benchmark/fm_benchmark.cpp.o' failed
make[2]: *** [CMakeFiles/fm_benchmark.dir/src/benchmark/fm_benchmark.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/fm_benchmark.dir/all' failed
make[1]: *** [CMakeFiles/fm_benchmark.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
jvgomez commented 3 years ago

Sorry for the late reply.

That error is interesting. Can you try changing the corresponding line to std:: isinf...? To make sure it uses STL isinf Perhaps the header cmath has to be included as well.

Please let me know how it goes!

niuwengang commented 2 years ago

Sorry for the late reply.

That error is interesting. Can you try changing the corresponding line to std:: isinf...? To make sure it uses STL isinf Perhaps the header cmath has to be included as well.

Please let me know how it goes!

我也遇到了相同的问题,在报错文件恰当的位置添加using namespace std;#include <cmath>即可编译成功。

kevin-thankyou-lin commented 2 years ago

Whoops, @jvgomez sorry I never ended up using the repo, though it sounds like the fix is to add the lines that @gangtongxue suggested - thank you @jvgomez and @gangtongxue!