Before this will work, you must have installed EGSnrc (this is where the source for dosxyz_show is found). Go to the source for dosxyz_show, found in
cd $HEN_HOUSE/omega/progs/dosxyz_show/The only files present here are the Makefile (which holds the details needed by the compiler) and the .c file (which holds the code to be compiled). Like every good linux user, I tried running this on the command line as soon as I saw the Makefile:
makeIf everything were fine, this should work and then you are done installing dosxyz_show. Unfortunately for me, the following error chain was produced (I removed many lines from this output because it was too long!):
gcc -O2 -I/usr/X11R6/include -o /home/xxxxxx/HEN_HOUSE/bin/i686-pc-linux-gnu-/dosxyz_show -L/usr/X11R6/lib dosxyz_show.c -lXm -lXt -lX11 -lmdosxyz_show.c:46:22: error: Xm/XmAll.h: No such file or directorydosxyz_show.c:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘NoName_status’dosxyz_show.c:109: error...Looking at the first error:
Xm/XmAll.h: No such file or directory
It is clear that a library is missing. So I went to the NRC site for dosxyz_show and found that I needed to add the Motif libraries. The documentation recommended installing LessTif, an open-source equivalent. In fact, it is not equivalent (which can be validated by looking through the files in the package... some includes we will need are missing at least). A google search for the file name revealed a file listing for the package libmotif-dev. So we install that, naively assuming that it's the correct package:
Which can be solved by installing libxt-dev:
If you're using Ubuntu 10.04, you should end up with a new error! Progress!
sudo apt-get install libmotif-devI also noticed that the default paths in the Makefile were not appropriate for Ubuntu. In particular, we see this in the Makefile:
X11_include = -I/usr/X11R6/includeSearching for the directories listed above reveals that they do not exist. OK, lets set the paths correctly. Use these settings instead:
# On our system, Motif include files are in /usr/X11R6/include/Xm =>
# we don't need a separate -I for Motif. If this is different on your
# system, adjust accordingly.
Motif_include =
X11_libdir = -L/usr/X11R6/lib
# On our system, the Motif library is /usr/X11R6/lib =>
# we don't need a separate -L for Motif. If this is different on your
# system, adjust accordingly.
Motif_libdir =
X11_include = -I/usr/include/X11Now we compile again
# On our system, Motif include files are in /usr/X11R6/include/Xm =>
# we don't need a separate -I for Motif. If this is different on your
# system, adjust accordingly.
Motif_include =
X11_libdir = -L/usr/lib/X11
# On our system, the Motif library is /usr/X11R6/lib =>
# we don't need a separate -L for Motif. If this is different on your
# system, adjust accordingly.
Motif_libdir =
makeIf you're using Ubuntu 14.04, that may have been sufficient. However, I sometimes get the following error:
In file included from /usr/include/Xm/XmAll.h:33:0,
from dosxyz_show.c:34:
/usr/include/Xm/Xm.h:59:27: fatal error: X11/Intrinsic.h: No such file or directory
#include <X11/Intrinsic.h>
Which can be solved by installing libxt-dev:
sudo apt-get install libxt-dev
make
If you've added the environment variables suggested during the EGS install, the path to the executable should already be in your path (check this by trying to auto-complete dosxyz_show on the shell).
If you're using Ubuntu 10.04, you should end up with a new error! Progress!
gcc -O2 -I/usr/X11R6/include -o /home/xxxxxxx/HEN_HOUSE/bin/i686-pc-linux-gnu-/dosxyz_show -L/usr/X11R6/lib dosxyz_show.c -lXm -lXt -lX11 -lmIn file included from /usr/include/Xm/XmAll.h:46, from dosxyz_show.c:46:/usr/include/Xm/Xm.h:59:34: error: X11/extensions/Print.h: No such file or directoryIn file included from /usr/include/Xm/XmAll.h:46, from dosxyz_show.c:46:/usr/include/Xm/Xm.h:827: error: expected specifier-qualifier-list before ‘XPContext’In file included from /usr/include/Xm/XmAll.h:86, from dosxyz_show.c:46:/usr/include/Xm/Print.h:46...Identifying the first error:
X11/extensions/Print.h: No such file or directoryit is clear that my package installation didn't fully do the trick. Another google search for the error revealed that I can search for the packages containing a certain file using apt-file. So we set that up and look for our file (it may take a minute or so to update the apt-file index):
sudo apt-get install apt-file
sudo apt-file update
apt-file search X11/extensions/Print.h
x11proto-print-dev: usr/include/X11/extensions/Print.h
The search reveals that the file is in the x11proto-print-dev package. We install it:
sudo apt-get install x11proto-print-dev
and we try to build again, with complete success (nevermind all the warnings about fscanf):
gcc -O2 -I/usr/include/X11 -o /home/xbaker/staging/beamnrc/HEN_HOUSE/bin/i686-pc-linux-gnu-/dosxyz_show -L/usr/lib/X11 dosxyz_show.c -lXm -lXt -lX11 -lmdosxyz_show.c: In function ‘get_data’:dosxyz_show.c:1280: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result...
The binary executable produced by the compilation process must be made executable, and then you can run it:
cd $HEN_HOUSE/omega/progs/dosxyz_show
chmod u+x dosxyz_show
./dosxyz_show <EGSPHANT> <3DDOSE>
Done!