analogdevicesinc/iio-oscilloscope

Ubuntu 22.04 cmake error

octaplexsys opened this issue · 9 comments

Can't build from sources under latest version of linux kernel (Ubuntu 22.04 LTS)
Step to reproduce :
According to documentation on page
https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope#installation
for step 5 on cmake execution activity ,get some error

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

Can you post the entire error message?
Maybe it's due to GTK2?
We're in progress updating to GTK3...

First of all apologies for posting here, I don't know if it is due, since it is indicated in title Ubuntu 22.04, but this happened to me the same in KDE Neon and now in Debian Buster. The first problem I encountered was that it is not indicated in the tutorial on the page that the following packages should be installed in Debian

libad9361-dev
libiio-dev

with the comanod:

sudo apt install libad9361-dev libiio-dev

this improved the error output but I still can't find another missing package.
the output of the cmake below

~/iio-oscilloscope/build$ cmake ../ && make -j $(nproc)
-- The C compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/bin/git (found version "2.20.1") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Checking for module 'glib-2.0'
--   Found glib-2.0, version 2.58.3
-- Checking for module 'gtk+-2.0'
--   Found gtk+-2.0, version 2.24.32
-- Checking for module 'gthread-2.0'
--   Found gthread-2.0, version 2.58.3
-- Checking for module 'gtkdatabox'
--   Found gtkdatabox, version 0.9.3.1
-- Checking for module 'fftw3'
--   Found fftw3, version 3.3.8
-- Checking for module 'libxml-2.0'
--   Found libxml-2.0, version 2.9.4
-- Checking for module 'libcurl'
--   Found libcurl, version 7.64.0
-- Checking for module 'jansson'
--   Found jansson, version 2.12
-- Checking for module 'matio'
--   Found matio, version 1.5.13
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/home/focus/iio-oscilloscope/LIBAD9166_INCLUDE_DIRS
   used as include directory in directory /home/focus/iio-oscilloscope
/home/focus/iio-oscilloscope/plugins/LIBAD9166_INCLUDE_DIRS
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
   used as include directory in directory /home/focus/iio-oscilloscope/plugins
LIBAD9166_LIBRARIES
    linked by target "osc" in directory /home/focus/iio-oscilloscope
    linked by target "AD5628_1" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "cf_axi_tdd" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "adrv9009_adv" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "ad9081" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "adrv9009" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcomms2_adv" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "ad9371" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "scpi" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "ad9371_adv" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcomms11" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "pr_config" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcomms6" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcomms5" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "generic_dac" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "cn0511" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcomms1" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "ad9739a" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "daq2" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "AD7303" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "cn0357" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "cn0508" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcadc3" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "cn0540" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "ad6676" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "motor_control" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "spectrum_analyzer" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "dmm" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "debug" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "lidar" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "adrv9002" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "fmcomms2" in directory /home/focus/iio-oscilloscope/plugins
    linked by target "xmw" in directory /home/focus/iio-oscilloscope/plugins

-- Configuring incomplete, errors occurred!
See also "/home/focus/iio-oscilloscope/build/CMakeFiles/CMakeOutput.log".

details of PC

       _,met$$$$$gg.          jhonddoe@anon 
    ,g$$$$$$$$$$$$$$$P.       ----------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 10 (buster) x86_64 
 ,$$P'              `$$$.     Host: 530U3C/530U4C 0.1 
