Thanks Ted. Everything appears to be working.<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 4, 2012 at 9:35 AM, Ted Ralphs <span dir="ltr">&lt;<a href="mailto:ted@lehigh.edu" target="_blank">ted@lehigh.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Linux has separate search paths for executables and shared libraries. The problem is that the directory where the COIN libraries live is not in your library search path. You need to either set the environment variable &quot;LD_LIBRARY_PATH&quot; to include the path to the directory where the COIN libraries are installed or install them into one of the system library paths, such as /usr/lib. Another option is to link with something like<br>



<font><br></font><pre><font>-Wl,--rpath -Wl,/home/me/Coin-Pkg/lib</font></pre><br>which embeds the path to the library in the executable. There is actually quite a bit of documentation describing how to link to COIN libraries here:<br>



<br><a href="https://projects.coin-or.org/BuildTools/wiki/user-examples#LinkingyourCodewithCOIN-ORLibraries" target="_blank">https://projects.coin-or.org/BuildTools/wiki/user-examples#LinkingyourCodewithCOIN-ORLibraries</a><br>

<br>This should give you everything you need.<br>

<br>Cheers,<br><br>Ted<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Tue, Dec 4, 2012 at 6:57 AM, Hugh Medal <span dir="ltr">&lt;<a href="mailto:hugh.medal@msstate.edu" target="_blank">hugh.medal@msstate.edu</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Ted.<div><br></div><div>That helped. I added all of the libraries listed by the pkg-config tool to Eclipse. Now, my build is successful.</div>



<div><br></div><div>However, when I try to run my class, I get this error:</div>

<div><br></div><div><div>/home/hmedal/Documents/2_msu/research_manager/code/ide/eclipse/HughCPP/Debug/HughCPP: error while loading shared libraries: libOsiSym.so.2: cannot open shared object file: No such file or directory</div>





</div><div><br></div><div>Do you have any ideas?<br></div><div><br></div><div>Here is my class again:</div><div><br></div><div>MySource.cpp</div><div><br></div><div>#include &quot;OsiSymSolverInterface.hpp&quot;<br></div>



<div>

<div><br></div><div><div>int main(int argc, char **argv)</div><div>{</div><div><span style="white-space:pre-wrap">        </span>OsiSymSolverInterface osi;</div><div>}</div></div><div><br></div></div><div>Here is the list of libraries I am using:</div>





<div><br></div><div><div><div>Building target: HughCPP</div><div>Invoking: GCC C++ Linker</div></div><div>g++ -L/opt/ibm/ILOG/CPLEX_Studio124/cplex/lib/x86_sles10_4.1/static_pic -L/opt/ibm/ILOG/CPLEX_Studio124/concert/lib/x86_sles10_4.1/static_pic -L/opt/SYMPHONY-5.4.4/lib -o &quot;HughCPP&quot;  ./src/lagrangean/LRAlgorithm.o ./src/lagrangean/LRAlgorithm_test.o ./src/lagrangean/LagrangeanFormulation.o ./src/lagrangean/LagrangeanFormulation_test.o  ./src/knapsack/KnapsackDP.o ./src/knapsack/KnapsackDP_test.o  ./src/Lottery.o ./src/MegaLottery.o ./src/MySource.o   -lilocplex -lcplex -lconcert -lm -lpthread -lOsiSym -lSym -lCgl -lOsiClp -lClp -lOsi -lCoinUtils -lbz2 -lz -llapack -lblas</div>





</div><div><br></div><div>Also, I tried using the Makefile in <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">&lt;prefix&gt;/SYMPHONY/Examples to build my file (MySource.cpp). However, it gives this error:</span></div>





<div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><font face="arial, sans-serif">MySource.cpp:10:37: fatal error: OsiSymSolverInterface.hpp: No such file or directory</font><br>





</div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I don&#39;t see any references to </font><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">&lt;prefix&gt;/include in the Makefile.</span></div>





<div><br></div><div>Thanks,<br>Hugh</div><div><div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 2, 2012 at 5:52 PM, Ted Ralphs <span dir="ltr">&lt;<a href="mailto:ted@lehigh.edu" target="_blank">ted@lehigh.edu</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Hugh,<br><br>The problem is that you need to link more than just the SYMPHONY library. There is a separate library for the OSI interface, as well as libraries for a number of other dependent COIN projects. However, since you are in Linux, the fix is easy. The most straightforward way to build your own application is to just modify one of the files in the &lt;prefix&gt;/SYMPHONY/Examples directory. There is a Makefile there that will build an executable from any source file you provide. For example, simply typing &quot;make milp&quot; will build the main function in milp.c and link it to SYMPHONY. If you put MySource.cpp in the Examples directory and type &quot;make MySource&quot;, it should build properly. Note, however, that if you are going to use the OSI interface, you will need to set &quot;USE_OSI_INTERFACE&quot; to TRUE.<br>







