Build LimeSuite on Netbsd10.0

Hi. I try build from source LimesuiteGUI on netbsd.
I got from github source code.
Run cmake …/

style="font-family:time"

..............
-- Enabling native optimizations
-- Found libusb-1.0:
--  - Includes: /usr/pkg/include/libusb-1.0
--  - Libraries: /usr/pkg/lib/libusb-1.0.so
-- USB_INCLUDE_DIRS: /usr/pkg/include/libusb-1.0
-- USB_LIBRARIES: /usr/pkg/lib/libusb-1.0.so
-- USB_INCLUDE_DIRS: /usr/pkg/include/libusb-1.0
-- USB_LIBRARIES: /usr/pkg/lib/libusb-1.0.so
-- wxWidgets_DEFINITIONS: _FILE_OFFSET_BITS=64;WXUSINGDLL;__WXGTK__
-- wxWidgets_INCLUDE_DIRS: /usr/pkg/lib/wx/include/gtk3-unicode-3.0;/usr/pkg/include/wx-3.0
-- wxWidgets_LIBRARIES: -L/usr/pkg/lib;-pthread;;;-lwx_gtk3u_richtext-3.0;-lwx_baseu_xml-3.0;-lwx_gtk3u_html-3.0;-lwx_gtk3u_xrc-3.0;-lwx_gtk3u_adv-3.0;-lwx_gtk3u_aui-3.0;-lwx_gtk3u_core-3.0;-lwx_baseu-3.0;-lwx_gtk3u_gl-3.0
-- OPENGL_INCLUDE_DIR: /usr/X11R7/include
-- OPENGL_LIBRARIES: /usr/X11R7/lib/libGL.so;/usr/X11R7/lib/libGLU.so
-- GNUPlot Found
-- Module LMS7Support configured with version: 22.09.0-e829d3ed
-- 
-- ######################################################
-- ## LimeSuite enabled features
-- ######################################################
-- 
 * LimeSuiteHeaders, The lime suite headers
 * LimeSuiteLibrary, The lime suite library
 * ConnectionFX3, FX3 Connection support
 * ConnectionFTDI, FTDI Connection support
 * ConnectionXillybus, PCIE Xillybus Connection support
 * LimeSuiteGUI, GUI Application for LimeSuite
 * LimeSuiteExamples, LimeSuite library API examples
 * LimeRFE, LimeRFE support
 * LimeUtilCommand, Command line device discovery utility
 * LimeQuickTest, LimeSDR-QuickTest Utility
 * SoapySDRLMS7, SoapySDR bindings for LMS7
 * LimeSuiteOctave, LimeSuite Octave integration

-- ######################################################
-- ## LimeSuite disabled features
-- ######################################################
-- 
 * ConnectionEVB7COM, EVB+COM Connection support
 * ConnectionSTREAM_UNITE, STREAM+UNITE Connection support
 * ConnectionSPI, Rasp Pi 3 SPI Connection support
 * LimeSuiteDocAPI, LMS API Doxygen documentation
 * LimeSuiteDesktop, LimeSuite freedesktop integration

-- Install prefix: /usr/local
-- Build timestamp: 2024-04-12
-- Lime Suite version: 22.09.0-ge829d3ed
-- ABI/so version: 22.09-1
-- Configuring done (0.2s)
-- Generating done (0.2s)
-- Build files have been written to: /root/LimeSuite/builddir

nbgear# make
[ 1%] Building CXX object src/CMakeFiles/LimeSuite.dir/Logger.cpp.o
[ 2%] Building CXX object src/CMakeFiles/LimeSuite.dir/ADF4002/ADF4002.cpp.o
In file included from /root/LimeSuite/src/ADF4002/ADF4002.cpp:9:
/usr/include/g++/cmath:1065:11: error: ‘double_t’ has not been declared in ‘::’
1065 | using ::double_t;
| ^~~~~~~~
/usr/include/g++/cmath:1066:11: error: ‘float_t’ has not been declared in ‘::’
1066 | using ::float_t;
| ^~~~~~~

*** Error code 1

Stop.
make[2]: stopped in /root/LimeSuite/builddir
*** Error code 1

Stop.
make[1]: stopped in /root/LimeSuite/builddir
*** Error code 1

Stop.
make: stopped in /root/LimeSuite/builddir

