Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error while applying the patch #43

Closed
hardesh opened this issue Dec 11, 2020 · 7 comments
Closed

Build error while applying the patch #43

hardesh opened this issue Dec 11, 2020 · 7 comments

Comments

@hardesh
Copy link

hardesh commented Dec 11, 2020

Hi! Thanks for sharing your amazing work!!

I'm getting build error when cmake is trying to applying the patch. It's possible that in the new version of the TSP library the line numbers are changed.

Here's the verbose output of catkin build:

____________________________________________________________________________________________________________________________________________________________________________
Errors     << polygon_coverage_solvers:make /home/harshal/cov_planner_ws/logs/polygon_coverage_solvers/build.make.003.log                                                   
/usr/local/bin/cmake -S/home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers -B/home/harshal/cov_planner_ws/build/polygon_coverage_solvers --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/harshal/cov_planner_ws/build/polygon_coverage_solvers/CMakeFiles /home/harshal/cov_planner_ws/build/polygon_coverage_solvers//CMakeFiles/progress.marks
/usr/bin/make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
/usr/bin/make  -f CMakeFiles/polygon_coverage_solvers.dir/build.make CMakeFiles/polygon_coverage_solvers.dir/depend
/usr/bin/make  -f CMakeFiles/gk_ma.dir/build.make CMakeFiles/gk_ma.dir/depend
make[2]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
cd /home/harshal/cov_planner_ws/build/polygon_coverage_solvers && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers/CMakeFiles/gk_ma.dir/DependInfo.cmake --color=
make[2]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
cd /home/harshal/cov_planner_ws/build/polygon_coverage_solvers && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers/CMakeFiles/polygon_coverage_solvers.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
/usr/bin/make  -f CMakeFiles/gk_ma.dir/build.make CMakeFiles/gk_ma.dir/build
make[2]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
make[2]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
/usr/bin/make  -f CMakeFiles/polygon_coverage_solvers.dir/build.make CMakeFiles/polygon_coverage_solvers.dir/build
make[2]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
make[2]: Nothing to be done for 'CMakeFiles/polygon_coverage_solvers.dir/build'.
make[2]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
[  5%] Performing patch step for 'gk_ma'
cd /home/harshal/cov_planner_ws/build/polygon_coverage_solvers/gk_ma-prefix/src/gk_ma && patch GkMa/OurHeuristic/Algorithm.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Algorithm.patch && "" patch NativeHelper/ClusterOptimisation.cpp /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/ClusterOptimisationCpp.patch && "" patch GkMa/OurHeuristic/Types/Generation.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Generation.patch && "" patch GkMa/OurHeuristic/GeneticAlgorithm.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/GeneticAlgorithm.patch && "" patch GkMa/Helper.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Helper.patch && "" patch NativeHelper/ClusterOptimisation.h /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/ClusterOptimisationH.patch && "" patch NativeHelper/ImprovementManager.h /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/ImprovementManagerH.patch && "" patch NativeHelper/Insert.cpp /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/InsertCpp.patch && "" patch NativeHelper/Insert.h /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/InsertH.patch && "" patch NativeHelper/NativeHelper.cpp /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/NativeHelperCpp.patch && "" patch NativeHelper/Swap.cpp /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/SwapCpp.patch && "" patch NativeHelper/NativeHelper.h /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/NativeHelperH.patch && "" patch GkMa/OurHeuristic/NativeHelper.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/NativeHelper.patch && "" patch GkMa/OurSolver.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/OurSolver.patch && "" patch GkMa/OurHeuristic/Types/Permutation.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Permutation.patch && "" patch GkMa/Program.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Program.patch && "" patch GkMa/Solver.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Solver.patch && "" patch GkMa/Loader/Task.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Task.patch && "" patch GkMa/OurHeuristic/Types/Tour.cs /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers/patches/Tour.patch
[ 25%] Built target polygon_coverage_solvers
patching file GkMa/OurHeuristic/Algorithm.cs
Hunk #2 FAILED at 33.
Hunk #3 FAILED at 37.
Hunk #4 succeeded at 120 (offset 44 lines).
2 out of 4 hunks FAILED -- saving rejects to file GkMa/OurHeuristic/Algorithm.cs.rej
CMakeFiles/gk_ma.dir/build.make:122: recipe for target 'gk_ma-prefix/src/gk_ma-stamp/gk_ma-patch' failed
/usr/bin/make  -f CMakeFiles/gtsp_instances.dir/build.make CMakeFiles/gtsp_instances.dir/depend
make[2]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
make[2]: *** [gk_ma-prefix/src/gk_ma-stamp/gk_ma-patch] Error 1
CMakeFiles/Makefile2:532: recipe for target 'CMakeFiles/gk_ma.dir/all' failed
make[1]: *** [CMakeFiles/gk_ma.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
cd /home/harshal/cov_planner_ws/build/polygon_coverage_solvers && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers /home/harshal/cov_planner_ws/src/polygon_coverage_planning/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers /home/harshal/cov_planner_ws/build/polygon_coverage_solvers/CMakeFiles/gtsp_instances.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
/usr/bin/make  -f CMakeFiles/gtsp_instances.dir/build.make CMakeFiles/gtsp_instances.dir/build
make[2]: Entering directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
make[2]: Nothing to be done for 'CMakeFiles/gtsp_instances.dir/build'.
make[2]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
[ 65%] Built target gtsp_instances
make[1]: Leaving directory '/home/harshal/cov_planner_ws/build/polygon_coverage_solvers'
Makefile:159: recipe for target 'all' failed
make: *** [all] Error 2

Is there another way to install the GTSP library?

@rikba
Copy link
Collaborator

rikba commented Dec 11, 2020

Hi @hardesh

I just ran a successful build on the build server (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) ). But I think @stlucas44 recently had the same issue as you because his machine did not run stock cmake. @stlucas44 can you confirm that it was the same error?

