mit-acl / faster

3D Trajectory Planner in Unknown Environments
BSD 3-Clause "New" or "Revised" License
979 stars 182 forks source link

Wrong findGUROBI #13

Closed akshitj1 closed 3 years ago

akshitj1 commented 3 years ago

https://github.com/mit-acl/faster/blob/3af4e9b276452694b6d527f13eaac926bef0138b/faster/FindGUROBI.cmake#L24 In the findGUROBI, both GUROBI_LIBRARY and GUROBI_CXX_LIBRARY matches to same libgurobi_c++.a as same pattern is present in both. This results to not linking of .so files eg. libgurobi91.so. This leads to undefined reference errors in gurobi.

jtorde commented 3 years ago

Hi @akshitj1

Could you try to compile it again with the last commit (fc19020)? Let me know if that still doesn't solve the problem

jtorde commented 3 years ago

Also, remember to do this

akshitj1 commented 3 years ago

For now I have quick fixed with this:

find_library( GUROBI_LIBRARY 
              NAMES libgurobi91.so
              PATHS "$ENV{GUROBI_HOME}/lib" 
                    "/Library/gurobi502/mac64/lib"
                    "C:\\libs\\gurobi502\\lib"
              )

find_library( GUROBI_CXX_LIBRARY 
              NAMES gurobi_c++
              PATHS "$ENV{GUROBI_HOME}/lib" 
                    "/Library/gurobi502/mac64/lib"
                    "C:\\libs\\gurobi502\\lib"
              )

I will send PR with more robust fix later.

jtorde commented 3 years ago

Perfect, thanks. I've just updated the FindGurobi.cmake with the one available in the official page of gurobi (link), and I've modified it to make it independent of the version of Gurobi.

Feel free to create a PR with any better/more robust solutions.