<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 28/02/2018 à 18:48, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:3bec9f76-17c1-074a-d171-9f751e9bcac6@free.fr">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Le 28/02/2018 à 16:30, Stéphane
        Mottelet a écrit :<br>
      </div>
      <blockquote cite="mid:6613d71e-24e3-713b-a861-2c46802ff5ac@utc.fr"
        type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=windows-1252">
        <div class="moz-cite-prefix">Thanks Samuel, the problem is that<br>
          <br>
          save('macros/%axesData_i_h.bin', '%axesData_i_h<font
            color="#ff0000"><font size="+1">'</font></font>) <br>
          <br>
          will produce a .sod file with a .bin extension. Both formats
          cannot be used indifferently for compiled macros of a library
          : in the following code (that can be copy/pasted), a library
          is built, the "fun1" function is saved in sod format, then the
          reference to "fun1.bin" is replaced by "fun1.sod" in the lib
          file :<br>
          <br>
          path=TMPDIR+'/test/';<br>
          mkdir(path)<br>
          mputl('function y=fun1(x), y=x, end',path+'fun1.sci');<br>
          genlib('test',path)<br>
          save(path+'fun1.sod','fun1')<br>
          doc=xmlRead(path+'lib');<br>
          doc.root.children(1).attributes.file='fun1.sod';<br>
          disp(xmlDump(doc))<br>
          xmlWrite(doc,path+'lib');<br>
          clear<br>
          lib(TMPDIR+'/test/')<br>
          <br>
          The following output is obtained:<br>
          <br>
          !<?xml version="1.0" encoding="UTF-8"
          standalone="no"?>                         !<br>
!                                                                              
          !<br>
          !<scilablib
          name="test">                                                       
          !<br>
!                                                                              
          !<br>
          !  <macro name="fun1" file="fun1.sod"
          md5="a50d8a8cda2cd6036306e08e61ffcbeb"/>  !<br>
!                                                                              
          !<br>
!</scilablib>                                                                  
          !<br>
          <br>
          Emplacement des fichiers des fonctions : /.<br>
          <br>
          fun1  <br>
          <br>
          --> <br>
          <br>
          Unfortunately, calling fun1 crashes scilab...</div>
      </blockquote>
      <br>
      Last trial for today:<br>
      <ul>
        <li>Define fun1() in fun1.sci.</li>
        <li>Compile fun1.sci with genlib(): OK => fun1.bin available</li>
        <li>Create fun2.bin as a hard link to fun1.bin:<br>
          <tt>host("mklink /H fun2.bin fun1.bin")  // Windows<br>
          </tt></li>
        <li>Update (by hand or code, not with genlib) the lib file:<br>
          <pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(92,92,92);"><</span><span style="color:rgb(0,0,0);">?xml</span> <span style="color:rgb(0,0,0);">version</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">1.0</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(0,0,0);">encoding</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">UTF-8</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(0,0,0);">standalone</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">no</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">?</span><span style="color:rgb(92,92,92);">></span>
<span style="color:rgb(92,92,92);"><</span><span style="color:rgb(0,0,0);">scilablib</span> <span style="color:rgb(0,0,0);">name</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">testlib</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(92,92,92);">></span>
  <span style="color:rgb(92,92,92);"><</span><span style="color:rgb(0,0,0);">macro</span> <span style="color:rgb(0,0,0);">name</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">fun1</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(50,185,185);">file</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">fun1.bin</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(0,0,0);">md5</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">8a3737878c543f1a5005c42122236628</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(92,92,92);">/</span><span style="color:rgb(92,92,92);">></span>
  <span style="color:rgb(92,92,92);"><</span><span style="color:rgb(0,0,0);">macro</span> <span style="color:rgb(0,0,0);">name</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">fun2</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(50,185,185);">file</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">fun2.bin</span><span style="color:rgb(188,143,143);">"</span> <span style="color:rgb(0,0,0);">md5</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">8a3737878c543f1a5005c42122236628</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(92,92,92);">/</span><span style="color:rgb(92,92,92);">></span>
<span style="color:rgb(92,92,92);"><</span><span style="color:rgb(92,92,92);">/</span><span style="color:rgb(0,0,0);">scilablib</span><span style="color:rgb(92,92,92);">>
</span></pre>
        </li>
        <li>load the library (OK : both fun1 and fun2 are loaded):<br>
          <font size="-1"><tt>--> lib ./</tt><tt><br>
            </tt><tt> ans  =</tt><tt><br>
            </tt><tt>Functions files location : TMPDIR\test.</tt><tt><br>
            </tt><tt>fun1  fun2 </tt><tt><br>
            </tt><tt><br>
            </tt></font></li>
        <li><font size="-1"><tt>fun1(1)   //=> OK</tt></font></li>
        <li><font size="-1"><tt>fun2(1)    // .... => crash</tt></font></li>
      </ul>
    </blockquote>
    Already tried this one with fun2.bin as a copy of fun1.bin. I
    noticed that under scilab 5.5.2, <br>
    <br>
    <ul>
      <li>Define fun1()<br>
      </li>
      <li>fun2=fun1</li>
      <li>save("fun1.bin",fun1)</li>
      <li>save('fun2.bin',fun2)<br>
      </li>
    </ul>
    <p>gives a fun2.bin different from fun1.bin as the string "fun1"
      appears in fun1.bin and "fun2" appears in fun2.bin</p>
    <p>S.<br>
    </p>
    <br>
    <br>
    <blockquote type="cite"
      cite="mid:3bec9f76-17c1-074a-d171-9f751e9bcac6@free.fr">
      <ul>
      </ul>
      <p>A bad end.<br>
        It is likeky vain to go on fighting without Antoine Elias
        advices and comments :)</p>
      Samuel<br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a></pre>
  </body>
</html>