<div>First, you have to configure SYMPHONY with the argument &quot;--with-application&quot; as described here:</div><div><br></div><a href="http://www.coin-or.org/SYMPHONY/man-5.4.0/node26.html#build_appl_unix">http://www.coin-or.org/SYMPHONY/man-5.4.0/node26.html#build_appl_unix</a> <br>

<br>The easiest way to proceed after that is to just go into the SYMPHONY/Applications/USER directory, modify the callbacks as you wish and then do a &quot;make&quot;. This will link your code to the libSymApp library rather than libSym library. At the moment, I&#39;m guessing you are linking to the libSym, which does not have the hooks for the user callbacks.<div>

<br></div><div>In general, it is not possible to define just a single callback the way your attempting to do. The design is a little different than CPLEX. Using the template provided by the USER application, though, you can pick and choose what callbacks you want to modify and any that you do not modify will simply execute the default implementation. </div>

<div><br></div><div>Hope this helps and sorry if the documentation was confusing at all.</div><div><br></div><div>Cheers,</div><div><br></div><div>Ted<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 2:13 PM, Haroldo Gambini Santos <span dir="ltr">&lt;<a href="mailto:haroldo.santos@gmail.com">haroldo.santos@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Follows the code:<br>
    #include &lt;coin/OsiSymSolverInterface.hpp&gt;<br>
    #include &lt;coin/symphony.h&gt;<br>
    #include &lt;sym_constants.h&gt;<br>
    #include &lt;sym_macros.h&gt;<br>
    #include &lt;sym_cg_u.h&gt;<br>
    <br>
    int user_find_cuts(void *user, int varnum, int iter_num, int level,<br>
                       int index, double objval, int *indices, double
    *values,<br>
                       double ub, double etol, int *num_cuts, int
    *alloc_cuts,<br>
                       cut_data ***cuts);<br>
    <br>
    <br>
    int main(int argc, char **argv)<br>
    {<br>
       OsiSymSolverInterface *sym = new OsiSymSolverInterface();<br>
    <br>
       sym-&gt;parseCommandLine( argc, argv );<br>
    <br>
       sym-&gt;loadProblem();<br>
    <br>
       sym-&gt;branchAndBound();<br>
    <br>
       return(0);<br>
    }<br>
    <br>
    int user_find_cuts(void *user, int varnum, int iter_num, int level,<br>
                       int index, double objval, int *indices, double
    *values,<br>
                       double ub, double etol, int *num_cuts, int
    *alloc_cuts,<br>
                       cut_data ***cuts)<br>
    {<br>
       printf(&quot;hello.\n&quot;);<br>
    <br>
       return USER_SUCCESS;<div><div class="h5"><br>
    }<br>
    <br>
    <br>
    -------- Original Message --------
    <table cellpadding="0" cellspacing="0" border="0">
      <tbody>
        <tr>
          <th align="RIGHT" nowrap valign="BASELINE">Subject: </th>
          <td>Compiling symphony with one callback</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap valign="BASELINE">Date: </th>
          <td>Wed, 11 Jan 2012 17:12:21 -0200</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap valign="BASELINE">From: </th>
          <td>Haroldo Gambini Santos <a href="mailto:haroldo.santos@gmail.com" target="_blank">&lt;haroldo.santos@gmail.com&gt;</a></td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap valign="BASELINE">To: </th>
          <td><a href="mailto:symphony@list.coin-or.org" target="_blank">symphony@list.coin-or.org</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    <br>
    <pre>Hi,

I&#39;m starting to build a code with SYMPHONY, mainly based in the 
&quot;Walkthrough...&quot; example of Michael Trick.

To start I&#39;ve just included a callback to insert cuts, but it appears 
that is is not being called.

In Trick&#39;s example it only defines the function, but there is no 
sym_set_user_callback (something like that) as I expected.

Although my (small) code compiles fine, the callback is not being called 
(put a printf inside it).

What additional step should I do ?

Cheers,

Haroldo

-- 
=============================================================
Haroldo Gambini Santos
Computing Department - Universidade Federal de Ouro Preto - UFOP
email: haroldo [at ] <a href="http://iceb.ufop.br" target="_blank">iceb.ufop.br</a>
home/research page: <a href="http://www.decom.ufop.br/haroldo/" target="_blank">www.decom.ufop.br/haroldo/</a>
sy

</pre>
  </div></div></div>

<br>_______________________________________________<br>
Symphony mailing list<br>
<a href="mailto:Symphony@list.coin-or.org">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><br><br clear="all"><div><br></div>-- <br>Dr. Ted Ralphs<br>Associate Professor, Lehigh University<br>(610) 628-1280<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>