Makefile and Erlang

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Makefile and Erlang

Sean Hinde-2
Alexis,

A few things which might be of use..

After untarring you need to also move some files around and set up some
paths in other files.

The Install shell script embedded in the depths of the open source
distribution (erts/etc/unix) can be used for this (it does all sorts of
stuff including building start.boot files etc). I also attach my version
which is somewhat cut down from the full one but deals with a few other
things like setting up the IP address in my SNMP config files etc.

It also uses start.src from this directory which you can edit beforehand to
add any other fixed options you want such as -embedded etc

Usage is

./Install erl-root-dir release-vsn rel-file node-name

So for your case I guess it would be something like
./Install /home/otpuser../ 1 app1 nodename

If it doesn't run straight away in your environment it should give you some
idea of the sorts of things you need to do

Good luck,

Sean

> -----Original Message-----
> From: Alexis Le-Quoc [mailto:alexis]
> Sent: 27 January 2001 01:35
> To: erlang-questions
> Subject: Makefile and Erlang
>
>
> Hello,
>
> First of all, let me state the obvious, the more I use
> Erlang, the more
> impressed I am! I've been fiddling with the release tools and
> I find them
> absolutely useful.
>
> I'm stumbling on two problems:
>
> 1) I wrote a Makefile (for GNU make) which is about 3 lines long:
> all:
>         erl -noinput -make
>         echo "systools:make_tar(app1)." | erl -noshell
>
> The third line obviously never returns but produces the
> expected .tar.gz.
>
> It looks like:
> lib/app-1/...
> lib/kernel-.../...
> lib/sasl-.../...
> lib/stdlib-.../...
> releases/1/start.boot
>
> 2) Once I have that tarball, I un-tar it to my_directory and do a cd
> my_directory. Then I try erl -boot releases/1/start but it
> crashes since I
> suspect it does not find the appropriate *.beam files. I'm missing
> something here. Is is the {path, Path} trick in the .rel file?
>
> Thank you,
>
> -- Alexis
>



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.


 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Install
Type: application/octet-stream
Size: 3448 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20010129/3a35dafa/attachment.obj>

Reply | Threaded
Open this post in threaded view
|

Makefile and Erlang

Alexis Le-Quoc
Thank you Sean and Vance for your most helpful answers. The erlang
community is great!

I've read and read and read again the documentation about make_script and
make_tar. I've furthered my understanding a bit and I'd like to ask the
experts if the following is possible.

I've packaged my app in app1.tar.gz but a closer look at the start.script
makes me think that all paths are defined relative to $ROOT. I infer that
$ROOT is set by the 'erl' script and cannot be changed at run-time. I'd
like to change that path to something I choose.

The {variable, [{"TEST", "some_path"]} and {path, [...]} in
systools:make_script/2 put a $TEST in the boot script. Then, I un-tarred
the file to some place and ran:

erl -boot_var TEST `pwd`/lib -boot `pwd`/releases/1/start but it crashes
the VM, since it can't find the code. I set TEST to `pwd`/lib because the
$TEST variable appears followed by myapp-vsn/ebin in the script. To no
avail. I also tried to set TEST to the directory where I un-tarred
the package; it did not work either.

I took a look at the Install script that you sent and I'd like, for
testing purposes, not to copy the erl/erlc to the new directory. This
problem, overall, looks a bit like the classical java "CLASSPATH not set"
problem.

Maybe I should look into the code_server / loader documentation to clarify
this issue.

Alexis

On Mon, 29 Jan 2001, Sean Hinde wrote:

> Alexis,
>
> A few things which might be of use..
>
> After untarring you need to also move some files around and set up some
> paths in other files.
>
> The Install shell script embedded in the depths of the open source
> distribution (erts/etc/unix) can be used for this (it does all sorts of
> stuff including building start.boot files etc). I also attach my version
> which is somewhat cut down from the full one but deals with a few other
> things like setting up the IP address in my SNMP config files etc.
>
> It also uses start.src from this directory which you can edit beforehand to
> add any other fixed options you want such as -embedded etc
>
> Usage is
>
> ./Install erl-root-dir release-vsn rel-file node-name
>
> So for your case I guess it would be something like
> ./Install /home/otpuser../ 1 app1 nodename
>
> If it doesn't run straight away in your environment it should give you some
> idea of the sorts of things you need to do
>
> Good luck,
>
> Sean
>
> > -----Original Message-----
> > From: Alexis Le-Quoc [mailto:alexis]
> > Sent: 27 January 2001 01:35
> > To: erlang-questions
> > Subject: Makefile and Erlang
> >
> >
> > Hello,
> >
> > First of all, let me state the obvious, the more I use
> > Erlang, the more
> > impressed I am! I've been fiddling with the release tools and
> > I find them
> > absolutely useful.
> >
> > I'm stumbling on two problems:
> >
> > 1) I wrote a Makefile (for GNU make) which is about 3 lines long:
> > all:
> >         erl -noinput -make
> >         echo "systools:make_tar(app1)." | erl -noshell
> >
> > The third line obviously never returns but produces the
> > expected .tar.gz.
> >
> > It looks like:
> > lib/app-1/...
> > lib/kernel-.../...
> > lib/sasl-.../...
> > lib/stdlib-.../...
> > releases/1/start.boot
> >
> > 2) Once I have that tarball, I un-tar it to my_directory and do a cd
> > my_directory. Then I try erl -boot releases/1/start but it
> > crashes since I
> > suspect it does not find the appropriate *.beam files. I'm missing
> > something here. Is is the {path, Path} trick in the .rel file?
> >
> > Thank you,
> >
> > -- Alexis
> >




Reply | Threaded
Open this post in threaded view
|

Makefile and Erlang

Gunilla Arendt-3
Alexis Le-Quoc wrote:

 [snip]

> The {variable, [{"TEST", "some_path"]} and {path, [...]} in
> systools:make_script/2 put a $TEST in the boot script. Then, I un-tarred
> the file to some place and ran:
>
> erl -boot_var TEST `pwd`/lib -boot `pwd`/releases/1/start but it crashes
> the VM, since it can't find the code. I set TEST to `pwd`/lib because the
> $TEST variable appears followed by myapp-vsn/ebin in the script. To no
> avail. I also tried to set TEST to the directory where I un-tarred
> the package; it did not work either.

Alexis,

What you describe above (using a variable when generating
the script using systools:make_script/2 and setting its
value using -boot_var `pwd`/lib) is perfectly correct and
should work. Are you sure the value of TEST="some directory"
is correct? What happens when you try to start erl, what
error messages do you get? Is the application sasl included
in your .rel-file? If not, add it, as it will generate more
printouts when starting Erlang that might be useful for
debugging.

Note also that systools:make_tar is primarily intended for
building a tar file that is used to upgrade an already
existing system.

/ Gunilla