gnupic: Confirmation 'ebs_cc' runs under Red Hat 7.1
Subject:
Re: Confirmation 'ebs_cc' runs under Red Hat 7.1
From:
Scott Dattalo ####@####.####
Date:
23 Dec 2001 05:26:19 -0000
Message-Id: <Pine.LNX.4.33.0112222106120.25535-100000@ruckus.brouhaha.com>
On Sat, 22 Dec 2001, tma wrote:
> Greetings:
>
> Thanks to those for replying to my question about running the
> 'ebs_cc' compiler under RH 7r1. With the confidence that it should run
> OK I decided to give it a try and now I am pleased to say I have it running.
<snip>
Tom,
This example is instructive to new users,. Let me add a coupld of
comments that may help out.
>
>
> =========================================================================
>
> The procedure I followed for the installation was as follows:
>
> 1) Starting in the '/opt' directory with the KDE File Manager I
> sequentially created the subdirectory branch titled '/opt/pic/c/ebs/bin'
> to provide unique locations for the 'ebs_cc' files.
In general, you should place tar balls such as these in a directory off of
your home directory. I put of my PIC stuff in ~/gnupic/. (The ~ is a short
cut way of expressing the path to your home directory.)
>
>
> 2) I moved the ebs_cc.tar.gz download file into the 'ebs' subdirectory.
>
> Note: The following commands (given in steps 3-6 below) were ran within
> a 'bash' shell terminal session from the 'ebs' directory prompt.
>
> 3) I ran 'gunzip ebs_cc.tar.gz' which created the 'ebs_cc.tar' file
> without any error reports.
>
>
> 4) I ran 'tar -xvf ebs_cc.tar' which extracted the 'ebs_cc' files and
> placed them in the 'ebs' subdirectory.
In the future, you can gunzip and tar in one step:
tar -xvzf ebs_cc.tar.gz
Note that the 'v' means verbose and will list the files as they're
extracted.
>
>
> 5) I ran 'make' which produced the following 'gcc' compiler report:
>
> gcc -Daux -g -o mypicc main.o codepic.o expr.o function.o sym.o stmt.o
> while.o gen.o error.o io.o lex.o primary.o preproc.o data.o
>
> 6) I ran 'dir' which provided the following files list:
>
> 16c84.h ebs_cc.tar gen.c main.c
> preproc.o sym.o 16f870.h ee_read.c
> gen.o main.o mary.c test0.c
> 16f87x.h ee_write.c getchar.c Makefile
> primary.o test.c codepic.c error.c
> glibpic.h Readme while.c codepic.o
> error.o io.c mlibpic.h rtest.c
> while.o data.c expr.c io.o
> mypicc slibpic.h data.h expr.o
> lcd_lib.c P16FXXX.inc stdio.h data.o
> lex.c pic_io.c stmt.c defs.h
> function.c lex.o pic_temp.c stmt.o
> function.o libpic.h preproc.c sym.c
>
> 7) I moved the 'mypicc' executable file to the previously created
> '/opt/pic/c/ebs/bin' subdirectory.
>
> Note: The following commands (given in steps 7-11 below) were ran within
> a 'bash' shell terminal session from the 'bin' directory prompt.
>
> 8) I ran 'file mypicc' from the 'bin' directory prompt and got the
> following report:
>
> mypicc: ELF 32-bit LSB executable, Intel 80386, version 1,
> dynamically linked (uses shared libs), not stripped
>
>
> 9) I then tried to run 'mypicc' from the 'bin' subdirectory and got the
> following bash unknown path report:
>
> bash: mypicc: command not found
Rather than polluting my path variable, I typically will place a symbolic
link in ~/bin/ (which should be in your path). For example, in gpsim
development I often test the program before installing it. The executable
after the make is located in ~/gnupic/gpsim/gpsim/ and is called gpsim. So
I do this:
cd ~/bin
ln -s /home/scott/gnupic/gpsim/gpsim/gpsim g
The 'ln' means link, and the -s means symbolic. Now I can type 'g' and run
the newly built copy of gpsim.
<snip>
> ======================================================================
>
> If anyone spots a problem or has suggested improvements for
> this procedure please send me an email directly and/or post some
> feedback on this mailing list.
>
> My confidence is low about step 11 as I went back and found I could run
> 'mypicc' without the './' prefix with the '.bash_profile' file deleted.
> The following questions come to mind:
>
> a) I wonder if 'opt/pic/c/ebs/bin' should be appended to the PATH
> statement within the .bash_profile file in the user's HOME directory?
I wouldn't do it.
>
> b) Is it OK to create a .bash_profile file with a new PATH statement in
> the 'bin' containing the 'mypicc' executable file?
Sure.
>
> c) I wonder why the './' prefix was needed although I was already at the
> 'bin' prompt where 'mypicc' is located? This seems to differ from DOS
> where one can execute a file without the need to specify the path when
> launching from the subdirectory containing the file to be executed.
Chances are the path was not what you expected.
>
> d) Does the use of the /opt directory for my PIC software comply with the
> Linux directory structure plan?
Right now, the RPMs get installed in /usr/share while the tarballs get
installed in user /usr/local (by default).
Thanks for taking the time to go through all of this Tom.
BTW, If you got ebs_cc working and you're really happy, and you really
want to stay in the holiday spirit, then don't look at the code it
generates. I promise it will make you spew turkey all over your keyboard!
Scott