Hello, I'm trying to use Gnu Cobol on Ubuntu 22.04.2 LTS (actually installed under WSL).
I'm (initially) running the version of Gnu Cobol that comes with that, and "apt-cache show gnucobol" returns "Version: 5".
"cobc -v" says:
cobc (GnuCOBOL) 3.1.2.0
Built Sep 14 2021 19:23:38 Packaged Dec 23 2020 12:04:58 UTC
C version "11.2.0"
loading standard configuration file 'default.conf'
cobc: error: no input files
I'm trying to follow https://gnucobol.sourceforge.io/doc/gnucobol.html and all seems to be working fine until I get to "hello-dynamic3.c". The C compiler objects to "cob_call_with_exception_check":
ajt10.c:22:9: warning: implicit declaration of function ‘cob_call_with_exception_check’ [-Wimplicit-function-declaration]
22 | ret = cob_call_with_exception_check ("ajt09", 2, cob_argv);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(but has no problems if I replace that with a regular "cob_call").
mentions a "new function to call COBOL from C that won't exit the program in case of runtime errors or STOP RUN: cob_call_with_exception_check()", so I presume that "gnucobol.html" is actually for 3.2 (due out any time now I guess); it'd be great if it said so at the top of the file.
Nice to see that Ubuntu got its package version 5 clean.
Yes, that's a 3.2 function and building from the rc2 is reasonable. Please see DEPENDENCIES to know about what packages you need to do so (if you don't need ISAM then just use --without-db).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks - "./configure --without-db" does continue beyond where it stops previously, "make" and "sudo make install" also do do something and "cobc" et al appear in /usr/local/bin as expected.
Unfortunately, "cobc -v" just gives "cobc: symbol lookup error: cobc: undefined symbol: cob_get_sig_name".
Last edit: Andy Townsend 2023-03-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm adjusting the libtool versioning which should "solve" that (saying it doesn't find libcob) with the next tag (=release or rc3).
Very likely you do not have /usr/local/lib in your LD_LIBRARY_PATH, you may consider to either add that or go for a hard wired path by re-configure with LDFLAGS="-Wl,-rpath,/usr/local/lib", then run make and install again.
As usual the distro's tend to have OLD versions of gnucobol, i.e., from
2020, [like many other packages] so I would recommend you download
version v3.2 rc-2 from SF at https://sourceforge.net/projects/gnucobol/files/gnucobol/3.2/
or via Arnold Trembley website/s and install it having un-installed the
version you have.
I am not saying that the problem is resolved but it is better to be
using a current version of the compiler and not one over two years old.
Vince
On 28/02/2023 17:38, Andy Townsend wrote:
Hello, I'm trying to use Gnu Cobol on Ubuntu 22.04.2 LTS (actually
installed under WSL).
I'm (initially) running the version of Gnu Cobol that comes with that,
and "apt-cache show gnucobol" returns "Version: 5".
"cobc -v" says:
cobc (GnuCOBOL) 3.1.2.0
Built Sep 14 2021 19:23:38 Packaged Dec 23 2020 12:04:58 UTC
C version "11.2.0"
loading standard configuration file 'default.conf'
cobc: error: no input files
I'm trying to follow https://gnucobol.sourceforge.io/doc/gnucobol.html
and all seems to be working fine until I get to "hello-dynamic3.c".
The C compiler objects to "cob_call_with_exception_check":
ajt10.c:22:9: warning: implicit declaration of function
‘cob_call_with_exception_check’ [-Wimplicit-function-declaration]
22 | ret = cob_call_with_exception_check ("ajt09", 2, cob_argv);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(but has no problems if I replace that with a regular "cob_call").
mentions a "new function to call COBOL from C that won't exit the
program in case of runtime errors or STOP RUN:
cob_call_with_exception_check()", so I presume that "gnucobol.html" is
actually for 3.2 (due our any time now I guess); it'd be great if it
said so at the top of the file.
reposting notes from @vcoen, lost here because the question was posted multiple times and the duplicate that hang in the moderation que was later lost:
You need to install the DEPENDENCIES but here is the snap shot of that
file :
GnuCOBOL REQUIRES one of the following external libraries to be installed
for implementation of decimal arithmetic:
Berkeley DB is distributed under Oracles own open-source license.
Note that if you linked your software with Berkeley DB,
you must distribute the source code of your software along with your
software, or you have to pay royalty to Oracle.
o cJSON >= 1.3.0 - https://github.com/DaveGamble/cJSON
Note: As an alternative of an installed version you may place
cJSON.c and cJSON.h under "libcob" to include the used functions
directly in the COBOL runtime.
YOU MUST ALWAYS include the -dev or -devel package elements as well.
Vincent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-03-02
You need to install the DEPENDENCIES
With respect, it's 2023, and package managers have been a thing now for many years.
Nothing in that list says what packages I need to install. A quick web search for the first one suggests that for my OS it's probably https://packages.ubuntu.com/source/jammy/gmp . I really don't want to do that manually for everything listed in a text file.
In my example I had rather hoped that ./configure would tell me what I actually needed to do rather than just emit "configure: error: Berkeley DB db.h is missing, you may adjust BDB_CFLAGS". At the point where this error is generated my OS is known so details of packages for the available choices would be really useful along with the (very relevant) licence information contained in "DEPENDENCIES". In terms of package manager coverage I'd have thought that Debian/Ubuntu (apt), Redhat (yum) and Windows (chocolatey) would cover most eventualities.
No problem, just use what the package manager provides checking the docs installed along (all of those above should have the manual installed, possibly in multiple formats). You won't have the "with_exception_check" in there, but other options (for all but the abort case) :-)
It isn't reasonable to add a note what to install, because it is too different, take just the list you have - and you won't have the same names and not the same way to install. Then add that people sometimes install software on their own, so those would also have to been taken care. Then possibly have a look at something like the note how to install GnuCOBOL from source [7c6b048b95] (that's 3.2RC2 along with several OS, some of which you may not know of - at least they are far away from your list). Ubuntu is covered there, too.
Hello, I'm trying to use Gnu Cobol on Ubuntu 22.04.2 LTS (actually installed under WSL).
I'm (initially) running the version of Gnu Cobol that comes with that, and "apt-cache show gnucobol" returns "Version: 5".
"cobc -v" says:
cobc (GnuCOBOL) 3.1.2.0
Built Sep 14 2021 19:23:38 Packaged Dec 23 2020 12:04:58 UTC
C version "11.2.0"
loading standard configuration file 'default.conf'
cobc: error: no input files
I'm trying to follow https://gnucobol.sourceforge.io/doc/gnucobol.html and all seems to be working fine until I get to "hello-dynamic3.c". The C compiler objects to "cob_call_with_exception_check":
ajt10.c:22:9: warning: implicit declaration of function ‘cob_call_with_exception_check’ [-Wimplicit-function-declaration]
22 | ret = cob_call_with_exception_check ("ajt09", 2, cob_argv);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(but has no problems if I replace that with a regular "cob_call").
https://sourceforge.net/projects/gnucobol/files/gnucobol/3.2/
mentions a "new function to call COBOL from C that won't exit the program in case of runtime errors or STOP RUN: cob_call_with_exception_check()", so I presume that "gnucobol.html" is actually for 3.2 (due out any time now I guess); it'd be great if it said so at the top of the file.
I did try and get 3.2 RC2 locally - the text at the top of:
https://sourceforge.net/p/gnucobol/code/HEAD/tree/tags/gnucobol-3.2-rc2/
suggests
"svn checkout svn://svn.code.sf.net/p/gnucobol/code/trunk gnucobol-code"
which sounds wrong, and anyway does not work because "configure" (mentioned in https://sourceforge.net/p/gnucobol/code/HEAD/tree/tags/gnucobol-3.2-rc2/INSTALL ) is missing.
I can however download gnucobol-3.2-rc2.tar.bz2 from https://sourceforge.net/projects/gnucobol/files/gnucobol/3.2/
Running ./configure there gives this error:
configure: error: Berkeley DB db.h is missing, you may adjust BDB_CFLAGS
What does that actually mean?
Last edit: Andy Townsend 2023-02-28
Nice to see that Ubuntu got its package version 5 clean.
Yes, that's a 3.2 function and building from the rc2 is reasonable. Please see DEPENDENCIES to know about what packages you need to do so (if you don't need ISAM then just use --without-db).
Thanks - "./configure --without-db" does continue beyond where it stops previously, "make" and "sudo make install" also do do something and "cobc" et al appear in /usr/local/bin as expected.
Unfortunately, "cobc -v" just gives "cobc: symbol lookup error: cobc: undefined symbol: cob_get_sig_name".
Last edit: Andy Townsend 2023-03-02
I'm adjusting the libtool versioning which should "solve" that (saying it doesn't find libcob) with the next tag (=release or rc3).
Very likely you do not have /usr/local/lib in your LD_LIBRARY_PATH, you may consider to either add that or go for a hard wired path by re-configure with LDFLAGS="-Wl,-rpath,/usr/local/lib", then run make and install again.
Indeed! Thanks.
As usual the distro's tend to have OLD versions of gnucobol, i.e., from
2020, [like many other packages] so I would recommend you download
version v3.2 rc-2 from SF at
https://sourceforge.net/projects/gnucobol/files/gnucobol/3.2/
or via Arnold Trembley website/s and install it having un-installed the
version you have.
For Arnold's url https://www.arnoldtrembley.com/GnuCOBOL.htm
I am not saying that the problem is resolved but it is better to be
using a current version of the compiler and not one over two years old.
Vince
On 28/02/2023 17:38, Andy Townsend wrote:
reposting notes from @vcoen, lost here because the question was posted multiple times and the duplicate that hang in the moderation que was later lost:
You need to install the DEPENDENCIES but here is the snap shot of that
file :
GnuCOBOL REQUIRES one of the following external libraries to be installed
for implementation of decimal arithmetic:
BOTH runtime AND development components required.
o GNU MP (libgmp) 4.1.2 or later
https://gmplib.org
OR
o MPIR (libgmp - MPIR gmp-compat) 1.3.1 or later
(preferred when compiling on Windows with other compilers than GCC)
http://mpir.org
GNU MP and MPIR are distributed under GNU Lesser General Public
License.
NOTE
Please ALWAYS use the distro package whenever possible !!
See NOTE above.
o GNU Libtool (libltdl)
https://www.gnu.org/software/libtool/libtool.html
libltdl is used to implement dynamic CALL statements.
GNU Libtool is distributed under GNU Lesser General Public License.
The following libraries ARE required WHEN :
1) Indexed-Sequential file I/O (ISAM) is used
BOTH runtime AND development components required.
One of the following:
o Berkeley DB (libdb) 4.1 or later
https://www.oracle.com/
https://www.oracle.com/technology/products/berkeley-db/db/index.html
Berkeley DB is distributed under Oracles own open-source license.
Note that if you linked your software with Berkeley DB,
you must distribute the source code of your software along with your
software, or you have to pay royalty to Oracle.
o VBISAM - ISAM file handler (libvbisam) 2.0 or later
https://sourceforge.net/projects/vbisam/
VBISAM is distributed under GNU Lesser General Public License.
o DISAM File handler (libdisam)
http://www.isamcentral.com
DISAM is distributed under the proprietary License
"Byte Designs Ltd. DISAM Software License".
2) SCREEN SECTION and/or extended ACCEPT/DISPLAY is used
BOTH runtime AND development components required.
One of the following:
o Ncurses (ncurses or ncursesw) 5.2 or later
https://www.gnu.org/software/ncurses/ncurses.html
Ncurses is distributed under a BSD style license.
o PDCurses (pdcurses) for MinGW/native windows ports
https://pdcurses.org/ or https://github.com/Bill-Gray/PDCursesMod/
PDCurses is distributed as Public Domain.
o Unix curses
3) XML runtime support is used
BOTH runtime AND development components required.
libxml2 - http://xmlsoft.org
libxml2 is distributed under MIT License.
4) JSON runtime support is used
BOTH runtime AND development components required.
One of the following:
o cJSON >= 1.3.0 - https://github.com/DaveGamble/cJSON
Note: As an alternative of an installed version you may place
cJSON.c and cJSON.h under "libcob" to include the used functions
directly in the COBOL runtime.
cJSON is distributed under MIT License.
o JSON-C >= 0.12 - https://github.com/json-c/json-c
JSON-C is distributed under Expat License.
YOU MUST ALWAYS include the -dev or -devel package elements as well.
Vincent
With respect, it's 2023, and package managers have been a thing now for many years.
Nothing in that list says what packages I need to install. A quick web search for the first one suggests that for my OS it's probably https://packages.ubuntu.com/source/jammy/gmp . I really don't want to do that manually for everything listed in a text file.
In my example I had rather hoped that ./configure would tell me what I actually needed to do rather than just emit "configure: error: Berkeley DB db.h is missing, you may adjust BDB_CFLAGS". At the point where this error is generated my OS is known so details of packages for the available choices would be really useful along with the (very relevant) licence information contained in "DEPENDENCIES". In terms of package manager coverage I'd have thought that Debian/Ubuntu (apt), Redhat (yum) and Windows (chocolatey) would cover most eventualities.
Until 3.2 is released I'll likely still continue with the latest packaged version (except perhaps on Windows, where recent changes to https://arnoldtrembley.com/GnuCOBOL.htm have broken https://community.chocolatey.org/packages/gnucobol ).
No problem, just use what the package manager provides checking the docs installed along (all of those above should have the manual installed, possibly in multiple formats). You won't have the "with_exception_check" in there, but other options (for all but the abort case) :-)
It isn't reasonable to add a note what to install, because it is too different, take just the list you have - and you won't have the same names and not the same way to install. Then add that people sometimes install software on their own, so those would also have to been taken care. Then possibly have a look at something like the note how to install GnuCOBOL from source [7c6b048b95] (that's 3.2RC2 along with several OS, some of which you may not know of - at least they are far away from your list). Ubuntu is covered there, too.
Related
Discussion: 7c6b048b95
(in case it isn't obvious ^^ was me - apologies for forgetting to log in)