For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2005 > compile static binaries +opencobol









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author compile static binaries +opencobol
Cydrome Leader

2005-09-26, 6:55 pm

How does one compile static binaries with opencobol under FreeBSD? I don't
see any options to do this in the literature, and the resulting binaries
obviously will not function on other systems where the cobol libraries are
not installed. Error below is from trying to excute the result of "cobc
count.cbl" on a different system.

[host]user:~/cobol$ ./count
/usr/libexec/ld-elf.so.1: Shared object "libcob.so.1" not found, required
by "count"




clvrmnky

2005-09-26, 6:55 pm

On 26/09/2005 9:11 AM, Cydrome Leader wrote:
> How does one compile static binaries with opencobol under FreeBSD? I don't
> see any options to do this in the literature, and the resulting binaries
> obviously will not function on other systems where the cobol libraries are
> not installed. Error below is from trying to excute the result of "cobc
> count.cbl" on a different system.
>
> [host]user:~/cobol$ ./count
> /usr/libexec/ld-elf.so.1: Shared object "libcob.so.1" not found, required
> by "count"
>

That would be the run-time environment, I guess. The docs are thin, but
did you try:
<http://www.opencobol.org/modules/bw...2_2#content_1_1>

The variable COB_LDFLAGS should accept the right options to make static
libs, that you can then make into a library, or link to your app to make
a FreeBSD ELF executable.

If not, then perhaps the run-time environment does not support static
linking. I'd expect this to be in the OpenCOBOL docs somewhere.
Richard

2005-09-26, 6:55 pm

> How does one compile static binaries with opencobol
> under FreeBSD? I don't see any options to do this in
> the literature,


I don't know that you can create a static binary at all. You can use
-fstatic-call to incorporate your own called programs statically, but
not the underlying runtime.

> and the resulting binaries obviously will not function on
> other systems where the cobol libraries are not
> installed.


What is the problem with installing the runtime libraries on the target
machine ? Just install OpenCobol and then install your programs.

Cydrome Leader

2005-09-26, 6:55 pm

Richard <riplin@azonic.co.nz> wrote:
>
> I don't know that you can create a static binary at all. You can use
> -fstatic-call to incorporate your own called programs statically, but
> not the underlying runtime.
>
>
> What is the problem with installing the runtime libraries on the target
> machine ? Just install OpenCobol and then install your programs.


disk space is cheaper than the time it takes to install/remove/track/audit
programming environments on various machines.
Richard

2005-09-26, 9:55 pm

> disk space is cheaper than the time it takes to install/remove/track/audit
> programming environments on various machines.


Then build an RPM or PKG or whatever is used by the systems that you
want to target and have this install the libcobc and everything else
that is required as it installs your program.

OpenCobol may also require libdb, libltdl, libgpm, ncurses and much
else, and these will rely on libc and others and may require a specific
version. You may include checks in the RPM or PKG for all the required
libraries. You may even include RPM or PKG for these on your
distribution media.

Alternately you could purchase a Cobol implementation that takes care
of all these fiddling details for you, or at least has existing
solutions, but that will cost money.

If you write in Perl you need to ensure that there is a Perl system
installed, same with Python, Java, even C#, and these may need to be of
a specific version and/or have additional modules or packages
installed. OpenCobol is no different.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com