Problem:
the build for AIX fails multiple times: mainly around building the shared libraries.
Ok, I've worked a little bit:
the following issues came up:
- the choice of ALLOCA is not good vor Visual C/C++ 5.0. Choosing MALLOC seems to be good and should be good for all IBM compilers - the compilers were formerly versioned with hex codes now they are with decimal codes which regrettably sabotages any scalar comparison so #if __IBMC__ >= 0x306 won't work. This makes it hard to distinguish between various IBM C compilers. If you insist compare only with = not with > or <. - the shared library configuration is not correctly used in the makefiles. see description below
I am currently collecting issues. With some help of the creators/maintainers and probably somebody who gives them access to an AIX box (sorry I cannot) we'll port correctly to AIX.
The thing with the shared libraries doesn't apply to AIX only but to all systems like this.
What happens: The anatomy of the TCL (original within the TCL configure/make system) is:
$(SHLIB_LD) $(SHLIB_LD_FLAGS) objects .... $(SHLIB_LD_LIBS)
The TCL configure sets the SHLIB_LD_LIBS to either being empty or ${LIBS} in case the loader need the linkable libraries to generate the shared library.
Now TCL would be linked like "shell + tcl-lib + dl-lib + c-lib + m-lib + bsd-lib" (cited from memory not sure about the mathlib). So to create the shared-lib tcl8.4 it uses "-ldl -lc -lm -lbsd" as value for $(LIBS)
Now XoTCL set the variable TCL_LIBS with those additional libs. This is nice but ends here because the SHLIB_LD_LIBS needs LIBS
So the Makefile of XoTCL requires a line like:
LIBS=-ltcl8.4 $(TCL_LIBS)
If this is not set with the list of libraries needed to link an application with XoTCL then the configuration in SHLIB_LD_LIBS is useless! AIX and some other OSes need these libraries mentioned. TCL provides the list needed for TCL, add TCL itself and any others you need yourself and set those to LIBS.
Now I suppose the tcl8.4 can also be taken from some variable. Also it requires the either the LIBS or the SHLIB_LD_FLAGS to be extended with the -L option to specify from where to take the libtcl8.4.so.
Currently my XoTCL library links correctly and is loadable nicely, but all the changes are manually hacked. I need to redo in a more strucured way later.
anyone offering help/support?
Regards, Adrian Wallaschek
"Just when you think, life can't possible get worse, it suddenly does!" The Hitchhiker's guide to the galaxy - Douglas Adams
Uwe Zdun <uwe.zdun@wu-wien To: Adrian Wallaschek/Belgium/Contr/IBM@IBMBE .ac.at> cc: Subject: Re: [Xotcl] Announcing XOTcl 1.0 09.12.02 17:18
Hi Adrian,
hast du das an die Liste geschickt? Es sieht so aus, als wäre es nur an mich gegangen.
Sorry, das ich deine andere Mail noch nicht angeschaut hatte; ich war übers Wochenende nicht verfügbar ...
Ich bin auch nicht sicher, was das Problem ist; ich hab ja auch keinen Access zu einem AIX system, vielleicht kannst du es etwas näher spezifizieren und an die Liste schicken? Ich weiss nicht, ob Gustaf Neumann noch an ein AIX System drankommt, dass würde das Problemsuchen vereinfachen ...
Gruss,
Uwe
On Monday 09 December 2002 03:58 pm, you wrote:
Hi there!
Anybody playing with XoTCL on an AIX 4.3.x?
XoTcl is giving me a hard time to get it working. I'd like to get in
touch
with somebody who had some success. So far I get a far as getting a shared lib created but when loading it,
it
core dumps the TCL.
Any hints/clues?
Using AIX 4.3 with Visual C/C++ 5.
In the meanwhile I'll try getting a gcc together.
Regards, Adrian Wallaschek
"Just when you think, life can't possible get worse, it suddenly does!" The Hitchhiker's guide to the galaxy - Douglas Adams
-- Uwe Zdun Department of Information Systems, Vienna University of Economics Phone: +43 1 313 36 4796, Fax: +43 1 313 36 746 zdun@{xotcl,computer,acm}.org, uwe.zdun@wu-wien.ac.at
- the choice of ALLOCA is not good vor Visual C/C++ 5.0. Choosing MALLOC
seems to be good and should be good for all IBM compilers
No, alloca != malloc. alloca uses stack and auto-frees. alloca should also be available on AIX by including either -lc or -lbsd.
- the compilers were formerly versioned with hex codes now they are with
decimal codes which regrettably sabotages any scalar comparison so #if __IBMC__ >= 0x306 won't work. This makes it hard to distinguish between various IBM C compilers. If you insist compare only with = not with > or
<.
Ack, except for compiler bugs, what would want want to care about the version of the compiler for?
- the shared library configuration is not correctly used in the makefiles.
see description below
It would probably help if someone upgraded this to TEA2 build system. It isn't a big modification, but it does have notable improvements like not requiring that the extension be built with the same compiler setup as Tcl itself was. This is important on "odd" platforms like AIX, where gcc and xlc/cc can greatly disagree.
Jeff Hobbs The Tcl Guy Senior Developer http://www.ActiveState.com/ Tcl Support and Productivity Solutions
On Tuesday 10 December 2002 01:44, Jeff Hobbs wrote:
- the choice of ALLOCA is not good vor Visual C/C++ 5.0. Choosing MALLOC
seems to be good and should be good for all IBM compilers
No, alloca != malloc. alloca uses stack and auto-frees. alloca should also be available on AIX by including either -lc or -lbsd.
Jeff, let me explain a possible misunderstanding. XOTcl needs frequently a variable number of temporary objects for the scope of a procedure. The XOTcl implementation uses three different approaches to achive this in a timely manner:
1) use variable sized arrays 2) use alloc 3) use malloc
Since not every c-compiler supports (1) we defined (2) and (3) as fallbacks (in this preference order). Per default (1) is used, when USE_ALLOCA is defined (2), when USE_MALLOC is defined, strategy (3). I think Adrian was refering to the choice between (2) and (3).
- the compilers were formerly versioned with hex codes now they are with
decimal codes which regrettably sabotages any scalar comparison so #if __IBMC__ >= 0x306 won't work. This makes it hard to distinguish between various IBM C compilers. If you insist compare only with = not with > or
<.
Ack, except for compiler bugs, what would want want to care about the version of the compiler for?
- the shared library configuration is not correctly used in the
makefiles. see description below
It would probably help if someone upgraded this to TEA2 build system. It isn't a big modification, but it does have notable improvements like not requiring that the extension be built with the same compiler setup as Tcl itself was. This is important on "odd" platforms like AIX, where gcc and xlc/cc can greatly disagree.
this are good news. we are planing to make a patch release with a few small patches before christmas available. I won't be able to work on the TEA->TEA2 migration over the next weeks, i am not sure, whether uwe will be able to do this before christmas...
in the worst case, this change will not be included in the patch release....
greetings, -gustaf
Jeff Hobbs The Tcl Guy Senior Developer http://www.ActiveState.com/ Tcl Support and Productivity Solutions
Xotcl mailing list - Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl