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

If GAP is the host, and Julia embedded, we should perhaps catch Julia's screen output (at least for errors) #237

Closed
fingolfin opened this issue May 16, 2019 · 4 comments

Comments

@fingolfin
Copy link
Member

Right now, running the JuliaInterface test suite from within GAP prints this:

...
testing: /home/travis/.julia/packages/GAP/95DX2/pkg/GAPJulia/JuliaInterface/ts\
t/JuliaToGAP.tst
     468 ms (432 ms GC) and 45.8KB allocated for JuliaToGAP.tst
testing: /home/travis/.julia/packages/GAP/95DX2/pkg/GAPJulia/JuliaInterface/ts\
t/adapter.tst
    1664 ms (316 ms GC) and 226KB allocated for adapter.tst
testing: /home/travis/.julia/packages/GAP/95DX2/pkg/GAPJulia/JuliaInterface/ts\
t/calls.tst
# line 239 of 296 (80%)WARNING: cfunction: return type of h0 does not match
# line 240 of 296 (81%)WARNING: cfunction: return type of h1 does not match
# line 241 of 296 (81%)WARNING: cfunction: return type of h2 does not match
# line 242 of 296 (81%)WARNING: cfunction: return type of h3 does not match
# line 243 of 296 (82%)WARNING: cfunction: return type of h4 does not match
# line 244 of 296 (82%)WARNING: cfunction: return type of h5 does not match
# line 245 of 296 (82%)WARNING: cfunction: return type of h6 does not match
...

These "WARNING: cfunction: return type of h6 does not match" messages are printed by Julia. I think we should catch them and add a way for the user to query these strings if desired; alternatively, we could turn the Julia error into a GAP error, by calling something like this pseudo code: ErrorQuit("Julia run into an error: %s", juliaErrorOutput, 0)

@fingolfin
Copy link
Member Author

I guess this (partially?) duplicates issue #95

@ThomasBreuer
Copy link
Member

@fingolfin Since this issue is still open:
Julia's screen output is interesting in general, not only in the case of error messages.
For example, the output of

gap> JuliaEvalString( "println( [1,2,3,4] )" );;

is shown on the screen but does not occur in a GAP logfile.
There should be a way to redirect all printed output (of GAP and Julia, in a GAP session and in a Julia session),
but where is the right place to force this behaviour?

(Can we expect that some of the problems described in #516 will disappear when all printed output gets redirected properly?)

@fingolfin
Copy link
Member Author

Perhaps we can use Base.redirect_stdout and Base.redirect_stderr (and Base.redirect_stdin) for this?

Moreover, since these days (esp. with the GAP_jll PR #550) the plan kinda is to always start Julia first, then GAP, we should also look into redirecting GAP's input/output to Julia. (note that the two redirection directions are independent and we may need to have them both active at the same time, somehow. Hrm.

@fingolfin
Copy link
Member Author

We dropped support for using GAP as a host last year

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