pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

compiling linrad under NetBSD



Hi all,

Linrad is an X11 program by Leif Asbrink for use with SDR (Software Defined Radios)

WEB page:

https://www.sm5bsz.com/linuxdsp/linrad.htm

download at:

https://www.sm5bsz.com/linuxdsp/archive/lir05-02.zip

Linrad

As an amateur radio entusiast I am very interested in this piece of sotfware. It is originally written for Linux and Windows (MinGW). I have compiled under Linux with no effort over the years, it is written for Linux and compiles out of the box without problems.

In my ignorance I thought it would compile under NetBSD the same way, but I was too optimistic. :-(

Has anybody had luck compiling it under NetBSD? I have seen that FreeBSD has an outdated version port but only for amd64 and i386 only. It would be great to run this program in NetBSD, and in particular in the RaspberryPi, for example, to be able to use the radio receivers remotely.

I have tried to compile it myself in the RPi4 but I have not succeeded. It uses the GNU ./configure autoconf programs but I cannot pass the first steps.


rpi4-netbsd$ ./configure
...
...
Not present: libusb-1.0.so (32bit) (./configure --with-libusb1-32)
Not present: libusb.so (32bit) (./configure --with-libusb0-32)
Not present: libvga.so (32bit) or headers (./configure --with-svgalib-32)
Not present: libX11.so (32bit) or headers (./configure --with-x11-32)
Not present: libasound.so (32bit) (./configure --with-ALSA-32)
./configure: setterm: not found

test: ==: unexpected operator
test: ==: unexpected operator
test: ==: unexpected operator
To generate servers (daemons) run ./configure --with-server
rpi4-netbsd$


./configure has problems with NetBSD /bin/test program. I have installed GNU coreutils and changed manually the routes in .configure script to /usr/pkg/gnu/bin/test to overcome that:


Not present: libwd_dask.so (32bit) (./configure --with-libwd_dask-32)
Not present: libperseus-sdr.so (32bit) (./configure --with-perseus-32)
Not present: libusb-1.0.so (32bit) (./configure --with-libusb1-32)
Not present: libusb.so (32bit) (./configure --with-libusb0-32)
Not present: libvga.so (32bit) or headers (./configure --with-svgalib-32)
Not present: libX11.so (32bit) or headers (./configure --with-x11-32)
Not present: libasound.so (32bit) (./configure --with-ALSA-32)

To generate servers (daemons) run ./configure --with-server
rpi4-netbsd$



./configure script finishes ok. I issued "make xlinrad64" but it seems that it needs GNUMake.


after doing "gmake xlinrad64":



rpi4-netbsd$ gmake xlinrad64
cc -D_FILE_OFFSET_BITS=64 -DLUSERS_DEF=0 -DWUSERS_DEF=0 xmain.c -DBUILD=0 -DHAVE_XKBLIB=0 \ -I/usr/include/ -O2 -DOSNUM=1 -I/usr/include/ -W -Wall -DHAVE_OSS=0 -DCPU=CPU_INTEL -DHAVE_SHM=0 -DHAVE_X11=0 -DIA64=1 -DDARWIN=0 -DSERVER=0 -DHAVE_SVGALIB=0 -DOPENCL_PRESENT=0 -DHAVE_CUFFT=0 -Wimplicit -Wreturn-type -Wformat -Wunused -Wcomment -DOSSD=0 -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o xmain.om
xmain.c:50:10: fatal error: linux/fb.h: No such file or directory
   50 | #include <linux/fb.h>
      |          ^~~~~~~~~~~~
compilation terminated.
gmake: *** [Makefile:2105: xmain.om] Error 1
rpi4-netbsd$

I removed #include <linux/fb.h> in xmain.c:


#ifndef __FreeBSD__
#if DARWIN == 0
#include <linux/fb.h>
#endif
#endif
#include <sys/mman.h>
#include <locale.h>
#include <sys/un.h>


Run again:

rpi4-netbsd$ gmake xlinrad64



In file included from /usr/include/ctype.h:100,
                 from xmain.c:37:
xmain.c: In function ‘main’:
xmain.c:220:14: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  220 |   i=toupper(s[0]);
      |              ^
xmain.c:286:23: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  286 |     tmp[i]=toupper(tmp[i]);
      |                       ^
xmain.c:308:25: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  308 |       if(toupper(argv[1][m]) != screen_types[j][m])goto diff;
      |                         ^
cc1: all warnings being treated as errors
gmake: *** [Makefile:2105: xmain.om] Error 1
rpi4-netbsd$


I removed "-Werror" everywhere in Makefile just to try and it starts compiling for a while until it breaks after a minute or 2:

cc -D_FILE_OFFSET_BITS=64 -DLUSERS_DEF=0 -DWUSERS_DEF=0 lxsys.c -DHAVE_PARPORT=0 -O2 -DOSNUM=1 -I/usr/include/ -W -Wall -DHAVE_OSS=0 -DCPU=CPU_INTEL -DHAVE_SHM=0 -DHAVE_X11=0 -DIA64=1 -DDARWIN=0 -DSERVER=0 -DHAVE_SVGALIB=0 -DOPENCL_PRESENT=0 -DHAVE_CUFFT=0 -Wimplicit -Wreturn-type -Wformat -Wunused -Wcomment -DOSSD=0 -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -ffast-math -Wundef -fomit-frame-pointer -c -o lxsys.om
lxsys.c:37:10: fatal error: machine/cpufunc.h: No such file or directory
   37 | #include <machine/cpufunc.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake: *** [Makefile:2151: lxsys.om] Error 1
rpi4-netbsd$


I fixed with this:

#include "/usr/src/sys/arch/evbarm/include/cpufunc.h"

but now:

rpi4-netbsd$ gmake xlinrad64
cc -D_FILE_OFFSET_BITS=64 -DLUSERS_DEF=0 -DWUSERS_DEF=0 lxsys.c -DHAVE_PARPORT=0 -O2 -DOSNUM=1 -I/usr/include/ -W -Wall -DHAVE_OSS=0 -DCPU=CPU_INTEL -DHAVE_SHM=0 -DHAVE_X11=0 -DIA64=1 -DDARWIN=0 -DSERVER=0 -DHAVE_SVGALIB=0 -DOPENCL_PRESENT=0 -DHAVE_CUFFT=0 -Wimplicit -Wreturn-type -Wformat -Wunused -Wcomment -DOSSD=0 -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -ffast-math -Wundef -fomit-frame-pointer -c -o lxsys.om
In file included from lxsys.c:37:
/usr/src/sys/arch/evbarm/include/cpufunc.h:3:10: fatal error: arm/cpufunc.h: No such file or directory
    3 | #include <arm/cpufunc.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
gmake: *** [Makefile:2151: lxsys.om] Error 1

I tried to fix it but I entered in an endless loop of new compilation problems. I definitely do not have enough knowledge to make it work. I am starting thinking that this is a very complicated task. Please let me know what you think about it, if you think there are chances to make it work or it is a complete waste of time.


Thanks so much in advance.
Regards.
Ramiro.












Home | Main Index | Thread Index | Old Index