Closed marcobergman closed 8 months ago
Is this still relevant? Does it occur building from source?
With 0.40.31.0 I'm afraid so; still the same message in the log as shown above. Ubuntu up to date (apt upgrade):
Compiling is very difficult for me on Ubuntu, even with this trick: https://syzeehond.blogspot.com/2023/11/various-tricks.html
Now I'm getting this:
-- CMakeLists: Adding target link libraries to pypilot_pi
CMake Error at CMakeLists.txt:235 (add_subdirectory):
add_subdirectory given source "opencpn-libs/api-17" which is not an
existing directory.
did you do the git submodule init?
On 12/27/23, marcobergman @.***> wrote:
Compiling is very difficult on Ubuntu, even with this trick: https://syzeehond.blogspot.com/2023/11/various-tricks.html
Now I'm getting this:
-- CMakeLists: Adding target link libraries to pypilot_pi CMake Error at CMakeLists.txt:235 (add_subdirectory): add_subdirectory given source "opencpn-libs/api-17" which is not an existing directory.
-- Reply to this email directly or view it on GitHub: https://github.com/pypilot/pypilot_pi/issues/37#issuecomment-1870156984 You are receiving this because you commented.
Message ID: @.***>
That did the trick! You might want to put this in the README. The repository now shows a rather useless legal thing.
marcb@ubuntu2204:~/pypilot_pi$ git submodule init
Submodule 'opencpn-libs' (https://github.com/OpenCPN/opencpn-libs.git) registered for path 'opencpn-libs'
marcb@ubuntu2204:~/pypilot_pi$ git submodule update
Cloning into '/home/marcb/pypilot_pi/opencpn-libs'...
Submodule path '../opencpn-libs': checked out 'a001083af21de2e3faa970b245877a5ee5899aba'
marcb@ubuntu2204:~/pypilot_pi/build$ cmake ..
And it works! It installs in /usr/local/lib/opencpn/ where it is not found by opencpn, which looks in /usr/lib/opencpn/. Copying it there does not work, but copying it to ~/.local/lib/opencpn/ did the trick:
Yes, well either the install script needs to go into ~/.local or opencpn should load plugins from /usr/local (I hacked mine so it does) Not sure what the eventual solution will be.
@marcobergman Marco, can you try the new version in PIM 0.40.31? Hopefully it works now. If so, please close this. Thanks.
I checked that (i.e. PIM 0.40.31) earlier and I just checked it again, but the one from the master plugin catalog invariantly creates the problems described in this issue. The one compiled straight from github doet not create those problems.
Thanks, sent to Dave, perhaps he has some ideas.
Marco... Please clarify: How did you build and install the version that works? Details, please?
Dave, Marco wrote 3 hrs ago:
I checked that (i.e. PIM 0.40.31) https://github.com/pypilot/pypilot_pi/issues/37#issuecomment-1870134723 and I just checked it again, but the one from the master plugin catalog invariantly creates the problems described in this issue. The one compiled straight from github doet not create those problems.
Its weird...
Marco, do other TP FE2 plugins from PIM fail like this? Climatology 1.6.31, Squiddio 1.3.91, Autopilot_route 0.4.31?
@Dave: Also suggest reading what Sean wrote above about location.
I need to see Marco's exact configuration and CLI commands which built a working plugin. How, exactly, do they differ from the canonical CCI build and workflow?
For Sean: This problem is unique to PyPilot. It is the only FE2 plugin that uses a "bare" wxGLCanvas, for the calibration windows. Nothing objectively wrong with this implementation on paper, but it generates a link error on Ubuntu 22.04. Sometimes...
The other new plugin builds mentioned by Rick above load and run on ubuntu 22.04 just fine.
Ok sorry for the delay, this is what I did:
sudo apt-get update
sudo apt-get upgrade
sudo apt install devscripts equivs
sudo mk-build-deps -i -r ci/control
sudo apt-get --allow-unauthenticated install -f
git clone https://github.com/pypilot/pypilot_pi
cd pypilot_pi/
git submodule init
git submodule update
mkdir build
cd build
cmake ..
vi ../cmake/PluginConfigure.cmake
cmake ..
make
sudo make install
cp /usr/lib/opencpn/libpypilot_pi.so ~/.local/lib/opencpn/
The edit that I made to PluginConfigure.cmake was to circumvent the problems I get within this constellation regarding wxwidgets. I have struggled before with that compiling plugins on Ubuntu, the solution appeared to disable GTK2, as described in this link. You and/or Rick could not recognize this issue in the past (I think, will dig up details after this), so I got the solution from somewhere else.
Oh, and I added WaylandEnable=false to /etc/gdm3/custom.conf, further to this exchange.
If I undo the changes to PluginConfigure.cmake, I'll get this:
-- PluginConfigure: wxWidgets_Version:
-- PluginConfigure: wxWidgets components: base;core;net;xml;html;adv;aui;gl
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindwxWidgets.cmake:1025 (find_package_handle_standard_args)
cmake/PluginConfigure.cmake:547 (find_package)
CMakeLists.txt:138 (include)
-- Configuring incomplete, errors occurred!
Why aren't you installing the plugin from PIM (Plugin Manager?) and why didn't you make this clear to begin with?
Marco... I follow your process. I think you can avoid the need for editing PluginConfigure.cmake, if you do this in the shell running your build:
$ export BUILD_GTK3=TRUE
Will you confirm that please? My 22.04 machine is unavailable at the moment.
Confirmed on 22.04, thx!
Marco... OK. If possible can you run (on the working version)
$ ldd ~/.local/lib/opencpn/libpypilot.so
And, if not too much trouble, get the latest tarball from Cloudsmith, extract it, and run "ldd" against the libpypilot.so found in the tarball? Here is a link to the current CI build, which fails to install.
Obviously, we are looking for differences in the output of "ldd" for the two cases. Thanks Dave
I presume you meant libpypilot_pi.so. If I strip the hex addresses off the output of ldd, the output is identical. The .so files have quite different sizes, though. This is what I did, output attached:
$ #After compile:
$ ldd ~/.local/lib/opencpn/libpypilot_pi.so > ~/compiled_from_source.txt
$ ls -al ~/.local/lib/opencpn/libpypilot_pi.so
-rw-r--r-- 1 marcb marcb 1232744 dec 27 14:44 /home/marcb/.local/lib/opencpn/libpypilot_pi.so
$ mv ~/compiled_from_source.txt ~/compiled_from_source_1232744.txt
$ #After reinstall from PIM
$ ls -al ~/.local/lib/opencpn/libpypilot_pi.so
-rw-r--r-- 1 marcb marcb 1042568 dec 26 23:25 /home/marcb/.local/lib/opencpn/libpypilot_pi.so
$ ldd ~/.local/lib/opencpn/libpypilot_pi.so > ~/from_pim_0.40.31.0_1042568.txt
$ diff ~/compiled_from_source_1232744.txt ~/from_pim_0.40.31.0_1042568.txt > diff.txt
$ cut -d " " -f 3 compiled_from_source_1232744.txt > compiled_from_source.txt
$ cut -d " " -f 3 from_pim_0.40.31.0_1042568.txt > from_pim_0.40.31.0.txt
$ diff compiled_from_source.txt from_pim_0.40.31.0.txt
$ diff compiled_from_source.txt from_pim_0.40.31.0.txt > diff2.txt
compiled_from_source_1232744.txt compiled_from_source.txt from_pim_0.40.31.0_1042568.txt from_pim_0.40.31.0.txt diff.txt from_tarball_1042568.txt from_tarball.txt
diff2.txt is empty the file from the tarball is identical to the one from PIM, al least the size and the modules; the hex addresses are different
Marco... Thanks to your help, we have resolved this trouble. The root cause was that the CI builds were using the incorrect version of wxWidgets. CI was using 3.2.1, but it should have matched the OCPN build using 3.2.2.
Please update the plugin catalog, load pypilot_pi v0.40.31.2, and confirm/close.
Thanks again
Good to hear, I checked it and issue closed. Thanks for all you guys' persistence!
Installing Ubuntu desktop 22.04 and opencpn from ppa:opencpn/opencpn, the pypilot plugin is non-functional, then rejected right after restart of opencpn.
The opencpn.log file mentions
undefined symbol: _ZNK13wxGLCanvasEGL15IsShownOnScreenEv, version WXU_3.2
(see below).Starting OCPN with Wayland disabled (
GDK_BACKEND=x11 opencpn
or puttingWaylandEnable=false
in /etc/gdm3/custom.conf) does not solve the problem.