shsajjadi / OctaveCoder

Octave Coder __ A code generator and build system that converts Octave to C++
Other
27 stars 3 forks source link

doesn't install for octave 8.1.0 undefined symbols #18

Closed beew closed 1 year ago

beew commented 1 year ago

Tried to install on Octave 8.1.0 and get these errors

pkg install "https://github.com/shsajjadi/OctaveCoder/archive/refs/tags/coder-1.8.0.tar.gz"
Installing package coder. It may take a while. Please wait ...
error: /home/bernard/.local/share/octave/api-v58/packages/coder-1.8.0/x86_64-pc-linux-gnu-api-v58/octave2oct.oct: failed to load
Incompatible version or missing dependency?
/home/bernard/.local/share/octave/api-v58/packages/coder-1.8.0/x86_64-pc-linux-gnu-api-v58/octave2oct.oct: undefined symbol:_ZTIN6octave11tree_walkerE
error: called from
    doc_cache_create>create_cache at line 116 column 20
    gen_doc_cache_in_dir>@<anonymous> at line 150 column 20
    doc_cache_create>gen_doc_cache_in_dir at line 151 column 9
    doc_cache_create at line 62 column 12
    install>generate_lookfor_cache at line 840 column 5
    install at line 241 column 7
    pkg at line 619 column 9

OS is Ubuntu 22.04. Octave 8.1.0

shsajjadi commented 1 year ago

Thank you for reporting the bug! As of version 8 the core Octave shared libraries are built with a visibility flag such that nearly half of their symbols aren't exported and so they are hidden to the users. Those symbols aren't part of the public Octave API but some of them are used by Octave Coder. This change is documented in NEWS of version 8.x.x:

  • Octave's libraries are now built using symbol visibility by default. That means that fewer symbols are exported from these libraries. Configure with --disable-lib-visibility-flags to export all symbols (as in previous versions).

So as noted in the NEWS a package user or developer should recompile Octave with --disable-lib-visibility-flags that I think isn't applicable here. As reported in the error message octave::tree_walker is one of the classes that aren't part of public Octave API but is used in Coder. So as of the Octave 8 a package developer cannot use and traverse the Octave parse tree in a usual way.:( I should find a workaround possibly by manually creating a virtual table to enable dynamic dispatch.

However currently Coder works on Octave 8 on Windows systems that I have tested.

beew commented 1 year ago

Recompiled octave with --disable-lib-visibility-flags , it works now.

Thanks!

shsajjadi commented 1 year ago

According to Octave 8.2.0 Release Notes as of Octave 8.2 the symbol visibility flag is turned off again and there is no need for the users and the developers to recompile Octave anymore.