Hi all, I am developing a simulation engine in C++ which I would like to interact with Scilab. So, I wanted to try the call_scilab API (https://help.scilab.org/docs/6.0.0/en_US/section_204636e951f595409bc6782bb8e1d2d9.html). I faced some issues compiling which are now solved (I hope properly), and now that i finally make the program compile it results in the application hanging indefinitely because StartScilab() never returns.
Using gdb I can see the thread is stuck at StartScilabEngine->InitializeTclTk () -> OpenTCLsci () -> pthread_cond_wait@@GLIBC_2.3.2 Does anyone have any experience using call_scilab and can have some poiters on what might be going on? Thank you very much for any pointer! Matias *What am I running?* I am trying to make the very basic example here to work: https://help.scilab.org/docs/6.0.0/en_US/call_scilab.html I followed the steps to compile and execute from here: https://help.scilab.org/docs/6.0.0/en_US/compile_and_run_call_scilab.html I am running exactly the code of simple_call_scilab.c, just added 2 extra fprintf before and after the StartScilab. *Environment & compilation* After a while and a bit of fighting I was able to compile and execute: I first was trying to compile against Scilab5.5.1 (last stable version) but the compilation did not work. Then I switched to Scilab6.0-beta-2. Then when executing I got an error "Scilab should have 'libscijvm-disable' defined but gets 'libscijvm' instead.". I fixed this add also -lscijvm-disable. To execute the SCI path in the Scilab Twiki is not quite correct either. This is what I am using to compile, link and execute: I had downloaded and unzip the Scilab6.0-beta-2 in /home/. I am using CENTOS6: $> uname -a Linux pcatd143.cern.ch 2.6.32-642.3.1.el6.x86_64 #1 SMP Wed Jul 13 10:27:00 CEST 2016 x86_64 x86_64 x86_64 GNU/Linux *To compile&link:* export LD_LIBRARY_PATH=/home/scilab-6.0.0-beta-2/lib/thirdparty/:/home/scilab-6.0.0-beta-2/lib/scilab; gcc -o myExample -lscilab -lscijvm-disable -L/home/scilab-6.0.0-beta-2/lib/scilab -I/home/scilab-6.0.0-beta-2/include/scilab/ simple_call_scilab.c *To execute:* export SCI=/home/scilab-6.0.0-beta-2/share/scilab/ ./myExample *What I get* Not much... I added a fprintf before and after the StartScilab. I only see what it is printed before StartScilab. Using gdb to attach to the process and then getting the backtrace I see it is stuck in OpenTCLsci (does anyone know what is that?): #0 0x000000340200b68c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007fc1d28f6685 in OpenTCLsci () from /afs/cern.ch/user/m/mbonaven/Download/scilab-6.0.0-beta-2//lib/scilab/libscitclsci.so.6 #2 0x00007fc1d28f687d in InitializeTclTk () from /afs/cern.ch/user/m/mbonaven/Download/scilab-6.0.0-beta-2//lib/scilab/libscitclsci.so.6 #3 0x00007fc1d1dc22aa in StartScilabEngine (_pSEI=0x16664c0) at src/cpp/InitScilab.cpp:252 #4 0x00007fc1d6087d4d in Call_ScilabOpen () from /afs/cern.ch/user/m/mbonaven/Download/scilab-6.0.0-beta-2//lib/scilab/libscicall_scilab.so.6 #5 0x00007fc1d6087bb1 in StartScilab () from /afs/cern.ch/user/m/mbonaven/Download/scilab-6.0.0-beta-2//lib/scilab/libscicall_scilab.so.6 #6 0x0000000000409e31 in quickTest::initializeScilab (this=0x16660a0) at ../atomics/test_scilab_api/quickTest.cpp:56 -- View this message in context: http://mailinglists.scilab.org/Trying-to-use-call-scilab-tp4034541.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
