quinnj / Sublime-IJulia

An IJulia Frontend for Sublime Text 3
90 stars 16 forks source link

ccall()-ed function not shown until execution is finished #39

Closed cbecker closed 10 years ago

cbecker commented 10 years ago

EDIT: I just found out this is a problem with IJulia itself, not with Sublime-IJulia.

I am not sure how to enable logging of stdout for ccall()-ed libraries. For example, lets make `test.c be

#include <stdio.h>

void test()
{   int i=0;
    for (i=0; i < 10; i++)
    {
        printf("hehe\r\n");
        fflush(stdout);
        system("sleep 0.5");
    }
}

compite with gcc -shared test.c -o test.so -fPIC, and then call it with juia, from sublime-IJulia:

ccall( (:test, "./test.so"), None, () )

Instead of seeing a series of 'hehe', separated by a 500ms pause, I see nothing while the ccall is active, and then the whole bunch of stdout appearing instantly once the ccall returns. Is there any way to deal with this issue in a clean way? Thanks.

cbecker commented 10 years ago
quinnj commented 10 years ago

I'll close this since it's being taken care of in IJulia and Julia base.