Getting Linrad to Run on a 64 bit Operating System


Image




Prompted by a query by Ernst Carstensen DL2LAC on the Linrad Mailinglist in January 2007, I decided to see if I could get Linrad running on my 64 bit version of Ubuntu. I had tried to compile and run Linrad on this system back in September 2006 [it is January 2007 as I type this], with no success. This page discusses the problem and how I got xlinrad and linrad for svgalib compiled and running, with various degrees of success, on 64 bit Ubuntu. At the bottom of the page I discuss how I got Linrad for Windows to control my WSE Hardware via the parallel port when running XP64.

Leif SM5BSZ and I exchanged emails back in September 2006 and he pointed out that Linrad assumes the following data type sizes [ILP32]:

char: 1
short = short int: 2
int: 4
long = long int: 4 .

A little test program he sent me to run showed that the 64 bit gcc compiler I was using [see above for version number] uses the following sizes [LP64]:

char 1
short int 2
int 4
long int 8
long unsigned int 8 .

If the gcc compiler is run with the "-m32" option, it will compile 32 bit code, and then the following data type sizes are used:

char: 1
short = short int: 2
int: 4
long = long int: 4 .

This is of course just what 32 bit Linrad needs. Of course, it is not so simple as just typing "-m32- somewhere and having Linrad run. The appropriate 32 bit libraries must be located and placed in the proper places, and the proper links created.

My machine uses a Core 2 Duo and the operating system is: UBUNTU Linux amd64 2.6.15-27-amd64-generic #1 SMP PREEMPT Sat Sep 16 01:50:50 UTC 2006 x86_64 GNU/Linux.

and gcc is:

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk-default
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre
--enable-mpfr --disable-werror --enable-checking=release
x86_64-linux-gnu
Thread model: posix
gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

Xlinrad on a 64 bit OS

The steps I did to get xlinrad to compile include:

sudo apt-get install ia32-libs ia32-libs-gtk ia32-libs-sdl ia32-libs-kde [all may not be necessary]

sudo apt-get install libc6-i386
sudo apt-get install libc6-dev-i386
cd /usr/lib32
sudo ln -s libX11.so.6 libX11.so
sudo ln -s libXext.so.6 libXext.so
sudo ln -s libz.so.1 libz.so

add lines:
'/usr/lib32'
'/lib32'
to the /etc/ld.so.conf file and then
run 'ldconfig'

Modify the Makefile.in file in the Linrad directory by adding '-m32' in 4 places: after the = sign on the two lines near the beginning of the file starting with CFL and CFW, and after the 'gcc' in two lines beginning with 'gcc' later in the file. The exact lines after this change are:

CFL = -m32 -g -O -DOSNUM=1 -W -Wimplicit -Wreturn-type -Wformat \
CFW = -m32 -g -O -DOSNUM=2 -W -Wimplicit -Wreturn-type -Wformat \
gcc -m32 -g -olinrad -lvgagl -lvga -lpthread -lm \
gcc -m32 -g -oxlinrad -L/usr/X11R6/lib -lX11 -lpthread -lm \


Then do the usual
cd /linrad/linrad-02.17 [or whatever]
./configure
make xlinrad
./xlinrad

and xlinrad should run for you. I have gotten 32 bit XLINRAD to compile fine and to run overnight with no problem on the Ubuntu 64 bit system here. For as long as I have left it running and 'locked in' on a received signal, it has performed flawlessly.

However, with some kernel versions, clicking on the waterfall or spectrum to select a new signal will SOMETIMES [but not always] cause linrad to crash in one of 3 ways: screen and audio lock up [can exit by clicking on 'X' in upper right hand corner of window], or Linrad error message screen appears, or Linrad screen disappears and you are thrown back to terminal screen with a Segmentation Fault. Playing around with the mouse on the screen in any other manner doesn't cause a problem.

As long as you are not selecting new signals, Linrad 'seems' to run fine forever. Today I installed a newer kernel, also with the real-time patch, and it is immune, or at leat very resistant, to this problem. I have not yet gotten it to crash, but that is with less than 24 hours of testing. The kernel is 2.6.19.1-rt15 and I started with the 2.6.19 kernel and added the 2.6.19-rt15 patch.

Running this 32 bit version of Xlinrad [compiled on a 64 bit system] on a 32 bit version of Ubuntu using the same Hardware does not give this problem.

Here is the valgrind output that results when running this version of xlinrad with 64 bit Ubuntu with a 2.6.18 or earlier kernel: valgrindxlinrad02

Here is the valgrind file produced when it is run on a 32 bit version of Ubuntu: valgrind-linrad32-32

Note that the 'standard' 32 bit xlinrad, compiled under 32 bit Ubuntu, when run on a 32 bit version of Ubuntu, also produces similar errors: valgrind-stdlinrad32bit. The two 32-bit xlinrad valgrind files contain similar errors. It is possible that some of the 'errors' that valgrind finds in xlinrad that do not appear to affect its performance in 32 bit Ubuntu DO affect its performance in 64 bit Ubuntu running under some kernels. It is also possible that some other difference in how xlinrad runs on the 64 bit Ubuntu kernels as compared to the 32 bit kernels is the issue, and that there would be a problem even if there WAS a 64 bit version of xlinrad running under certain 64-bit kernel implementations.

All of the above is for Ubuntu. To get a hint of what might be needed with other distributions, at least as far as the X11 related items are concerned, go to: http://wiki.winehq.org/WineOn64bit#head-56206e8b, and focus on the X11 related items.

Linrad for SVGALIB on a 64 bit OS

I have gotten 32 bit LINRAD FOR SVGALIB to compile fine and to run as far as the startup screens to on Ubuntu 64 bit system. I have not gotten it to run fully. The first step in this regard is getting svgalib to compile in 32 bit mode. These are the steps I used to do this:

I was able to get svgalib to compile without apparent errors as a 32 bit version by modifying the svgalib source code lines by adding -m32 in several spots.

The modified lines in directory /svgalib-1.9.25/ are:

Makefile.cfg:LDFLAGS = -m32 -s

utils/Makefile:CFLAGS = $(WARN) $(OPTIMIZE) -m32 -I../include -L../sharedlib

utils/Makefile: gcc -m32 $(INCLUDES) -MM $(patsubst %.o,$(srcdir)/utils/%.c,$(OBJECTS)) >.depend

I then copied the following 32 bit svgalib libraries from directory /usr/local/lib in a 32 bit version of Ubuntu on the same computer to the directory /usr/lib32/ in the 64 bit version of Ubuntu:
libvga.so
libvga.so.1
libvga.so.1.9.25
libvgal.so
libvgagl.so.1
libvgagl.so.1.9.25

I created the following symbolic links in /usr/lib32/:
sudo ln -s libGL.so.1 libGL.so
sudo ln -s libGLU.so.1 libGLU.so

Doing this allowed svgalib to compile as the 32 bit version [Go to .../svgalib-1.9.25/ and type "make clean" and then "make install" and it should install with no errors. Then type "make demos" to make the demos, which should install with no errors.] After doing this the 32 bit version of vgatest appears to run fine, but throws off 1.2 MB of valgrind errors. Here is the valgrind error file for vgatest: valgrindvgatest

After doing this, the 32 bit svgalib form of Linrad compiles completely and with no reported errors on the 64 bit Ubuntu using the same modified Makefile.in described above in the xlinrad section with the usual:
./configure
make linrad.

Linrad for SVGALIB runs to give me the setup screens. However, it runs no further, and locks up when one tries to advance beyond the setup screen. I placed the vagrind output for ./linrad here: valgrindlinrad


Linrad for Windows on XP 64

Linrad for Windows runs OK on my XP64 Core 2 Duo. It even controls the WSE hardware over the printer port! To to this I had to install the 64 bit port of InPOut32 from http://www.highrez.co.uk/Downloads/InpOut32/default.htm. Once you have done this, put the new version of inpout32.dll which is in the Win32 directory of this zip file into your C:\Windows\system and C:\Windows\system32 directories and run the file InstallDriver.exe that is in the same Win32 directory. You don't need to install the files in the x64 directory to run the WSE Hardware from the parallel port with Linrad for Windows. I have two parallel ports installed in XP64, and they have addresses 32768 and 33792. Type the appropriate port address in at the 'usual' place when setting up the Linrad parallel port via the "S" command from the main menu and things should work fine for you.

Comments and corrections are welcome!


Copyright 1997-2007 COPYRIGHT Roger Rehr W3SZ. All Rights Reserved

Brought to you by the folks at W3SZ