<br>To give a little more detail in case you want to build you own makefile, you can use the automatically generated Makefile in &lt;prefix&gt;/SYMPHONY/Examples as a template. You will notice that the command line for linking gets the list of libraries using the &quot;pkg-config&quot; command. You can get the list of libraries explicitly using this command if you like. For example, here is the command to get the list of libraries that must be added when linking:<br>







<br>PKG_CONFIG_PATH=&lt;prefix&gt;/lib/pkgconfig pkg-config --libs symphony<br><br>You can also get a list of additional flags for building:<br><br>PKG_CONFIG_PATH=&lt;prefix&gt;/lib/pkgconfig pkg-config --cflags symphony<br>







<br>If you want to use the OSI interface, you need to replace &quot;symphony&quot; with &quot;osi-sym&quot; in the above command. <br><br>Another alternative is that the output of the pkg-config command is also automatically installed in &lt;prefix&gt;/share/coin/doc/SYMPHONY/sym_addlibs.txt.<br>







<br>This should get you going. Let me know if you have additional questions.<br><br>Cheers,<br><br>Ted<div><div><br><br><div class="gmail_quote">On Sat, Dec 1, 2012 at 11:03 AM, Hugh Medal <span dir="ltr">&lt;<a href="mailto:hugh.medal@msstate.edu" target="_blank">hugh.medal@msstate.edu</a>&gt;</span> wrote:<br>







<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Thank you Ted.</div><div><br></div><div><b>Here is my info:</b></div><div>OS: Linux (Ubuntu 12.04)</div>Compiler: g++ (version 4.6.3)



<div>SYMPHONY version: 5.4.4</div><div>Eclipse version: 4.2.0; using CDT plugin</div><div><br></div><div><b>Steps I have taken:</b></div><div>1. Installed SYMPHONY 5.4.4 into my /opt directory (using ./configure, make, make install; I ran make test and it was successful)</div>









<div>2. Added the symphony include directories to Eclipse</div><div>- Project &gt; Properties &gt; C/C++ Compiler &gt; Settings &gt; GCC C++ Compiler &gt; Includes</div><div>- added /opt/SYMPHONY-5.4.4/include and /opt/SYMPHONY-5.4.4/SYMPHONY/include to the &quot;include paths&quot; list</div>









<div>3. Added the symphony lib directory to Eclipse </div><div>- Project &gt; Properties &gt; C/C++ Compiler &gt; Settings &gt; GCC C++ Linker &gt; Libraries<br></div><div>- added /opt/SYMPHONY-5.4.4/lib to the &quot;Library search path&quot; list</div>









<div><div>3. Added the symphony Libraries Eclipse </div><div>- Project &gt; Properties &gt; C/C++ Compiler &gt; Settings &gt; GCC C++ Linker &gt; Libraries<br></div><div>- added &quot;Sym&quot; to the &quot;Libraries&quot; list (I am not sure if I need to add an more libraries)<br>









</div></div><div>4. Created a C++ project</div><div>5. Created the following .cpp file</div><div><br></div><div>#include &quot;coin/OsiSymSolverInterface.hpp&quot;<br></div><div><br></div><div><div>int main(int argc, char **argv)</div>









<div>{</div><div><span style="white-space:pre-wrap">        </span>OsiSymSolverInterface osi;</div><div>}</div></div><div><br></div><div><b>Problems:</b></div><div>When I build my project, I am getting this message (see errors in bold):</div>









<div><br></div><div><div>make all </div><div>Building file: ../src/MySource.cpp</div><div>Invoking: GCC C++ Compiler</div><div>g++ -I/opt/ibm/ILOG/CPLEX_Studio124/cplex/include -I/opt/ibm/ILOG/CPLEX_Studio124/concert/include -I/opt/SYMPHONY-5.4.4/include -I/opt/SYMPHONY-5.4.4/SYMPHONY/include -O0 -g3 -Wall -c -fmessage-length=0 -m32 -O -fPIC -fno-strict-aliasing -fexceptions -DNDEBUG -DIL_STD -MMD -MP -MF&quot;src/MySource.d&quot; -MT&quot;src/MySource.d&quot; -o &quot;src/MySource.o&quot; -c &quot;../src/MySource.cpp&quot;</div>









<div>Finished building: ../src/MySource.cpp</div><div> </div><div>Building target: HughCPP</div><div>Invoking: GCC C++ Linker</div><div>g++ -L/opt/ibm/ILOG/CPLEX_Studio124/cplex/lib/x86_sles10_4.1/static_pic -L/opt/ibm/ILOG/CPLEX_Studio124/concert/lib/x86_sles10_4.1/static_pic -L/opt/SYMPHONY-5.4.4/lib -o &quot;HughCPP&quot;  ./src/Lottery.o ./src/MegaLottery.o ./src/MySource.o   -lilocplex -lcplex -lconcert -lm -lpthread -lSym</div>









