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

GSoC 2022: Manas Sivakumar Week 6 #236

Merged
merged 11 commits into from
Jul 25, 2022

Conversation

Manas23601
Copy link

@Manas23601 Manas23601 commented Jul 20, 2022

Changes proposed in this pull request:

  • Trying to make OR-Tools work with vrpRouting.

@Manas23601 Manas23601 added the manas-2022 Done by Manas Sivakumar label Jul 20, 2022
@Manas23601
Copy link
Author

OR tools example : https://github.com/Manas23601/google-or-practise.

@Manas23601
Copy link
Author

Manas23601 commented Jul 20, 2022

I tried asking for help in OR Tools official discord channel. I did whatever I could understand.
https://discord.com/invite/ENkQrdf (Discord Server)

so far I'm able to access the ortools library inside my repo repository (no header file undefined errors), but its failing when I use a function defined inside that library. I will attach the output log below.

After I build ortools. I am able to build and run a example.cc file perfectly with make run SOURCE=\path\to\file.cc in the root folder of ortools. Whereas with just g++ -std=c++17 it fails

Error Message:

manas@Fallen-Knight:~/Codes/GSOC-2022/MyFork$ g++ -std=c++17 bin_packing.cc
/usr/bin/ld: /tmp/ccNh7n0N.o: in function `operations_research::BinPackingMip()':
bin_packing.cc:(.text+0x59): undefined reference to `operations_research::MPSolver::CreateSolver(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x1bc): undefined reference to `operations_research::MPSolver::MakeIntVar(double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x2ca): undefined reference to `operations_research::MPSolver::MakeIntVar(double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x33a): undefined reference to `operations_research::LinearExpr::LinearExpr()'
/usr/bin/ld: bin_packing.cc:(.text+0x395): undefined reference to `operations_research::LinearExpr::LinearExpr(operations_research::MPVariable const*)'
/usr/bin/ld: bin_packing.cc:(.text+0x3ab): undefined reference to `operations_research::LinearExpr::operator+=(operations_research::LinearExpr const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x3ed): undefined reference to `operations_research::LinearExpr::LinearExpr(double)'
/usr/bin/ld: bin_packing.cc:(.text+0x40a): undefined reference to `operations_research::operator==(operations_research::LinearExpr const&, operations_research::LinearExpr const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x419): undefined reference to `operations_research::MPSolver::MakeRowConstraint(operations_research::LinearRange const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x47a): undefined reference to `operations_research::LinearExpr::LinearExpr()'
/usr/bin/ld: bin_packing.cc:(.text+0x4dc): undefined reference to `operations_research::LinearExpr::LinearExpr(operations_research::MPVariable const*)'
/usr/bin/ld: bin_packing.cc:(.text+0x515): undefined reference to `operations_research::operator*(double, operations_research::LinearExpr)'
/usr/bin/ld: bin_packing.cc:(.text+0x52b): undefined reference to `operations_research::LinearExpr::operator+=(operations_research::LinearExpr const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x5a6): undefined reference to `operations_research::LinearExpr::LinearExpr(operations_research::MPVariable const*)'
/usr/bin/ld: bin_packing.cc:(.text+0x5c7): undefined reference to `operations_research::operator*(operations_research::LinearExpr, double)'
/usr/bin/ld: bin_packing.cc:(.text+0x5e4): undefined reference to `operations_research::operator<=(operations_research::LinearExpr const&, operations_research::LinearExpr const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x5f3): undefined reference to `operations_research::MPSolver::MakeRowConstraint(operations_research::LinearRange const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x665): undefined reference to `operations_research::LinearExpr::LinearExpr()'
/usr/bin/ld: bin_packing.cc:(.text+0x6aa): undefined reference to `operations_research::LinearExpr::LinearExpr(operations_research::MPVariable const*)'
/usr/bin/ld: bin_packing.cc:(.text+0x6c0): undefined reference to `operations_research::LinearExpr::operator+=(operations_research::LinearExpr const&)'
/usr/bin/ld: bin_packing.cc:(.text+0x705): undefined reference to `operations_research::MPSolver::Solve()'
/usr/bin/ld: bin_packing.cc:(.text+0x756): undefined reference to `operations_research::MPObjective::Value() const'
/usr/bin/ld: bin_packing.cc:(.text+0x7d6): undefined reference to `operations_research::MPVariable::solution_value() const'
/usr/bin/ld: bin_packing.cc:(.text+0x8b5): undefined reference to `operations_research::MPVariable::solution_value() const'
/usr/bin/ld: /tmp/ccNh7n0N.o: in function `absl::lts_20211102::container_internal::EmptyGroup()':
bin_packing.cc:(.text._ZN4absl12lts_2021110218container_internal10EmptyGroupEv[_ZN4absl12lts_2021110218container_internal10EmptyGroupEv]+0xb): undefined reference to `absl::lts_20211102::container_internal::kEmptyGroup'
/usr/bin/ld: /tmp/ccNh7n0N.o: in function `operations_research::MPObjective::MinimizeLinearExpr(operations_research::LinearExpr const&)':
bin_packing.cc:(.text._ZN19operations_research11MPObjective18MinimizeLinearExprERKNS_10LinearExprE[_ZN19operations_research11MPObjective18MinimizeLinearExprERKNS_10LinearExprE]+0x28): undefined reference to `operations_research::MPObjective::OptimizeLinearExpr(operations_research::LinearExpr const&, bool)'
collect2: error: ld returned 1 exit status

@Manas23601
Copy link
Author

Manas23601 commented Jul 20, 2022

Please take a look at the discord conversation as well. ("general" room). To summarise OR tools when installed from source and built works with a make run SOURCE=\path\to\file.cc but not with g++ -std=c++17 file.cc

https://github.com/or-tools/cmake_or-tools Used this as a reference. I think I need to somehow compile my example while building.

@cvvergara
Copy link
Member

something like

git mv  * test_or_tools

@cvvergara
Copy link
Member

Instruction to "install google-or-tools in your local machine"

@Manas23601
Copy link
Author

Manas23601 commented Jul 21, 2022

git clone -b stable --single-branch git@github.com:google/or-tools.git
cmake -S. -Bbuild -DBUILD_DEPS:BOOL=ON
cmake --build build

@Manas23601 Manas23601 marked this pull request as ready for review July 25, 2022 11:59
@Manas23601 Manas23601 merged commit 8fe8a5e into pgRouting:manas-2022 Jul 25, 2022
@Manas23601 Manas23601 changed the title GSoC 22 : Manas Sivakumar Week 6 GSoC 2022 : Manas Sivakumar Week 6 Sep 11, 2022
@Manas23601 Manas23601 changed the title GSoC 2022 : Manas Sivakumar Week 6 GSoC 2022: Manas Sivakumar Week 6 Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manas-2022 Done by Manas Sivakumar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants