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

Fix errorstring #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PallHaraldsson
Copy link

No description provided.

@PallHaraldsson
Copy link
Author

Hi, seeing that was strange to me, then realized probably copy-pase error.

I got the package to install, and I can run some of the tests, but not all, and some segfault. I'm not sure it's my fault as I didn't have Octave 4, and installed 5 as snap (later flatpack), and changed some code to include from it:

I've read the code, more or less understandable, and as some of the round-triping seems ok, I guess you started (embedded Octave); not sure I needed to do:

julia> OctCall.interpreter()
LLVM ERROR: Program used external function '_ZN6octave11interpreterC1EPNS_11applicationE' which could not be resolved!

I do not locate any code to actually call Octave code (not yet implemented?).

$ locate octave |grep octave/interpreter.h
/snap/octave/30/include/octave-5.2.0/octave/interpreter.h
/usr/include/octave-4.2.2/octave/interpreter.h
/var/lib/flatpak/app/org.octave.Octave/x86_64/stable/7c4fbf39525ff7347aa0b16085b7ac55053df11649660c93365254da02cce6c1/files/include/octave-5.2.0/octave/interpreter.h

@PallHaraldsson
Copy link
Author

E.g. an error in the test is (really):

julia> ovroundtrip(1.0)
ERROR: ReadOnlyMemoryError()
Stacktrace:
 [1] macro expansion at /home/pharaldsson_sym/.julia/packages/Cxx/SEV8J/src/cxxstr.jl:700 [inlined]
 [2] cxxstr_impl at /home/pharaldsson_sym/.julia/packages/Cxx/SEV8J/src/cxxstr.jl:700 [inlined]
 [3] _octave_value at /home/pharaldsson_sym/.julia/packages/OctCall/wponU/src/ov-conversions.jl:4 [inlined]
 [4] octave_value at /home/pharaldsson_sym/.julia/packages/OctCall/wponU/src/ov-conversions.jl:6 [inlined]
 [5] ovroundtrip(::Float64) at ./REPL[14]:1
 [6] top-level scope at REPL[17]:1

what seems to be this:

julia> icxx"octave_value o(1.0); o;"
ERROR: ReadOnlyMemoryError()
Stacktrace:
 [1] macro expansion at /home/pharaldsson_sym/.julia/packages/Cxx/SEV8J/src/cxxstr.jl:700 [inlined]
 [2] cxxstr_impl(::Cxx.CxxCore.CxxInstance{1}, ::Cxx.CxxCore.SourceBuf{Symbol("{\n#line 1 \"REPL[8]\"\noctave_value o(1.0); o;\n}"),Symbol("REPL[8]"),1,1,false}) at /home/pharaldsson_sym/.julia/packages/Cxx/SEV8J/src/cxxstr.jl:700

I guess you know this, and your package is just not done (or a bug you do not know of in it or issue with Cxx installation?). I'm using Julia 1.3.1, 1.4 or later didn't work but seems like Cxx.jl issue.

@stevengj
Copy link
Contributor

I don't see these errors; your phrase "changed some code to include from it" worries me a bit as possibly you didn't set up the build correctly. You shouldn't have to modify any code — just set the MKOCTFILE environment variable to the path of mkoctfile, or set your PATH correctly for mkoctfile.

@stevengj
Copy link
Contributor

Note also that you may need the master branch of Cxx.jl

@PallHaraldsson
Copy link
Author

PallHaraldsson commented Jul 23, 2020

[I got tests working, see next comment, this one OUTDATED, except if you want to get snap working, could at least merge the PR here.]

I'm using Cxx master now, and did build Cxx, and build OctCall.

$which mkoctfile
/snap/octave/30/bin/mkoctfile

still:

$ mkoctfile -p INCLUDEDIR
/include

but I think I need, e.g.:
/snap/octave/30/include/octave-5.2.0/octave/interpreter.h

not:
/usr/include/octave-4.2.2/octave/interpreter.h

so I changed the includes to point to snap include folder.

@PallHaraldsson
Copy link
Author

PallHaraldsson commented Jul 23, 2020

I got all the tests to run now (still unclear how to use the package to actually call Octave).

because of:
julia> dlpath("liboctave")
"/usr/lib/x86_64-linux-gnu/liboctave.so"

I was running Octave 4 (since uninstalled, then got errors).

I could hardcode something in for that, or as I did just changed the generated deps.jl file to:

const MKOCTFILE = "/snap/octave/30/bin/mkoctfile-5.2.0"
const OCTAVE_VERSION = v"5.2.0"
const liboctave = "/snap/octave/30/lib/octave/5.2.0/liboctave.so"
const liboctinterp = "/snap/octave/30/lib/octave/5.2.0/liboctinterp"
const oct_h_dir = nothing

Since apt-get is no longer supported for (recent) Octave in Ubuntu, it would be nice to get something working for snap (or flatpack) [or even better Octave_jll installation?].

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

Successfully merging this pull request may close these issues.

2 participants