<p>Thanks for your replies. <br>
I am actually setting LD_LIBRARY_PATH to add /home/usrname/lib/mlpacklib/lib:/home/usrname/lib/Boost161/lib:<br>
These are both libraries that I installed locally, to a different-from-default directory. </p>

<p>ldd output:</p>

<pre><code>linux-vdso.so.1 =&gt;  (0x00007ffef8fca000)
libmlpack.so.2 =&gt; /home/usrname/lib/mlpacklib/lib/libmlpack.so.2 (0x00007f651dc79000)
libarmadillo.so.7 =&gt; /usr/lib64/libarmadillo.so.7 (0x00007f651da70000)
libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f651d6a2000)
libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f651d48c000)
libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f651d0c2000)
libboost_program_options.so.1.61.0 =&gt; /home/usrname/lib/Boost161/lib/libboost_program_options.so.1.61.0 (0x00007f651ce42000)
libboost_serialization.so.1.61.0 =&gt; /home/usrname/lib/Boost161/lib/libboost_serialization.so.1.61.0 (0x00007f651cc00000)
libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f651c8f6000)
libgomp.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f651c6d4000)
/lib64/ld-linux-x86-64.so.2 (0x0000559a31c77000)
libmkl_rt.so =&gt; /opt/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_rt.so (0x00007f651c16c000)
libarpack.so.2 =&gt; /usr/lib/libarpack.so.2 (0x00007f651bf20000)
libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f651bd03000)
libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f651bafe000)
liblapack.so.3 =&gt; /usr/lib/liblapack.so.3 (0x00007f651b31b000)
libblas.so.3 =&gt; /usr/lib/libblas.so.3 (0x00007f651b0ba000)
libgfortran.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f651ad8e000)
libopenblas.so.0 =&gt; /usr/lib/libopenblas.so.0 (0x00007f6518cfa000)
libquadmath.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f6518aba000)
</code></pre>

<p>I recently got access to another computer and it seems it works (so far). <br>
g++ 4.9 is used instead of 5.4, and boost 1.49 is used instead of 1.61</p>

<p>ldd output:<br>
    linux-vdso.so.1 =&gt;  (0x00007fffc17e0000)<br>
    libmlpack.so.2 =&gt; /usr/local/lib/libmlpack.so.2 (0x00007f5b71c40000)<br>
    libarmadillo.so.7 =&gt; /usr/lib/libarmadillo.so.7 (0x00007f5b71a18000)<br>
    libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5b71708000)<br>
    libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5b714f0000)<br>
    libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5b71130000)<br>
    libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5b70f10000)<br>
    libboost_program_options.so.1.49.0 =&gt; /usr/lib/libboost_program_options.so.1.49.0 (0x00007f5b70ca8000)<br>
    libboost_serialization.so.1.49.0 =&gt; /usr/lib/libboost_serialization.so.1.49.0 (0x00007f5b70a38000)<br>
    libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5b70738000)<br>
    libgomp.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f5b70520000)<br>
    libmkl_rt.so =&gt; /opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_rt.so (0x00007f5b6ffa8000)<br>
    /lib64/ld-linux-x86-64.so.2 (0x00007f5b72128000)<br>
    librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5b6fda0000)<br>
    libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5b6fb98000)</p>

<p>Differences exist, since no lapack, openblas appear on the latter. A bit clueless by now...<br>
I might try to downgrade to boost 1.49 and see what happens in my usual computer. </p>

