how to compile a pop11 program? 
Author Message
 how to compile a pop11 program?

Hello
I am less than a beginner with pop11. In fact before starting I need the
answer to this simple but important (to me) question:
Can a pop file be compiled in a standalone program ( I mean a program
that run without pop11 being installed)?
If it possible , how can i do that?
I downloaded a lot of docs, and the books available on line , but I
didin't find  this help.
Sorry for my bad english
and thank you in advance
Marcello


Tue, 04 Nov 2003 02:46:12 GMT  
 how to compile a pop11 program?

Quote:

> Date: Thu, 17 May 2001 20:46:12 +0200

> Hello
> I am less than a beginner with pop11. In fact before starting I need the
> answer to this simple but important (to me) question:
> Can a pop file be compiled in a standalone program ( I mean a program
> that run without pop11 being installed)?
> If it possible , how can i do that?

In principle you can do it by re-building a version of the core
poplog system which includes your program and all the system
components that are required by your program.

This is not worth trying unless you are an experienced Pop-11
programmer.

The next best thing is to use the technique employed to produce
most of the usable versions of Poplog, e.g. pop11, common lisp,
prolog, poplog ML, etc. Namely you use your program source to
create a saved image myprog.psv then run it as
    pop11 +myprog

or if you are using a more restricted subset of pop11,

    basepop11 +myprog

You can of course, produce a little package which includes
the files required and then a shell script to start it all
up, so that to the user it looks like a single program.

If you are thinking of producing something that you want to
distribute to others, you will have to make sure that you include
whatever files are needed at run time. This can be a tiny subset
of the poplog system, but it may require more files than you
expect, because of the information pop-11 requires at run time.

Whether this will do what you want or not is impossible to tell
unless you specify the end requirement in more detail. That is the
method that has been used by several commercial users of poplog.

If I have not answered the question, try describing the proposed
application.

Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK

PAPERS: http://www.cs.bham.ac.uk/research/cogaff/
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html



Tue, 04 Nov 2003 07:26:15 GMT  
 how to compile a pop11 program?

Quote:

> Can a pop file be compiled in a standalone program ( I mean a program
> that run without pop11 being installed)?
> If it possible , how can i do that?
> I downloaded a lot of docs, and the books available on line , but I
> didin't find  this help.

Have you run across HELP POPC and REF POPC?  They might give you an idea
of what is possible.

Good luck.

Stephen Isard



Tue, 04 Nov 2003 19:18:29 GMT  
 how to compile a pop11 program?

Quote:

> Can a pop file be compiled in a standalone program ( I mean a program
> that run without pop11 being installed)?

I have done a small experiment.  I wrote a file called junk.p containing
the lines

define constant procedure junk;
'hello world'=>
enddefine;

On a linux system with poplog installed, I gave the command:

popc -e junk junk.p

A file named a.out was created, which I transferred to another linux
machine with no poplog files on it.

I ran a.out on the machine with no poplog installed and it printed

** hello world

So there is hope for you, but I don't know what problems you might
encounter in trying to scale up from my tiny program.  By the way, the
size of a.out was 569600 bytes, so it evidently contains a certain
amount of the pop system within it.

Stephen Isard



Wed, 05 Nov 2003 01:07:14 GMT  
 how to compile a pop11 program?

Quote:


> > Can a pop file be compiled in a standalone program ( I mean a program
> > that run without pop11 being installed)?

> I have done a small experiment.  I wrote a file called junk.p containing
> the lines
>...
> On a linux system with poplog installed, I gave the command:

> popc -e junk junk.p

> A file named a.out was created, which I transferred to another linux
> machine with no poplog files on it.

> I ran a.out on the machine with no poplog installed and it printed

> ** hello world

> So there is hope for you, but I don't know what problems you might
> encounter in trying to scale up from my tiny program. ...

Thank you for both your answer.
So, is this a non common techniche ?
Did anyone else use it?

