Replies: 3 comments
-
|
The Open XL C/C++ 1.1 pure clang-based compiler should definitely help with porting boost. Many years ago, I did try to port boost to z/OS, but since it uses many of the cutting edge C++ standard features, the existing xlc compilers would error out at compile time.
How it was built should not affect how it's used. cmake actually respects the CC (https://cmake.org/cmake/help/latest/envvar/CC.html) and CXX environment variables, so you can definitely configure it to use whichever compiler you wish. However, since ibm-clang links to newer versions of the C++ runtime, you'll also need the respective C++ runtime dll ptfs installed in order to run it (documented in the Open XL installation docs). Right now there's actually some build time issues with the zopen port of cmake which we need to resolve.
For C libraries, it should not make a difference as they all rely on the C LE runtime. There may be C++ run-time or link-time incompabilities when linking libraries compiled with ibm-clang++ and xlclang++ as they use different C++ run-times.
I've asked internally within IBM, but so far I'm not aware of a boost++ port. |
Beta Was this translation helpful? Give feedback.
-
|
For Boost, use the ibm-clang compiler and make sure Boost doesn't try to go down the XL config path. I haven't tried it and we haven't tested it, but my understanding is you get really good mileage if you get Boost to use the clang config with the ibm-clang.
Mixing object files (same for shared libs) between xlc/xlclang/ibm-clang only works for C code. You can't mix C++ object code between the products for a few reasons. See the documentation for Open XL for the complete binary compatibility statement. I don't know zlib. It sounds like it is a C library. If that is the case (or it's C++ code that uses a C interface) then you should be able to build the library with xlc/xlclang and use it in programs built with ibm-clang++. As long as the functions use C linkage and all structs involved in the interface are C structs (aka plain old data), then that should work.
The C++runtime shouldn't be an issue. It will be installed when you install the Open XL compiler and will be installed on other systems when you install the latest LE runtime ptfs. Igor, ping me about the build time issue. It should be building cleanly.
I'm not aware of any current port either. Sounds like something we should add to the list for z/OS Open Tools :) |
Beta Was this translation helpful? Give feedback.
-
|
@IgorTodorovskiIBM @perry-ca we have done a lot of work here around compilers we support. Would it be useful to provide an update and also add a section to our docs on compilers? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Choosing which toolchain to build these tools is one aspect of compiler choice between xlc, xlclang, ibm-clang, I would guess that many systems have xlc and xlclang, fewer have ibm-clang so far.
For some of us, one of the reasons that we want access to standard linux tools is in order to build code bases using “native” languages (c, c++, etc).
So with respect to the build tools I think the discussion gets more interesting and complex.
For example, if I want to include the Boost++ libraries in a code base that I need/want to build with xlc++ (for whatever reason), are these ports of the build tools, e.g. cmake, autoconf, automake, bison etc able to support that choice?
I know Boost is a hard one, but so much of the open source packages out there assume the presence of Boost and ASIO that it becomes a significant barrier.
This suggests several areas of concern, or at least questions:
• Does the ZOpen port of cmake support selecting xlc/xlclang/xlc++ for building something, even though it was built with ibm-clang, and is it capable of generating a build environment that I would expect to work for generic OSS projects?
• Same question for autoconf, automake, etc.
• To what extent is it possible, and is it a “good idea”, to mix code produced from different compilers? E.g. if zlibport is built with xlclang or ibm-clang, can I link it with code built with xlc/xlc++? Are they compatible at the object module level, object archive level, shared object library/DLL level, or perhaps not at all? What is officially supported by IBM?
That last one is tricky, and may not really something that can or should be answered by the ZOSSOpenTools project, but it seems to me that the answer would be relevant to this project.
And if anyone knows of a solid port of Boost++ to XL C/C++, please drop me a line! ;-}
Beta Was this translation helpful? Give feedback.
All reactions