<div>./src/MySource.o: In function `main&#39;:</div><div><b>/home/hmedal/Documents/2_msu/research_manager/code/ide/eclipse/HughCPP/Debug/../src/MySource.cpp:125: undefined reference to `OsiSymSolverInterface::OsiSymSolverInterface()&#39;</b></div>









<div><b>/home/hmedal/Documents/2_msu/research_manager/code/ide/eclipse/HughCPP/Debug/../src/MySource.cpp:125: undefined reference to `OsiSymSolverInterface::~OsiSymSolverInterface()&#39;</b></div><div><b>collect2: ld returned 1 exit status</b></div>









<div><b>make: *** [HughCPP] Error 1</b></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 30, 2012 at 9:38 AM, Ted Ralphs <span dir="ltr">&lt;<a href="mailto:ted@lehigh.edu" target="_blank">ted@lehigh.edu</a>&gt;</span> wrote:<br>









<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I use Eclipse and can probably help, but you&#39;ll have to give some more information, such as <br><br>1. OS<br>2. Compiler<br>









3. SYMPHONY version<br>4. What problems you&#39;ve encountered<br><br>Cheers,<br><br>Ted<br><div class="gmail_extra">

<br><div class="gmail_quote"><div><div>On Thu, Nov 29, 2012 at 8:40 PM, Hugh Medal <span dir="ltr">&lt;<a href="mailto:hugh.medal@msstate.edu" target="_blank">hugh.medal@msstate.edu</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hello,<div><br></div><div>Has anyone had success getting SYMPHONY to work with Eclipse CDT? I tried some instructions for SMI (<a href="https://projects.coin-or.org/BuildTools/wiki/pm-howdoi" target="_blank">https://projects.coin-or.org/BuildTools/wiki/pm-howdoi</a>) but couldn&#39;t get them to work.</div>














<div><br></div><div>Thanks,</div><div>Hugh<br clear="all"><div><br></div>-- <br><font color="#660000">Hugh Medal<br>Assistant Professor<br>Industrial and Systems Engineering<br>Mississippi State University</font><div><font color="#660000">Office: 260K McCain</font></div>














<div><font color="#660000">Office: <a href="tel:662-325-3923" value="+16623253923" target="_blank">662-325-3923</a></font></div><div><font color="#660000">Cell Phone: <a href="tel:701-866-1179" value="+17018661179" target="_blank">701-866-1179</a><br>












Email: <a href="mailto:hmedal@uark.edu" target="_blank">hmedal@i</a><a href="http://se.msstate.edu/" target="_blank">se.msstate.edu</a></font></div>

<div><font color="#660000">Website: </font><a href="http://hm568.ise.msstate.edu/" target="_blank">hm568.ise.msstate.edu</a><font color="#660000"><br></font><div><font color="#660000">Twitter: <a href="https://twitter.com/#!/hughmedal" target="_blank">hughmedal</a></font></div>














<div><font color="#660000">Facebook: <a href="http://www.facebook.com/hugh.medal" target="_blank">Hugh Medal</a></font></div><div><font color="#660000">LinkedIn: <a href="http://www.linkedin.com/profile/view?id=65478854&amp;authType=name&amp;authToken=lX4B&amp;pvs=pp" target="_blank">Hugh Medal</a></font></div>














<div><font color="#660000">Google+: <a href="https://plus.google.com/111704068836614551361/posts" target="_blank">Hugh Medal</a></font></div></div><br>
</div>
<br></div></div>_______________________________________________<br>
Symphony mailing list<br>
<a href="mailto:Symphony@list.coin-or.org" target="_blank">Symphony@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/symphony" target="_blank">http://list.coin-or.org/mailman/listinfo/symphony</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br>Dr. Ted Ralphs<br>Associate Professor, Lehigh University<br><a href="tel:%28610%29%20628-1280" value="+16106281280" target="_blank">(610) 628-1280</a><br>









ted &#39;at&#39; lehigh &#39;dot&#39; edu<br>

<a href="http://coral.ie.lehigh.edu/~ted" target="_blank">coral.ie.lehigh.edu/~ted</a><br>
<br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><font color="#660000">Hugh Medal<br>Assistant Professor<br>Industrial and Systems Engineering<br>Mississippi State University</font><div><font color="#660000">Office: 260K McCain</font></div>









<div><font color="#660000">Office: <a href="tel:662-325-3923" value="+16623253923" target="_blank">662-325-3923</a></font></div><div><font color="#660000">Cell Phone: <a href="tel:701-866-1179" value="+17018661179" target="_blank">701-866-1179</a><br>







Email: <a href="mailto:hmedal@uark.edu" target="_blank">hmedal@i</a><a href="http://se.msstate.edu/" target="_blank">se.msstate.edu</a></font></div>

<div><font color="#660000">Website: </font><a href="http://hm568.ise.msstate.edu/" target="_blank">hm568.ise.msstate.edu</a><font color="#660000"><br></font><div><font color="#660000">Twitter: <a href="https://twitter.com/#!/hughmedal" target="_blank">hughmedal</a></font></div>









<div><font color="#660000">Facebook: <a href="http://www.facebook.com/hugh.medal" target="_blank">Hugh Medal</a></font></div><div><font color="#660000">LinkedIn: <a href="http://www.linkedin.com/profile/view?id=65478854&amp;authType=name&amp;authToken=lX4B&amp;pvs=pp" target="_blank">Hugh Medal</a></font></div>









<div><font color="#660000">Google+: <a href="https://plus.google.com/111704068836614551361/posts" target="_blank">Hugh Medal</a></font></div></div><br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Dr. Ted Ralphs<br>Associate Professor, Lehigh University<br><a href="tel:%28610%29%20628-1280" value="+16106281280" target="_blank">(610) 628-1280</a><br>ted &#39;at&#39; lehigh &#39;dot&#39; edu<br>





<a href="http://coral.ie.lehigh.edu/~ted" target="_blank">coral.ie.lehigh.edu/~ted</a><br>

<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><font color="#660000">Hugh Medal<br>Assistant Professor<br>Industrial and Systems Engineering<br>Mississippi State University</font><div><font color="#660000">Office: 260K McCain</font></div>





<div><font color="#660000">Office: <a href="tel:662-325-3923" value="+16623253923" target="_blank">662-325-3923</a></font></div><div><font color="#660000">Cell Phone: <a href="tel:701-866-1179" value="+17018661179" target="_blank">701-866-1179</a><br>



Email: <a href="mailto:hmedal@uark.edu" target="_blank">hmedal@i</a><a href="http://se.msstate.edu/" target="_blank">se.msstate.edu</a></font></div>

<div><font color="#660000">Website: </font><a href="http://hm568.ise.msstate.edu/" target="_blank">hm568.ise.msstate.edu</a><font color="#660000"><br></font><div><font color="#660000">Twitter: <a href="https://twitter.com/#!/hughmedal" target="_blank">hughmedal</a></font></div>





<div><font color="#660000">Facebook: <a href="http://www.facebook.com/hugh.medal" target="_blank">Hugh Medal</a></font></div><div><font color="#660000">LinkedIn: <a href="http://www.linkedin.com/profile/view?id=65478854&amp;authType=name&amp;authToken=lX4B&amp;pvs=pp" target="_blank">Hugh Medal</a></font></div>





<div><font color="#660000">Google+: <a href="https://plus.google.com/111704068836614551361/posts" target="_blank">Hugh Medal</a></font></div></div><br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Dr. Ted Ralphs<br>Associate Professor, Lehigh University<br><a href="tel:%28610%29%20628-1280" value="+16106281280" target="_blank">(610) 628-1280</a><br>ted &#39;at&#39; lehigh &#39;dot&#39; edu<br>

<a href="http://coral.ie.lehigh.edu/~ted" target="_blank">coral.ie.lehigh.edu/~ted</a><br>

<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><font color="#660000">Hugh Medal<br>Assistant Professor<br>Industrial and Systems Engineering<br>Mississippi State University</font><div><font color="#660000">Office: 260K McCain</font></div>

<div><font color="#660000">Office: 662-325-3923</font></div><div><font color="#660000">Cell Phone: 701-866-1179<br>Email: <a href="mailto:hmedal@uark.edu" target="_blank">hmedal@i</a><a href="http://se.msstate.edu/" target="_blank">se.msstate.edu</a></font></div>

<div><font color="#660000">Website: </font><a href="http://hm568.ise.msstate.edu/" target="_blank">hm568.ise.msstate.edu</a><font color="#660000"><br></font><div><font color="#660000">Twitter: <a href="https://twitter.com/#!/hughmedal" target="_blank">hughmedal</a></font></div>

<div><font color="#660000">Facebook: <a href="http://www.facebook.com/hugh.medal" target="_blank">Hugh Medal</a></font></div><div><font color="#660000">LinkedIn: <a href="http://www.linkedin.com/profile/view?id=65478854&amp;authType=name&amp;authToken=lX4B&amp;pvs=pp" target="_blank">Hugh Medal</a></font></div>

<div><font color="#660000">Google+: <a href="https://plus.google.com/111704068836614551361/posts" target="_blank">Hugh Medal</a></font></div></div><br>
</div>