<p>Besides, I have observed one fact when using gdb GNU debugger (see two runs below):<br>
#successful run<br>
Starting program: /home/usrname/folder/data/safe/a.out <br>
[Thread debugging using libthread_db enabled]<br>
 [Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>
[New Thread 0x7ffff2771700 (LWP 30726)]<br>
[New Thread 0x7ffff1f70700 (LWP 30727)]<br>
[New Thread 0x7fffef76f700 (LWP 30728)]<br>
[New Thread 0x7ffff7fc4700 (LWP 30729)]<br>
[New Thread 0x7fffe5507700 (LWP 30730)]<br>
[New Thread 0x7fffe5106700 (LWP 30731)]<br>
[New Thread 0x7fffe4d05700 (LWP 30732)]<br>
i.rows=400 i.cols=1 i399=61<br>
[Thread 0x7fffef76f700 (LWP 30728) exited]<br>
[Thread 0x7ffff1f70700 (LWP 30727) exited]<br>
[Thread 0x7ffff2771700 (LWP 30726) exited]<br>
[Thread 0x7fffe4d05700 (LWP 30732) exited]<br>
[Thread 0x7fffe5106700 (LWP 30731) exited]<br>
[Thread 0x7fffe5507700 (LWP 30730) exited]<br>
[Thread 0x7ffff7fc4700 (LWP 30729) exited]<br>
[Inferior 1 (process 30725) exited normally] </p>

<p>#unsuccessful run<br>
(gdb) run<br>
Starting program: /home/usrname/folder/data/safe/a.out <br>
[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>
[New Thread 0x7ffff2771700 (LWP 30734)]<br>
[New Thread 0x7ffff1f70700 (LWP 30735)]<br>
[New Thread 0x7fffef76f700 (LWP 30736)]<br>
[New Thread 0x7ffff7fc4700 (LWP 30737)]<br>
[New Thread 0x7fffe5507700 (LWP 30738)]<br>
[New Thread 0x7fffe5106700 (LWP 30739)]<br>
[New Thread 0x7fffe4d05700 (LWP 30740)]<br>
i.rows=400 i.cols=1 i399=172*<br>
[Thread 0x7fffef76f700 (LWP 30736) exited]<br>
[Thread 0x7ffff1f70700 (LWP 30735) exited]<br>
[Thread 0x7ffff2771700 (LWP 30734) exited]<br>
[Thread 0x7fffe4d05700 (LWP 30740) exited]<br>
[Thread 0x7fffe5507700 (LWP 30738) exited]<br>
[Thread 0x7fffe5106700 (LWP 30739) exited]<br>
[Thread 0x7ffff7fc4700 (LWP 30737) exited]<br>
[Inferior 1 (process 30733) exited normally]</p>

<p>It seems that the order on which threads exit change when the program is run without obtaining the desired output.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/issues/759#issuecomment-238572675">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFFLeUQG17xMwKsZkQVF9-IJIB1ERks5qeJAMgaJpZM4Jf5j4">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJgNXv2K-q5dCDotMdBVUiBgh5vgks5qeJAMgaJpZM4Jf5j4.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/759#issuecomment-238572675"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/mlpack/mlpack","title":"mlpack/mlpack","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/mlpack/mlpack"}},"updates":{"snippets":[{"icon":"PERSON","message":"@mphy in #759: Thanks for your replies. \r\nI am actually setting LD_LIBRARY_PATH to add /home/usrname/lib/mlpacklib/lib:/home/usrname/lib/Boost161/lib:\r\nThese are both libraries that I installed locally, to a different-from-default directory. \r\n\r\nldd output:\r\n\r\n\tlinux-vdso.so.1 =\u003e  (0x00007ffef8fca000)\r\n\tlibmlpack.so.2 =\u003e /home/usrname/lib/mlpacklib/lib/libmlpack.so.2 (0x00007f651dc79000)\r\n\tlibarmadillo.so.7 =\u003e /usr/lib64/libarmadillo.so.7 (0x00007f651da70000)\r\n\tlibstdc++.so.6 =\u003e /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f651d6a2000)\r\n\tlibgcc_s.so.1 =\u003e /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f651d48c000)\r\n\tlibc.so.6 =\u003e /lib/x86_64-linux-gnu/libc.so.6 (0x00007f651d0c2000)\r\n\tlibboost_program_options.so.1.61.0 =\u003e /home/usrname/lib/Boost161/lib/libboost_program_options.so.1.61.0 (0x00007f651ce42000)\r\n\tlibboost_serialization.so.1.61.0 =\u003e /home/usrname/lib/Boost161/lib/libboost_serialization.so.1.61.0 (0x00007f651cc00000)\r\n\tlibm.so.6 =\u003e /lib/x86_64-linux-gnu/libm.so.6 (0x00007f651c8f6000)\r\n\tlibgomp.so.1 =\u003e /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f651c6d4000)\r\n\t/lib64/ld-linux-x86-64.so.2 (0x0000559a31c77000)\r\n\tlibmkl_rt.so =\u003e /opt/intel/composer_xe_2015.1.133/mkl/lib/intel64/libmkl_rt.so (0x00007f651c16c000)\r\n\tlibarpack.so.2 =\u003e /usr/lib/libarpack.so.2 (0x00007f651bf20000)\r\n\tlibpthread.so.0 =\u003e /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f651bd03000)\r\n\tlibdl.so.2 =\u003e /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f651bafe000)\r\n\tliblapack.so.3 =\u003e /usr/lib/liblapack.so.3 (0x00007f651b31b000)\r\n\tlibblas.so.3 =\u003e /usr/lib/libblas.so.3 (0x00007f651b0ba000)\r\n\tlibgfortran.so.3 =\u003e /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f651ad8e000)\r\n\tlibopenblas.so.0 =\u003e /usr/lib/libopenblas.so.0 (0x00007f6518cfa000)\r\n\tlibquadmath.so.0 =\u003e /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f6518aba000)\r\n\r\nI recently got access to another computer and it seems it works (so far). \r\ng++ 4.9 is used instead of 5.4, and boost 1.49 is used instead of 1.61\r\n\r\nldd output:\r\n\tlinux-vdso.so.1 =\u003e  (0x00007fffc17e0000)\r\n\tlibmlpack.so.2 =\u003e /usr/local/lib/libmlpack.so.2 (0x00007f5b71c40000)\r\n\tlibarmadillo.so.7 =\u003e /usr/lib/libarmadillo.so.7 (0x00007f5b71a18000)\r\n\tlibstdc++.so.6 =\u003e /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5b71708000)\r\n\tlibgcc_s.so.1 =\u003e /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5b714f0000)\r\n\tlibc.so.6 =\u003e /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5b71130000)\r\n\tlibpthread.so.0 =\u003e /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5b70f10000)\r\n\tlibboost_program_options.so.1.49.0 =\u003e /usr/lib/libboost_program_options.so.1.49.0 (0x00007f5b70ca8000)\r\n\tlibboost_serialization.so.1.49.0 =\u003e /usr/lib/libboost_serialization.so.1.49.0 (0x00007f5b70a38000)\r\n\tlibm.so.6 =\u003e /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5b70738000)\r\n\tlibgomp.so.1 =\u003e /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f5b70520000)\r\n\tlibmkl_rt.so =\u003e /opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_rt.so (0x00007f5b6ffa8000)\r\n\t/lib64/ld-linux-x86-64.so.2 (0x00007f5b72128000)\r\n\tlibrt.so.1 =\u003e /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5b6fda0000)\r\n\tlibdl.so.2 =\u003e /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5b6fb98000)\r\n\r\nDifferences exist, since no lapack, openblas appear on the latter. A bit clueless by now...\r\nI might try to downgrade to boost 1.49 and see what happens in my usual computer. \r\n\r\nBesides, I have observed one fact when using gdb GNU debugger (see two runs below):\r\n#successful run\r\nStarting program: /home/usrname/folder/data/safe/a.out \r\n[Thread debugging using libthread_db enabled]\r\n [Thread debugging using libthread_db enabled]\r\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\r\n[New Thread 0x7ffff2771700 (LWP 30726)]\r\n[New Thread 0x7ffff1f70700 (LWP 30727)]\r\n[New Thread 0x7fffef76f700 (LWP 30728)]\r\n[New Thread 0x7ffff7fc4700 (LWP 30729)]\r\n[New Thread 0x7fffe5507700 (LWP 30730)]\r\n[New Thread 0x7fffe5106700 (LWP 30731)]\r\n[New Thread 0x7fffe4d05700 (LWP 30732)]\r\ni.rows=400 i.cols=1 i399=61\r\n[Thread 0x7fffef76f700 (LWP 30728) exited]\r\n[Thread 0x7ffff1f70700 (LWP 30727) exited]\r\n[Thread 0x7ffff2771700 (LWP 30726) exited]\r\n[Thread 0x7fffe4d05700 (LWP 30732) exited]\r\n[Thread 0x7fffe5106700 (LWP 30731) exited]\r\n[Thread 0x7fffe5507700 (LWP 30730) exited]\r\n[Thread 0x7ffff7fc4700 (LWP 30729) exited]\r\n[Inferior 1 (process 30725) exited normally] \r\n\r\n#unsuccessful run\r\n(gdb) run\r\nStarting program: /home/usrname/folder/data/safe/a.out \r\n[Thread debugging using libthread_db enabled]\r\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\r\n[New Thread 0x7ffff2771700 (LWP 30734)]\r\n[New Thread 0x7ffff1f70700 (LWP 30735)]\r\n[New Thread 0x7fffef76f700 (LWP 30736)]\r\n[New Thread 0x7ffff7fc4700 (LWP 30737)]\r\n[New Thread 0x7fffe5507700 (LWP 30738)]\r\n[New Thread 0x7fffe5106700 (LWP 30739)]\r\n[New Thread 0x7fffe4d05700 (LWP 30740)]\r\ni.rows=400 i.cols=1 i399=172*\r\n[Thread 0x7fffef76f700 (LWP 30736) exited]\r\n[Thread 0x7ffff1f70700 (LWP 30735) exited]\r\n[Thread 0x7ffff2771700 (LWP 30734) exited]\r\n[Thread 0x7fffe4d05700 (LWP 30740) exited]\r\n[Thread 0x7fffe5507700 (LWP 30738) exited]\r\n[Thread 0x7fffe5106700 (LWP 30739) exited]\r\n[Thread 0x7ffff7fc4700 (LWP 30737) exited]\r\n[Inferior 1 (process 30733) exited normally]\r\n\r\nIt seems that the order on which threads exit change when the program is run without obtaining the desired output."}],"action":{"name":"View Issue","url":"https://github.com/mlpack/mlpack/issues/759#issuecomment-238572675"}}}</script>