',$$P       ,ggs.     `$$b:   Kernel: 4.19.0-5-amd64 
`d$$'     ,$P"'   .    $$$    Uptime: 1 hour, 9 mins 
 $$P      d$'     ,    $$P    Packages: 2152 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.0.3 
 $$;      Y$b._   _,d$P'      Resolution: 1366x768 
 Y$$.    `.`"Y$$$$P"'         DE: Xfce 
 `$$b      "-.__              WM: Xfwm4 
  `Y$$                        WM Theme: Default 
   `Y$$.                      Theme: Xfce-saltlake [GTK2], Adwaita [GTK3] 
     `$$b.                    Icons: Tango [GTK2], Adwaita [GTK3] 
       `Y$$b.                 Terminal: xfce4-terminal 
          `"Y$b._             Terminal Font: Monospace 12 
              `"""            CPU: Intel i5-3317U (4) @ 2.600GHz 
                              GPU: Intel 3rd Gen Core processor Graphics Contro 
                              Memory: 1256MiB / 5743MiB 

after finding the missing package by running the script from the page indicated in the previous post for the ADI script adi_update_tools.sh and installing the libiio dependencies as well, with the command:

sudo apt-get install libxml2 libxml2-dev bison flex libcdk5-dev cmake
sudo apt-get install libaio-dev libusb-1.0-0-dev libserialport-dev libxml2-dev libavahi-client-dev doxygen graphviz

it seems that I found the missing package, however it still does not compile, the compile message was as follows:

Scanning dependencies of target osc
[  1%] Building C object CMakeFiles/osc.dir/osc.c.o
[  2%] Building C object CMakeFiles/osc.dir/oscplot.c.o
[  3%] Building C object CMakeFiles/osc.dir/datatypes.c.o
[  4%] Building C object CMakeFiles/osc.dir/iio_widget.c.o
[  6%] Building C object CMakeFiles/osc.dir/iio_utils.c.o
[  7%] Building C object CMakeFiles/osc.dir/fru.c.o
/home/focus/iio-oscilloscope/iio_utils.c: In function ‘get_iio_device_label_or_name’:
/home/focus/iio-oscilloscope/iio_utils.c:148:7: error: implicit declaration of function ‘iio_device_get_label’; did you mean ‘iio_device_get_name’? [-Werror=implicit-function-declaration]
  id = iio_device_get_label(dev);
       ^~~~~~~~~~~~~~~~~~~~
       iio_device_get_name
/home/focus/iio-oscilloscope/iio_utils.c:148:5: error: assignment to ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
  id = iio_device_get_label(dev);
     ^
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/osc.dir/build.make:115: CMakeFiles/osc.dir/iio_utils.c.o] Error 1
make[2]: *** Se espera a que terminen otras tareas....
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/osc.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

The packages in the distribution repo are too old. As noted in the instructions on the wiki you need to build and install libiio and libad9361 from source.

that's correct, as it says in the tutorial, I installed libiio and libini from source and everything worked, then I had to add a step when installing the shortcut that installs when you run the "make install" directs to a different application than /usr/local/osc so I corrected that and it ended up working, again thank you very much Travis.

big hug
VH

To help anyone else out, I also had an issue building on Ubuntu 22.04, after following the guide. Attempting to build master, I would get these errors;

[ 2%] Building C object CMakeFiles/osc.dir/oscplot.c.o
In file included from /usr/include/gtkdatabox.h:24,
from /home/alex/repos/iio-oscilloscope-master/oscplot.c:9:
/usr/include/gtkdatabox_graph.h:100:38: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
100 | GdkRGBA * color);
| ^~~~~~~
| GdkGC
In file included from /usr/include/gtkdatabox.h:24,
from /home/alex/repos/iio-oscilloscope-master/osc.c:8:
/usr/include/gtkdatabox_graph.h:100:38: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
100 | GdkRGBA * color);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_graph.h:101:4: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
101 | GdkRGBA *gtk_databox_graph_get_color (GtkDataboxGraph * graph);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_graph.h:101:4: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
101 | GdkRGBA *gtk_databox_graph_get_color (GtkDataboxGraph * graph);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_graph.h:104:38: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
104 | GdkRGBA * rgba);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_graph.h:104:38: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
104 | GdkRGBA * rgba);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_graph.h:105:4: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
105 | GdkRGBA *gtk_databox_graph_get_rgba (GtkDataboxGraph * graph);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_graph.h:105:4: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
105 | GdkRGBA *gtk_databox_graph_get_rgba (GtkDataboxGraph * graph);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/oscplot.c:10:
/usr/include/gtkdatabox_grid.h:99:43: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
99 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/osc.c:9:
/usr/include/gtkdatabox_grid.h:99:43: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
99 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_grid.h:101:43: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
101 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_grid.h:101:43: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
101 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/oscplot.c:11:
/usr/include/gtkdatabox_points.h:83:45: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
83 | GdkRGBA * color, gint size);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/osc.c:10:
/usr/include/gtkdatabox_points.h:83:45: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
83 | GdkRGBA * color, gint size);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_points.h:88:25: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
88 | GdkRGBA * color, gint size);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_points.h:88:25: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
88 | GdkRGBA * color, gint size);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/oscplot.c:12:
/usr/include/gtkdatabox_lines.h:81:44: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
81 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/osc.c:11:
/usr/include/gtkdatabox_lines.h:81:44: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
81 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_lines.h:86:21: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
86 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_lines.h:86:21: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
86 | GdkRGBA * color, guint size);
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/oscplot.c:13:
/usr/include/gtkdatabox_markers.h:149:45: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
149 | GdkRGBA * color, guint size,
| ^~~~~~~
| GdkGC
In file included from /home/alex/repos/iio-oscilloscope-master/osc.c:12:
/usr/include/gtkdatabox_markers.h:149:45: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
149 | GdkRGBA * color, guint size,
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_markers.h:164:25: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
164 | GdkRGBA * color, guint size,
| ^~~~~~~
| GdkGC
/usr/include/gtkdatabox_markers.h:164:25: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
164 | GdkRGBA * color, guint size,
| ^~~~~~~
| GdkGC
make[2]: *** [CMakeFiles/osc.dir/build.make:76: CMakeFiles/osc.dir/osc.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/alex/repos/iio-oscilloscope-master/oscplot.c: In function ‘markers_init’:
/home/alex/repos/iio-oscilloscope-master/oscplot.c:2651:36: error: implicit declaration of function ‘gtk_databox_markers_new’; did you mean ‘gtk_databox_ruler_new’? [-Werror=implicit-function-declaration]
2651 | markers[i].graph = gtk_databox_markers_new(1, &markers[i].x, &markers[i].y, &color_marker,
| ^~~~~~~~~~~~~~~~~~~~~~~
| gtk_databox_ruler_new
/home/alex/repos/iio-oscilloscope-master/oscplot.c:2651:34: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
2651 | markers[i].graph = gtk_databox_markers_new(1, &markers[i].x, &markers[i].y, &color_marker,
| ^
/home/alex/repos/iio-oscilloscope-master/oscplot.c: In function ‘plot_setup’:
/home/alex/repos/iio-oscilloscope-master/oscplot.c:3424:33: error: implicit declaration of function ‘gtk_databox_points_new’; did you mean ‘gtk_databox_ruler_new’? [-Werror=implicit-function-declaration]
3424 | graph = gtk_databox_points_new(transform->y_axis_size,
| ^~~~~~~~~~~~~~~~~~~~~~
| gtk_databox_ruler_new
/home/alex/repos/iio-oscilloscope-master/oscplot.c:3424:31: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
3424 | graph = gtk_databox_points_new(transform->y_axis_size,
| ^
/home/alex/repos/iio-oscilloscope-master/oscplot.c:3428:33: error: implicit declaration of function ‘gtk_databox_lines_new’; did you mean ‘gtk_databox_ruler_new’? [-Werror=implicit-function-declaration]
3428 | graph = gtk_databox_lines_new(transform->y_axis_size,
| ^~~~~~~~~~~~~~~~~~~~~
| gtk_databox_ruler_new
/home/alex/repos/iio-oscilloscope-master/oscplot.c:3428:31: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
3428 | graph = gtk_databox_lines_new(transform->y_axis_size,
| ^
/home/alex/repos/iio-oscilloscope-master/oscplot.c: In function ‘add_grid’:
/home/alex/repos/iio-oscilloscope-master/oscplot.c:4179:30: error: implicit declaration of function ‘gtk_databox_grid_array_new’; did you mean ‘gtk_databox_grid_get_vlines’? [-Werror=implicit-function-declaration]
4179 | priv->grid = gtk_databox_grid_array_new (25, 14, priv->gridy, priv->gridx, &color_grid, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| gtk_databox_grid_get_vlines
/home/alex/repos/iio-oscilloscope-master/oscplot.c:4179:28: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
4179 | priv->grid = gtk_databox_grid_array_new (25, 14, priv->gridy, priv->gridx, &color_grid, 1);
| ^
/home/alex/repos/iio-oscilloscope-master/oscplot.c:4183:28: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
4183 | priv->grid = gtk_databox_grid_array_new (18, 18, priv->gridy, priv->gridx, &color_grid, 1);
| ^
/home/alex/repos/iio-oscilloscope-master/oscplot.c:4187:28: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
4187 | priv->grid = gtk_databox_grid_array_new (18, 5, priv->gridy, priv->gridx, &color_grid, 1);
| ^
/home/alex/repos/iio-oscilloscope-master/oscplot.c:4194:28: error: assignment to ‘GtkDataboxGraph *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
4194 | priv->grid = gtk_databox_grid_array_new (18, 5, priv->gridy, priv->gridx, &color_grid, 1);
| ^
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/osc.dir/build.make:90: CMakeFiles/osc.dir/oscplot.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/osc.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

It appears that I can build the gtk3transition-master branch, but running it generates errors like g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed for me.

It's that an error build? Or just a warning?

It was a warning when running a build from the gtk3transition-master branch, but I've managed to get it to run (user error). However I wasn't able to get anything to build from master, I guess if gtk3transition-master is mostly there, I can just use that.

gtk3transition-master was updated and merged, this can be closed now.