As for the other lecture you suggest me, no I didn't read them yet. I
suppose I can get from the pop website. I'll download them.
Thank you again and sorry for my poor English :I'm answering on line too
:-(
Bye
Marcello



Wed, 05 Nov 2003 05:58:24 GMT  
 how to compile a pop11 program?

Quote:


>....
> If you are thinking of producing something that you want to
> distribute to others,....

> If I have not answered the question,

You did , thank you
Marcello


Wed, 05 Nov 2003 05:50:26 GMT  
 how to compile a pop11 program?

...

Quote:
> > popc -e junk junk.p

...

Quote:
> So, is this a non common techniche ?
> Did anyone else use it?

I don't know the answer to that.  I've never before used it myself.  My
guess is that it was provided for people who wanted to develop programs
in poplog and distribute them to non-poplog users, but it's just a
guess.

Quote:
> As for the other lecture you suggest me, no I didn't read them yet. I
> suppose I can get from the pop website. I'll download them.

Sorry, I was assuming you already had a poplog system.  The files I
mentioned are in pop/help/popc and pop/ref/popc in the poplog v15.53 tar
distributions.  Once you have installed poplog, they are in
$usepop/pop/help/popc and $usepop/pop/ref/popc, and if you are in the
ved editor you can read them with the commands
ENTER help popc
ENTER ref popc

Of course you can also read them in the same way you would read any
ascii file, but you may run across some extra graphics characters that
are meant to be treated specially by ved.

Stephen Isard



Fri, 07 Nov 2003 19:26:16 GMT  
 how to compile a pop11 program?

Quote:


> ...
> > > popc -e junk junk.p
> ...

I got this:
popc -e junk junk.p
;;; MISHAP - SAVED IMAGE NOT FOUND
;;; INVOLVING:  'e.psv'
;;; DOING    :

then I tried
popc junk.p
and I got no output at all (no messages, no file a.out)
and at last I tried
popc -junk.p (even if I supposed it shouldn't work)
and I got
;;; MISHAP - ERROR READING SAVED IMAGE (premature end-of-file)
;;; INVOLVING:  '/home/marcello/learn/pop/junk.p'
;;; DOING    :

Quote:
> >...
> Sorry, I was assuming you already had a poplog system.  The files I
> mentioned are in pop/help/popc and pop/ref/popc in the poplog v15.53 tar
> distributions.  Once you have installed poplog, they are in
> $usepop/pop/help/popc and $usepop/pop/ref/popc, and if you are in the
> ved editor you can read them with the commands
> ENTER help popc
> ENTER ref popc

What do you mean with "ENTER" here?
I guess you don't mean "upper case 'enter' " , nor just "push button
enter on the keybord", so, what ? I found this expression in the docs
too, but I can't understant it.

Thank you for your patience
Marcello



Sun, 09 Nov 2003 02:40:55 GMT  
 how to compile a pop11 program?

Quote:

> > > > popc -e junk junk.p
> > ...
> I got this:
> popc -e junk junk.p
> ;;; MISHAP - SAVED IMAGE NOT FOUND
> ;;; INVOLVING:  'e.psv'
> ;;; DOING  

That's strange.  I can produce that error message with the command

pop11 -e junk junk.p

Maybe your system hasn't been fully installed or you haven't set up your
environment variables.   Check to see whether you have the environment
variables usepop and popsys defined by doing

echo $usepop
echo $popsys

Usepop should be set to the directory in which you untarred the poplog
tar file.  Popsys should be the same as $usepop/pop/pop.

If usepop isn't defined, do

export usepop=<directory name>  (assuming the bash shell)

If usepop is defined and popsys is not, do

. $uspop/pop/com/poplog.sh  (still assuming bash)

(You will want to have those lines in a setup file, perhaps your
.bashrc, if you plan to use poplog regularly.)

If they are both defined, is there a file in $popsys/popc.psv?  If not,
get it from the tar file.  Maybe you should re-extract the tar file
altogether, just to be safe.

Quote:
> What do you mean with "ENTER" here?

You need to read some ved documentation.  Try veduserguide or vedmanual
in the directory $usepop/pop/doc.

Quote:
> I guess you don't mean "upper case 'enter' " , nor just "push button
> enter on the keybord", so, what ?

Yes, it means "press the ENTER key in the lower right corner of the
numeric keypad (the square array of keys that appears at the right of
(many, most, all?) standard keyboards).  The effect will be that your
cursor will move to the ved "command line" at the top of the file.

Stephen Isard



Sun, 09 Nov 2003 18:19:30 GMT  
 how to compile a pop11 program?
Steve,

| > popc -e junk junk.p
| > ;;; MISHAP - SAVED IMAGE NOT FOUND
| > ;;; INVOLVING:  'e.psv'
| > ;;; DOING
|
| That's strange.  I can produce that error message with the command
|
| pop11 -e junk junk.p

The problem is that popc is a link to basepop11 as is pop11, etc. in
        $popsys

So if you give a command of the form

        popc ....

then that will be equivalent to

        basepop11 ....

UNLESS you have defined the environment variable $pop_popc to tell
basepop11 that it should do something different, e.g. run a
saved image.

By default several environment variables are set up when you source

        $usepop/pop/com/poplog
or
        $usepop/pop/com/poplog.sh

See also these, which are invoked by the above
        $popsys/popenv
        $popsys/popenv.sh

In the files
        $usepop/pop/com/popenv
        $usepop/pop/com/popenv.sh

which are also invoked by the poplog and poplog.sh files, respectively,
you'll find that $pop_popc is set to have the value:

        "+$popsys/popc.psv"

This means that the command

        popc ...

is equivalent to

        basepop11 +$popsys/popc.psv ....

That longer version can be typed in explicitly instead, if the
environment variable pop_popc has not been set.

But that is probably an indication that other environment variables have
not yet been set, so something else may fail (e.g. requiring
$popexternlib ??)

We have previously had lengthy discussions in this forum on the need to
replace the mechanism that depends on all the scripts defining
environment variables before you can run an executable.

It is not conceptually difficult to think of ways of replacing this with
a mechanism that reads some startup files instead, e.g.

in the system
        $usepop/pop/poplog_defaults

or user files:
        ~/.poplog_defaults

The question is (a) what would be a really good way to do this and
(b) finding the time to do it.

I think Steve Leach may already have thought about this in great detail.

Aaron



Sun, 09 Nov 2003 18:56:08 GMT  
 how to compile a pop11 program?

Quote:

> The problem is that popc is a link to basepop11 as is pop11, etc. in
>         $popsys

Nitpicking correction: On this solaris machine, I find it linked to
corepop (as opposed to corepop11), together with poplink and poplibr.
However, in a linux motif tar file that I've got here, I find it not
linked to anything, although it is the same size as corepop, poplink and
poplibr.  Maybe I've somehow messed up that tar file.  If anyone has
quick access to a pristine linux tar file, perhaps they could check.

Quote:
> We have previously had lengthy discussions in this forum on the need to
> replace the mechanism that depends on all the scripts defining
> environment variables before you can run an executable.

Yes, I wasn't really paying attention at the time, but I gave the
problem a little bit of thought for purposes of my mini-distribution -
enough to see that it really was a problem and I wasn't going to solve
it instantly.

Steve



Sun, 09 Nov 2003 20:01:59 GMT  
 how to compile a pop11 program?
[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]


Quote:
> Date: Wed, 23 May 2001 13:01:59 +0100
> ...

> > The problem is that popc is a link to basepop11 as is pop11, etc. in
> >         $popsys

Steve commented:

Quote:
> Nitpicking correction: On this solaris machine, I find it linked to
> corepop (as opposed to corepop11), together with poplink and poplibr.

That is correct. I had forgotten that basepop11 is (normally) the
full poplog executable which includes the editor, links to X
libraries, etc., whereas the system tools for rebuilding poplog
are based on a smaller simpler executable.

Saved images are built on top of basepop11 for all the standard
"user" poplog systems, pop11, xved, prolog, clisp, pml, etc.

However, if you are rebuilding poplog, e.g. recompiling the sources
in order to rebuild basepop11, or porting poplog to a new platform,
you may need something with fewer dependencies, and poplog is
usually distributed with a minimal executable, which is normally

    $popsys/corepop

There are some saved images built on top of that created by
    $popsrc/mknewpop
        creates newpop.psv
    $popsrc/mksyscomp
        depending on argumetns supplied creates one or more of
            popc.psv, poplibr.psv, poplink.psv

The source files used to create these system building saved images
are in $popsrc/syscomp  and will vary from one poplog version to
another (e.g. since on different hardware platforms the poplog
virtual machine compilers have to be different).

There may possibly also be

    $popsys/corepop11

which could be an older version that was used to create corepop.
Or corepop may have been created by copying corepop11 and then
running "strip corepop" to reduce size.

Originally in $popsys, the files popc, poplibr, poplink, and newpop
were hard links to corepop. When I had to rebuild the binaries for
linux poplog about a year ago (for redhat 6) I made them all
symbolic links, which simplifies changes (e.g. you can rename a new
corepop instead of having to copy it.) I don't know why hard links
were originally used.

There is a lot more on all of this in the files in
    http://www.cs.bham.ac.uk/research/poplog/sysdoc/

especially
    http://www.cs.bham.ac.uk/research/poplog/sysdoc/rebuilding

All the sysdoc files are also downloadable in
    http://www.cs.bham.ac.uk/research/poplog/sysdoc.tar.gz

A script for rebuilding these system images originally written by
Michael Worsely and Praxis Ltd, is here:

    http://www.cs.bham.ac.uk/research/poplog/tools/relinking.linux.poplog

Seeing how the executables and saved images are created may explain
more clearly what is there and why!

Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK

PAPERS: http://www.cs.bham.ac.uk/research/cogaff/
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html



Sun, 09 Nov 2003 22:04:44 GMT  
 how to compile a pop11 program?

Quote:

> > ...
> > > > popc -e junk junk.p
> > ...

> I got this:
> popc -e junk junk.p
> ;;; MISHAP - SAVED IMAGE NOT FOUND
> ;;; INVOLVING:  'e.psv'
> ;;; DOING    :

As a beginner also, let me offer a beginners-view:
 from your output, apparently you've got poplog running.
 poplog's  tutoring material is integrated into the system.
 it is not intended nor advisable to ignore the quite well though out
    tutoring material.
 It's not a C or Pascal compiler.

Quote:
> then I tried
> popc junk.p
> and I got no output at all (no messages, no file a.out)
> and at last I tried
> popc -junk.p (even if I supposed it shouldn't work)
> and I got
> ;;; MISHAP - ERROR READING SAVED IMAGE (premature end-of-file)
> ;;; INVOLVING:  '/home/marcello/learn/pop/junk.p'
> ;;; DOING    :

> What do you mean with "ENTER" here?
> I guess you don't mean "upper case 'enter' " , nor just "push button
> enter on the keybord", so, what ? I found this expression in the docs
> too, but I can't understant it.

The meaning of "ENTER" needs to be understood *very early* in your
journey into poplog.  It is explained in the early tutor(s).

For my setup "ENTER" is obtained by: <Ctrl> g
The keyboard mapping is (in my opinion too) flexible.
"ENTER" {a most basic/essential operation} enters the command line;
 further keystrokes are echoed on the command line (at the top of your
 active window) until you terminate the command string with <enter/CR>.

I really think it's unrealistic for you to want to build stand-alone poplog
program(s), until you become more familiar with how the designers
intended the system to be used.

Chris Glur.



Sun, 09 Nov 2003 22:17:40 GMT  
 how to compile a pop11 program?

Quote:


> > > > > popc -e junk junk.p
> > > ...
> > I got this:
> > popc -e junk junk.p
> > ;;; MISHAP - SAVED IMAGE NOT FOUND
> > ;;; INVOLVING:  'e.psv'
> > ;;; DOING  

>...
> Maybe your system hasn't been fully installed or you haven't set up your
> environment variables.  ....

> If usepop is defined and popsys is not,

so it was, but even after I 've defined popsys I get the same messages.

Quote:

> If they are both defined, is there a file in $popsys/popc.psv?  

Yes, there is.

Thank you again
Marcello



Tue, 11 Nov 2003 07:36:32 GMT  
 how to compile a pop11 program?

Quote:

> > If usepop is defined and popsys is not,
> so it was, but even after I 've defined popsys I get the same messages.

As Aaron pointed out in his message, there could be other environment
variables involved, like pop_popc.  You should do

. $usepop/pop/com/poplog.sh

to be sure you have them all defined.

Stephen Isard



Wed, 12 Nov 2003 00:53:15 GMT  
 
 [ 16 post ]  Go to page: [1] [2]

 Relevant Pages 

1. PROPEL 0.2+ (pop11 for windows) (pop11 4 windows)

2. running unix program from pop11

3. running unix program from pop11 (PS)

4. Program compiled with pgf77 uses location of program as default directory

5. Defining Pop11 (Was: Re: Threaded Interpretive Languages)

6. Pop11 for OpenVMS?

7. Macintosh implementations of Poplog or Pop11

8. Macintosh implementations of Poplog or Pop11

9. Mouse Button Handling in Pop11

10. Windows and Unix POP11 compatability

11. optimising code in Pop11

12. Using other languages within POP11

 

 
Powered by phpBB® Forum Software