For reference, my personal machine is running cmake version 3.10.2 and it seems to build fine as well.

@hardesh
Copy link
Author

hardesh commented Dec 11, 2020

Hi @rikba

Yes, I may not have the stock cmake. I had recently updated the cmake while installing Open3D. I have cmake version 3.18 on my machine.

[ 25%] Built target polygon_coverage_solvers
patching file GkMa/OurHeuristic/Algorithm.cs
Hunk #2 FAILED at 33.
Hunk #3 FAILED at 37.
Hunk #4 succeeded at 120 (offset 44 lines).

The error is occurring while applying the patch on Algorithms.cs. So, I checked that file and in fact, the line numbers are different than those mentioned in the patch.

Screenshot from 2020-12-11 17-49-52

@rikba
Copy link
Collaborator

rikba commented Dec 11, 2020

Nice introspection!

It would be awesome, if you can fix the patch such that it runs with your newer cmake version and open a PR :)

@hardesh
Copy link
Author

hardesh commented Dec 11, 2020

Sure!
I'll give it a try over the weekend. 😃

@rikba rikba closed this as completed Dec 14, 2020
@hardesh
Copy link
Author

hardesh commented Dec 21, 2020

Hi @rikba

I wasn't able to find a solution for this on my Ubuntu 18.04. But I did build the package on Ubuntu 20 with default cmake and it's working. Thanks!

@rikba
Copy link
Collaborator

rikba commented Dec 21, 2020

Good to know, that it still builds on Ubuntu 20. Thank you!

@mhsitu
Copy link

mhsitu commented Mar 31, 2021

Hello @hardesh @rikba

Recently I also met this problem when I build this project on Ubuntu 18.04, ROS melodic and camke(version 3.18). Then I try to reinstall cmake(version 3.10.2), and I solved this problem. I hope this will help you.

kledom added a commit to kledom/polygon_coverage_planning that referenced this issue Jul 21, 2021
rikba added a commit that referenced this issue Aug 12, 2021
Noetic: Fix build for CMake > 3.14 (#43, #54)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants