Gurobi fails out of the box

164 views
Skip to first unread message

Mahdi Ghamkhari

unread,
Jan 17, 2017, 2:22:40 AM1/17/17
to Gurobi Optimization
Hello Everyone, 

I have downloaded the Linux version of Gurobi and navigate to the following folder:

/opt/gurobi701/linux64/examples/build

Then I issue the `make` command in the Terminal and get the following compilation error:

/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lgurobi70
collect2: error: ld returned 1 exit status
make: *** [Makefile:68: genconstr_c] Error 1

Gurobi fails to work out-of-the-box. I am compiling on Cygwin and using GNU gcc-g++ compiler. Please help me resolve this issue. 

Mahdi

Daniel Espinoza

unread,
Jan 18, 2017, 8:48:59 AM1/18/17
to Gurobi Optimization
Mahdi,

As the linker says, it can not find -lgurobi70; this might be due to two things:
1.- you did not install gurobi before issuing make, if you did and you can run gurobi_cl, then
2.- you must include the path to ligburobi70.so into the environment variable LD_LIBRARY_PATH so that the linker will find it during compilation

Good luck,
Daniel E.

des...@gurobi.com

unread,
Jan 18, 2017, 9:19:05 PM1/18/17
to Gurobi Optimization

Hi Mahdi,

I don't believe that it  is possible to do what you want. If I am understanding this correctly you want to compile a C/C++ program on a windows machine using Cygwin, gcc and Gurobi Linux libraries. Cygwin does not make a windows machine a Linux machine (it is still a windows machine with UNIX like tools). Thus, you cannot link the Gurobi Linux libraries on a windows machine. Also, we don't support gcc on windows. Thus we don't have a windows port for gcc.  On windows we only provide libraries for Microsoft Visual Studio. Thus, I think you have three choices.

1) Create a Linux Virtual Machine (VM) on your windows machine and compile your program using gcc and link to the gurobi linux libraries
2) Use MS Visual Studio  command line tool to build you application using the Gurobi windows libraries. See: https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx
3) Use the MS Visual Studio IDE (integrated development environment) to build the app on windows. This what we would recommend on windows.


I hope this helps

Amal de Silva
Gurobi Optimization
Reply all
Reply to author
Forward
0 new messages