<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I managed to solve it by building LEMON using the following cmake command:</div><div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; padding: 16px; line-height: 1.45; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); font-variant-ligatures: normal; orphans: 2; widows: 2;" class=""><code style="box-sizing: border-box; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; padding: 0px; margin: 0px; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; line-height: inherit; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;" class="">cmake -DCMAKE_INSTALL_PREFIX=$HOME/libraries/lemon -DILOG_ROOT_DIR=$HOME/libraries/ILOG/CPLEX_Studio1271 -DILOG_CPLEX_LIBRARY=$HOME/libraries/ILOG/CPLEX_Studio1271/cplex/lib/x86-64_linux/static_pic/libcplex.a -DILOG_CONCERT_LIBRARY=$HOME/libraries/ILOG/CPLEX_Studio1271/concert/lib/x86-64_linux/static_pic/libconcert.a ..
</code></pre></div><div class=""><code style="box-sizing: border-box; padding: 0px; margin: 0px; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; line-height: inherit; word-wrap: normal;" class=""><font face="Helvetica" class="">To link lemon with my library I added the following flags when linking:</font></code></div><div class=""><code style="box-sizing: border-box; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; padding: 0px; margin: 0px; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; line-height: inherit; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;" class=""><br class=""></code></div><div class=""><code style="box-sizing: border-box; padding: 0px; margin: 0px; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; line-height: inherit; word-wrap: normal;" class=""><pre style="font-size: 13.6px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; box-sizing: border-box; overflow: auto; margin-top: 0px; margin-bottom: 16px; padding: 16px; line-height: 1.45; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51); font-variant-ligatures: normal; orphans: 2; widows: 2;" class=""><code style="box-sizing: border-box; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; padding: 0px; margin: 0px; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; line-height: inherit; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;" class="">-L ~/libraries/ILOG/CPLEX_Studio1271/cplex/lib/x86-64_linux/static_pic
-lcplex
-lpthread</code></pre><div class=""><font face="Helvetica" class="">An example compile command is:</font></div><div style="font-size: 13.6px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;" class=""><br class=""></div><div style="font-size: 13.6px; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;" class=""><span style="color: rgb(51, 51, 51); font-size: 13.6px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgba(0, 0, 0, 0.0392157);" class="">g++ -o main.out -I $HOME/libraries/lemon/include <a href="http://main.cc" class="">main.cc</a> -L ~/libraries/lemon/lib -L ~/libraries/ILOG/CPLEX_Studio1271/cplex/lib/x86-64_linux/static_pic -lemon -lglpk -ltinyxml2 -lcplex -lpthread</span></div></code></div><div class=""><code style="box-sizing: border-box; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.6px; padding: 0px; margin: 0px; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; line-height: inherit; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;" class=""><br class=""></code></div><div class=""><div>I am using the ~/libraries directory because that is where I installed both LEMON and CPLEX libraries. So far I have run a very simple LP program and it seems to be working. As a side note, in order to compile my program successfully, I had to include the cplex header file before the lp header file as shown below:</div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(180, 38, 26); background-color: rgb(255, 255, 255);" class=""><span style="color: #0433ff" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(180, 38, 26); background-color: rgb(255, 255, 255);" class=""><span style="color: #0433ff" class="">#include </span><lemon/cplex.h></div><div><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255); color: rgb(4, 51, 255);" class="">#include </span><span style="color: rgb(180, 38, 26); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><lemon/lp.h></span> </div><div><br class=""></div><div>Do not hesitate to contact me should you require further information.</div><div><br class=""></div><div>Thanks a lot for your time and reply.</div><div>Kind Regards,</div><div>Noel</div><div><br class=""><blockquote type="cite" class=""><div class="">On 27 Nov 2017, at 10:09, Alpar Juttner <<a href="mailto:alpar@cs.elte.hu" class="">alpar@cs.elte.hu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">The problem with the automatic detection of CPLEX is that it puts the headers and libs into different folders for different versions and I could not find a way to automatically guess the default location. It is hard coded up to version 12.3 in the file cmake/FindCPLEX.cmake.</div><div class=""><br class=""></div><div class="">So you may try to edit this file.</div><div class=""><br class=""></div><div class="">Any feedback (or update of FindCPLEX.cmake) is very welcome.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Alpár</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">On Fri, 2017-11-17 at 19:40 +0100, Noel Farrugia wrote:</div><blockquote type="cite" class=""><div dir="ltr" class="">Hi all, <div class=""><br class=""></div><div class="">I am trying to use LEMON in conjunction with CPLEX 12.71 however when I am compiling my program I am getting the error:</div><div class=""><div class=""><br class=""></div><div class="">error: ‘CplexLp’ does not name a type</div><div class=""> typedef CplexLp Lp;</div></div><div class=""><br class=""></div><div class="">To solve this error I included the CplexLp header file before the general Lp header file in one of my header files like so:</div><div class=""><br class=""></div><div class=""><div class=""><font face="monospace, monospace" class="">#include <lemon/cplex.h></font></div><div class=""><font face="monospace, monospace" class="">#include <lemon/lp.h></font></div></div><div class=""><br class=""></div><div class="">However, when I try to compile my program I now get a list of errors similar to the following:</div><div class=""><br class=""></div><div class=""><div class=""><font face="monospace, monospace" class=""><a href="http://cplex.cc" class="">cplex.cc</a>:(.text+0x2b1): undefined reference to `CPXfreeprob'</font></div><div class=""><font face="monospace, monospace" class=""><a href="http://cplex.cc" class="">cplex.cc</a>:(.text+0x2c4): undefined reference to `CPXcreateprob'</font></div></div><div class=""><br class=""></div><div class="">I have a hunch that when I am compiling LEMON the CPLEX library is not being linked correctly; however, when I build Lemon no errors are reported. The command I used to compile LEMON is:</div><div class=""><br class=""></div><div class=""><font face="monospace, monospace" class="">cmake -DCMAKE_INSTALL_PREFIX=$HOME/libraries/lemon -DILOG_CPLEX_INCLUDE_DIR=$HOME/ILOG/CPLEX_Studio1271/cplex/include/ -DILOG_CPLEX_LIBRARY=$HOME/ILOG/CPLEX_Studio1271/cplex/lib/x86-64_linux/static_pic/libcplex.a -DILOG_CONCERT_LIBRARY=$HOME/ILOG/CPLEX_Studio1271/concert/lib/x86-64_linux/static_pic/libconcert.a -DILOG_CONCERT_INCLUDE_DIR=$HOME/ILOG/CPLEX_Studio1271/concert/include/ ..</font><br class=""></div><div class=""><br class=""></div><div class="">I had to pass all of the directories as parameters because otherwise Lemon would not detect them all correctly automatically. Does anyone have any pointers what could be the issue please?</div><div class="">I think that the issue is with LEMON and not my developed application because my application compiles correctly when using GLPK.</div><div class=""><br class=""></div><div class="">Do not hesitate to contact me should you require further information.</div><div class="">Thanks a lot for your time. Much appreciated.</div><div class="">Kind Regards,</div><div class="">Noel</div></div>
<pre class="">_______________________________________________
Lemon-user mailing list
<a href="mailto:Lemon-user@lemon.cs.elte.hu" class="">Lemon-user@lemon.cs.elte.hu</a>
<a href="http://lemon.cs.elte.hu/mailman/listinfo/lemon-user" class="">http://lemon.cs.elte.hu/mailman/listinfo/lemon-user</a>
</pre></blockquote></div></div></blockquote></div><br class=""></div></body></html>