Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cbecker opened this issue Mar 1, 2014 · 2 comments
Closed

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

cbecker opened this issue Mar 1, 2014 · 2 comments

Comments

@cbecker
Copy link
Contributor

cbecker commented Mar 1, 2014

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
Copy link
Contributor Author

cbecker commented Mar 1, 2014

Re-submitted in JuliaLang/IJulia.jl#153.

@quinnj
Copy link
Owner

quinnj commented Mar 3, 2014

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

@quinnj quinnj closed this as completed Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants