How to compile and install xinvest 2.6.9 in Ubuntu 14.04 LTS 64-bit

Asked by Tom Peters

Hi,
  I started using a XUbuntu workstation, "trusty" release 14.04, and am trying to compile an old but indispensible X11/Motif application written in C (XInvest) that I have been dragging along for decades.
  It requires, among other things, the PrintShell extensions to Motif (Xm/Print.h). These come in libmotif-dev and dependencies.
 http://packages.ubuntu.com/trusty/libmotif-dev
  The Print.h from that package dates from 1996. However the XInvest program uses some constructions that, interpreting from what I see on another system, were available in Lesstif from 2004. But the lesstif2-dev package existed within Ubuntu up to "precise" but not in "trusty" anymore.
  http://packages.ubuntu.com/precise/lesstif2-dev

So how do I go about installing Lesstif on "trusty"?

It has been 10 years since I had a Linux workstation so I am not familiar with the do's and don'ts in modern package management with Ubuntu.

Thanx for any advise,
Tom

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu motif Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#1
Revision history for this message
Tom Peters (tpeters-r) said :
#2

Mark,
thank you for the detailed procedure.

It does work to some extent such that, after installing all the packages, I can indeed compile and get a working program.
However it does have trouble reading my .inv files (e.g. a "Split" line, and a few other problems that I cannot explain yet).

2.6 is an older version, apparently dating from 2000. I have been using a version 2.6.9 of 1 May 2004 made by Danny Backx.
He also made a version dated 31 July 2005 with an extra program "XQuote" but I never got it to work.

My previous port was to Mac OSX 10.6.8 in 2012, for which I had to make some edits myself and had to spend quite some time to get it to compile and work. But now my HD broke and I upgraded and I got tired trying to make Motif work on OSX again, so I try Linux.

As I wrote, the 2.6.9 version needs a Xm/Print.h with a type "XmPrintShellCallbackStruct" which is not in the current XUbuntu libmotif-dev. These Motif PrintShell features apparently were not in v2.6 yet.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#3

Read this:

http://manpages.ubuntu.com/manpages/trusty/man3/XmPrintShell.3.html

It indicates that libmotif-dev provides XmPrintShellCallbackStruct in Ubuntu 14.04 LTS and in Ubuntu 14.10.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#4

What's the output of this Terminal command?

uname -a ; cat /etc/lsb-release ; apt-cache policy libmotif-dev ; ls -lart /usr/include/Xm/Print.h

Revision history for this message
Tom Peters (tpeters-r) said :
#5

Mark
thanx for your continued interest.

Here are the calls.

$ uname -a
Linux Linux2015 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:37:48 UTC 2015 i686 i686 i686 GNU/Linux

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

$ apt-cache policy libmotif-dev
libmotif-dev:
  Geïnstalleerd: 2.3.4-5
  Kandidaat: 2.3.4-5
  Versietabel:
 *** 2.3.4-5 0
        500 http://nl.archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
        100 /var/lib/dpkg/status

$ ls -lt /usr/include/Xm/Print.h
-rw-r--r-- 1 root root 1629 dec 3 2013 /usr/include/Xm/Print.h

$ head /usr/include/Xm/Print.h
/* $XConsortium: Print.h /main/14 1996/10/29 15:50:44 drk $ */
/*
 * (c) Copyright 1996 Digital Equipment Corporation.
 * (c) Copyright 1996 Hewlett-Packard Company.
 * (c) Copyright 1996 International Business Machines Corp.
 * (c) Copyright 1996 Sun Microsystems, Inc.
 * (c) Copyright 1996 Novell, Inc.
 * (c) Copyright 1996 FUJITSU LIMITED.
 * (c) Copyright 1996 Hitachi.
 */

$ grep XmPrintShellCallbackStruct /usr/include/Xm/Print.h

$ grep XmPrintShell /usr/include/Xm/Print.h
#ifndef _XmPrintShell_h
#define _XmPrintShell_h
typedef struct _XmPrintShellClassRec * XmPrintShellWidgetClass;
typedef struct _XmPrintShellRec * XmPrintShellWidget;
#endif /* _XmPrintShell_h */

On top of the XUbuntu install CD I installed these packages:
+ for imake and xmkmf, I installed xutils-dev
+ for X11 Includes, I installed libxt-dev (and dependencies)
+ for Xm (X11 Motif), I installed libmotif-dev (and dependencies, esp. libmotif-common)
cf. http://packages.ubuntu.com/trusty/libmotif-dev
+ for X11 Print extensions, I installed x11proto-print-dev
cf. http://packages.ubuntu.com/trusty/x11proto-print-dev

That last one also contains a Print.h but that also is not what XInvest 2.6.9 needs:

$ head -35 /usr/include/X11/extensions/Print.h
/* $Xorg: Print.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
/******************************************************************************
 ******************************************************************************
 **
 ** File: Print.h
 **
 ** Description: Definitions needed by the server, library, and
 ** clients. Subportion restricted to library and
 ** clients.
 **
 ** Server, Library, Client portion has:
 ** o All sz_* defines
 ** o Revision and Name defines
 ** o Common defines and constants (e.g. Keywords, Masks)
 ** o Extension version structure
 **
 ** Library and client subportion has:
 ** o Convience Marcos
 ** o Client side data structures
 ** o Client side event structures (non wire)
 ** o Library function prototypes
 ** o some private stuff denoted with _whatever
 **
 ** Printstr.h for server and library, but NOT clients.
 **
 ******************************************************************************
 **
 ** (c) Copyright 1996 Hewlett-Packard Company
 ** (c) Copyright 1996 International Business Machines Corp.
 ** (c) Copyright 1996, Oracle and/or its affiliates. All rights reserved.
 ** (c) Copyright 1996 Novell, Inc.
 ** (c) Copyright 1996 Digital Equipment Corp.
 ** (c) Copyright 1996 Fujitsu Limited
 ** (c) Copyright 1996 Hitachi, Ltd.
 **

$ grep XmPrintShell /usr/include/X11/extensions/Print.h

$

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#6

It seems you are right. In the meantime, I have tried all kinds of methods to try to get v2.6.9 compiled. I get the same error, unfortunately. At least I got 2.6 working, which is better than nothing at all....

Revision history for this message
Tom Peters (tpeters-r) said :
#7

Mark,
so with libmotif-dev I got a very old (1996) version of Print.h . Is that correct, considering that according to the description that you posted (http://manpages.ubuntu.com/manpages/trusty/man3/XmPrintShell.3.html) it should contain the CallBack struct - which the version I got does not?

As I initially wrote, in my port to OSX I used lesstif, which apparently had a more recent version of Print. So I return to my original question: how can I get the lesstif2-dev package into "trusty"?

And yes, I believe that I need the newer 2.6.9 version of XInvest, which apparently has some new features (besides Print) that I have been using in my .inv files.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#8

Tom,

See your own post (post #5)

You gave the following output:

$ apt-cache policy libmotif-dev
libmotif-dev:
  Geïnstalleerd: 2.3.4-5
  Kandidaat: 2.3.4-5
  Versietabel:
 *** 2.3.4-5 0
        500 http://nl.archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
        100 /var/lib/dpkg/status

$ ls -lt /usr/include/Xm/Print.h
-rw-r--r-- 1 root root 1629 dec 3 2013 /usr/include/Xm/Print.h

The output shows that the /usr/include/Xm/Print.h version in libmotif-dev was last modified on December 3, 2013, NOT 1996.

I think this is a bug in the 2.6.9 code in xinvest and not in the Ubuntu libraries.

It is much more likely that there is a bug in the 2.6.9 code in xinvest which has not been updated since 2004.

11 years without any code update is like an eternity....

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#9

If you want to experiment with lesstif2-dev, I suggest performing a dual boot between Ubuntu 14.04 LTS and Ubuntu 12.04 LTS.

Then install lesstif2-dev and xinvest 2.6.9 in Ubuntu 12.04 LTS, not in Ubuntu 14.04 LTS.

Mixing packages from precise and trusty will only break your apt-get package manager. So I cannot recommend doing that.

I recommend keeping trusty and precise packages on separate Ubuntu installs.

Ubuntu 12.04 LTS will receive updates until April 2017.

Revision history for this message
Tom Peters (tpeters-r) said :
#10

Mark,
I have to challenge you on your message #8
I re-installed XUbuntu "trusty" and the relevant (Xm) packages.
The file Print.h appears indeed first in libmotif-dev:

$ apt-cache policy libmotif-dev
libmotif-dev:
  Geïnstalleerd: 2.3.4-5
  Kandidaat: 2.3.4-5
  Versietabel:
 *** 2.3.4-5 0
        500 http://nl.archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
        100 /var/lib/dpkg/status

$ ls -l /usr/include/Xm/Print.h
-rw-r--r-- 1 root root 1629 dec 3 2013 /usr/include/Xm/Print.h

$ head -10 /usr/include/Xm/Print.h
/* $XConsortium: Print.h /main/14 1996/10/29 15:50:44 drk $ */
/*
 * (c) Copyright 1996 Digital Equipment Corporation.
 * (c) Copyright 1996 Hewlett-Packard Company.
 * (c) Copyright 1996 International Business Machines Corp.
 * (c) Copyright 1996 Sun Microsystems, Inc.
 * (c) Copyright 1996 Novell, Inc.
 * (c) Copyright 1996 FUJITSU LIMITED.
 * (c) Copyright 1996 Hitachi.
 */

So notice that this version apparently has had no edits since 1996.
It also does NOT contain a definition for the XmPrintShellCallbackStruct
But the man(3) page for XmPrintShell from this package in the "trusty" version documents that it should be, as you posted before.
I found the struct conditionally defined in Xm/Xm.h itself:
...
#ifndef PRINTING_SUPPORTED
/* #undef PRINTING_SUPPORTED */
#endif
...
#ifdef PRINTING_SUPPORTED
typedef struct
{
    int reason; /* XmCR_START_JOB, XmCR_END_JOB, XmCR_PAGE_SETUP */
    XEvent *event;
    XPContext context;
    Boolean last_page; /* in_out */
    XtPointer detail;
} XmPrintShellCallbackStruct;
#endif /* PRINTING_SUPPORTED */
...

Lesstif put this in Print.h , and the XInvest 2.6.9 expects it there I presume; or (also) likely it does not have PRINTING_SUPPORTED defined.

I need to go now, I'll keep you posted on my pursue of this venue.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#11

Then use Ubuntu 12.04 LTS as I already wrote in post #9.....

Can you help with this problem?

Provide an answer of your own, or ask Tom Peters for more information if necessary.

To post a message you must log in.