Oct files run under Octave 3.6.4 or 4.0.0 but not both

守給你的承諾、 提交于 2021-02-05 07:51:50

问题


I have two versions of Octave installed, version 3.6.4 installed via the package manager (Linux Mint Debian), and version 4.0.0 compiled from source. I also have numerous .oct files in a folder pointed to in an .octaverc file. My problem is that the version 4.0.0 cannot "see" these .oct files and if I try to call them the whole session crashes unless I recompile them under 4.0.0 with mkoctfile. However, doing this means that the version 3.6.4 cannot "see" them and trying to call them gives an error message

failed to load: liboctinterp.so.3: cannot open shared object file: No such file or directory

How can I get both versions to recognize my .oct functions without having to recompile them each time?


回答1:


I copy the answer from Mike and Olaf from the help mailinglist (crossposting http://octave.1599824.n4.nabble.com/Oct-files-run-in-Octave-version-3-6-4-or-4-0-0-but-not-both-td4672690.html)

Short answer: you can't.

The Octave library API and ABI change between releases. Octave 3.6 was liboct{ave,interp}.so.1, Octave 3.8 was liboct{ave,interp}.so.2, and 4.0 is liboct{ave,interp}.so.3. These libraries are not forwards or backwards compatible.

You can compile your oct-files in two (or three?) different paths with the wanted Octave version in the path.

If you want to install your files system-wide, a good candidate directory for the differently compiled oct-files seems to be

fullfile (OCTAVE_HOME (), "lib/octave/site/oct/", octave_config_info ("canonical_host_type"))

assuming OCTAVE_HOME () is different for each of your Octave versions. This directory seems to be in the path by default.

If not system-wide, you could check OCTAVE_VERSION () in your .octaverc and set the path differently for each version.



来源:https://stackoverflow.com/questions/32829531/oct-files-run-under-octave-3-6-4-or-4-0-0-but-not-both

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!