And process stopped on elementary type definition.
Need help.
gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
Target: x86_64–netbsd
Configured with: /usr/src/tools/gcc/…/…/external/gpl3/gcc/dist/configure --target=x86_64–netbsd --enable-long-long --enable-threads --with-bugurl=NetBSD Problem Reports --with-pkgversion=‘NetBSD nb2 20230710’ --with-system-zlib --without-isl --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-tune=nocona --with-default-libstdcxx-abi=new --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-libstdcxx-pch --build=x86_64–netbsd --host=x86_64–netbsd --with-sysroot=/var/obj/mknative/amd64-x86_64/usr/src/destdir.amd64
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.5.0 (nb3 20231008)

it seems the header problem is caused by GCC’s “-mfpmath=both” flag.

run: cmake …/ -DENABLE_SIMD_FLAGS=SSE

Thank You for help. Its work! But process stop on [78%]with message: ld cannot find -lGL
although GL libraries from X11R7 are available in …LimesuiteGUI/link.txt.

seems the usr/X11R7/lib path is not added to the linker’s default search paths.
You can remove “GL” from LimeSuite/src/oglGraph/CMakeLists.txt at master · myriadrf/LimeSuite · GitHub

Ok. I got the following:

[ 87%] Building CXX object src/examples/CMakeFiles/basicTX.dir/basicTX.cpp.o
[ 87%] Linking CXX executable …/…/bin/basicTX
[ 87%] Built target basicTX
[ 88%] Building CXX object LimeUtil/CMakeFiles/LimeUtil.dir/LimeUtil.cpp.o
/root/LimeSuite/LimeUtil/LimeUtil.cpp: In function ‘int main(int, char**)’:
/root/LimeSuite/LimeUtil/LimeUtil.cpp:427:22: error: ‘getopt_long_only’ was not declared in this scope; did you mean ‘getopt_long’?
427 | while ((option = getopt_long_only(argc, argv, “”, long_options, &long_index)) != -1)
| ^~~~~~~~~~~~~~~~
| getopt_long
*** Error code 1

Stop.
make[2]: stopped in /root/LimeSuite/builddir
*** Error code 1

huh, netBSD does not provide getopt_long_only function, replace it with getopt_long and it will work.

Get :joy:
[ 90%] Built target LimeUtil
[ 91%] Linking CXX executable LimeQuickTest
ld: warning: libXft.so.3, needed by /usr/pkg/lib/libfltk.so, may conflict with libXft.so.2
ld: warning: libfontconfig.so.2, needed by /usr/pkg/lib/libfltk.so, may conflict with libfontconfig.so.1
ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_resync_to_restart' ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_std_error’
ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_CreateDecompress' ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_read_header’
ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_destroy_decompress' ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_calc_output_dimensions’
ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_finish_decompress' ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_start_decompress’
ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_read_scanlines' ld: /usr/pkg/lib/libfltk_images.so: undefined reference to jpeg_stdio_src’
*** Error code 1

in file
…/builddir/QuickTest/CMakeFiles/LimeQuickTest.dir/link.txt
insert -ljpeg

and get
[ 87%] Built target basicTX
[ 90%] Built target LimeUtil
[ 91%] Linking CXX executable LimeQuickTest
ld: warning: libXft.so.3, needed by /usr/pkg/lib/libfltk.so, may conflict with libXft.so.2
ld: warning: libfontconfig.so.2, needed by /usr/pkg/lib/libfltk.so, may conflict with libfontconfig.so.1
[ 95%] Built target LimeQuickTest
[ 95%] Building CXX object SoapyLMS7/CMakeFiles/LMS7Support.dir/Registration.cpp.o
[ 96%] Building CXX object SoapyLMS7/CMakeFiles/LMS7Support.dir/Settings.cpp.o
[ 97%] Building CXX object SoapyLMS7/CMakeFiles/LMS7Support.dir/Streaming.cpp.o
[ 97%] Building CXX object SoapyLMS7/CMakeFiles/LMS7Support.dir/Version.cpp.o
[ 98%] Linking CXX shared module libLMS7Support.so
[ 98%] Built target LMS7Support
[100%] Building LimeSuite Octave plugin
[100%] Built target LimeSuiteOctave

huh

and it work.
ricardas
Thank You.