Re: Issue 75 in ctemplate: Has anyone ever tried to compile ctemplate on AIX with IBM xlc?

17 views
Skip to first unread message

ctem...@googlecode.com

unread,
May 14, 2012, 9:16:02 AM5/14/12
to google-c...@googlegroups.com

Comment #7 on issue 75 by rockdrea...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

I'm currently trying to compile with xlC 12.1 and things are much better
than with xlC 11.1. Has there been any progress in this area?

ctem...@googlecode.com

unread,
May 14, 2012, 3:20:41 PM5/14/12
to google-c...@googlegroups.com

Comment #8 on issue 75 by alex.vil...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

We've stopped AIX development a few months ago. All the other OSes seem to
be fine with it.

ctem...@googlecode.com

unread,
May 16, 2012, 8:41:47 AM5/16/12
to google-c...@googlegroups.com

Comment #9 on issue 75 by rockdrea...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

Ok, I managed to compile cleanly using xlC 12.1 on aix 5.3

It's necessary to provide the following argument in the configure directive
in order to compile cleanly

./configure CXXFLAGS=-D__IBMCPP_TR1__

I am also submitting a series of patches based on ctemplate 2.2 that
allowed me to compile cleanly.
* alignment-on-xlc uses the enhanced gcc compatibility in xlC 12.1 to
compile. It won't work with older versions of the compiler. I tried to
compile with xlC 11.1 using the IBM-specific __align and __alignof__
variants but the compiler barfed badly, so I'm keeping it valid on xlC
>=12.1
* bswap32 must leak outside the header it's defined in, I've kept this
behaviour xlc-specific
* operator new in xlC requires a non-const size_t parameter, this is
specific to arena*
* htmlparser statemachine.h uses C++-isms but it must be C-compatible. I've
made the static inline functions in statemachine.h dependend on
__cplusplus. One function that is necessary has been turned into a normal
function. Not sure if this has a serious impact on performance...
* the rest is small stuff: removing C++ // style comments from C sources,
providing return values even in places where it's not necessary etc

Please apply these patches :)

BTW: I'm having a hard time testing because of the aix 5.3 toolchain's
limitations.

Let me know if you have questions, comments, flames etc.


Attachments:
alignment-on-xlc.diff 618 bytes
htmlparser_cpp_test_warnings-on-xlc.diff 656 bytes
leak-bswap32-on-xlc.diff 530 bytes
operator-new-size-argument-on-xlc.diff 2.5 KB
statemachine_test-c-compatibility-on-xlc.diff 464 bytes
statemachine-c-compatibility-on-xlc.diff 1.6 KB

ctem...@googlecode.com

unread,
May 18, 2012, 8:09:10 AM5/18/12
to google-c...@googlegroups.com

Comment #10 on issue 75 by rockdrea...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

one thing to note, statemachine-test-c-compatibility-on-xlc stops
statemachine-test from compiling, as it can't find the right symbol on
Linux. Gotta check this out... :/

ctem...@googlecode.com

unread,
May 30, 2012, 3:58:39 PM5/30/12
to google-c...@googlegroups.com

Comment #11 on issue 75 by olafv...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

Why are there C files anyway? Can't we move to C++?

ctem...@googlecode.com

unread,
May 31, 2012, 10:29:58 AM5/31/12
to google-c...@googlegroups.com

Comment #12 on issue 75 by olafv...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

> || defined(__nacl__) || (defined(__IBMCPP__) && (__IBMCPP__>=1200))

What should happen if it's < 1200?

ctem...@googlecode.com

unread,
Jun 4, 2012, 12:40:36 PM6/4/12
to google-c...@googlegroups.com

Comment #13 on issue 75 by rockdrea...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

If __IBMCPP__< 1200 you have xlC 11.1 which doesn't understand the
gcc-specific __attribute__((aligned(X))) and __alignof__ tokens

The xlc manual states that xlc has the ibm specific __aligned and
__alignof__ tokens that should be equivalent. I tried to use them when the
proper ifdefs are in place but i got an ICE using xlc 11.1 (it's cool to
see a compiler die in agony like this! kudos to who wrote the templates in
question, but my braindead question is... do they actually do any good
considering the level of template-fu required to read them?)

xlc 12.1 required no intervention other than adding the aforementioned
condition. Now I only need to convince management that shelling out 5k on
this compiler makes sense...

ctem...@googlecode.com

unread,
Jun 4, 2012, 12:44:27 PM6/4/12
to google-c...@googlegroups.com

Comment #14 on issue 75 by rockdrea...@gmail.com: Has anyone ever tried to
compile ctemplate on AIX with IBM xlc?
http://code.google.com/p/ctemplate/issues/detail?id=75

> Why are there C files anyway? Can't we move to C++?

I guess there's C code that needs to be maintained somewhere. I personally
dislike this but hey... I'll be happy if I can get the basic template
functionality to work..

If this bugs you, could you open a ticket about it? I'll star it personally.



Reply all
Reply to author
Forward
0 new messages