This is mostly a self-reminder

I attended aKademy 2008 and there are so many things to write about I don’t even know what to start with. I’ll probably write something in a few days, when I’m feeling less sick (thanks to a Flemish waiter who had the OpenBossa guys, Knut and I waiting for almost one hour for dinner, I got a cold).

As you may know, part of my job (and hobby, too) consists on “shaking” software to make it compile on different platforms and with different compilers: I port Linux software which builds with gcc to Windows with Visual C++, or Visual C++ to MingW, or… well, whatever. It’s funny.

Back on topic: Wednesday as the Sun tutorials day and I got immediately interested in Sun Studio. Message to Sun Microsystems people: your installer is so broken on Linux it is impossible to make it work on Debian and Ubuntu (and I guess on anything other than RHEL). The only way I found to “install” SS12 was to download the Express version, remove the sh-code and untar the resulting package. It works but it’s so nasty hardly anybody would try that.

Sun Studio 12 is 100% ISO C++ compliant, which means support for wchar_t is not as good as most applications require nowadays. The best way to overcome this limitation is to use Apache Foundation’s STDCXX to replace SS12’s STL (which is STLport 4 (according to Adriaan, stdcxx would roughly correspond to STLport 6)

Building STDCXX is relatively easy, if you know the tricks:

  • export PATH=/path/to/sunstudioceres/bin/:$PATH
  • export CC=/path/to/sunstudioceres/bin/suncc
  • export CPP=/path/to/sunstudioceres/bin/suncc
  • export CXX=/path/to/sunstudioceres/bin/sunCC
  • You should be able to do this step by exporting CFLAGS, etc but it won’t work, so edit stdcxx-4.2.1/etc/config/sunpro.config and:
  • Replace
    CXXFLAGS= -library=%none
    with
    CXXFLAGS = -library=no%Cstd -YI,/path/to/source/of/stdcxx/include/
  • Replace
    CPPFLAGS =
    with
    CPPFLAGS = -YI,/path/to/source/of/stdcxx/include/
  • Replace
    LDFLAGS= -library=%none
    with
    LDFLAGS = -library=no%Cstd
  • make BUILDTYPE=12d
  • make locales(if you don’t use BUILDTYPE=12d, current Sun Studio Express Edition fails with yi_US, thus you need to edit stdcxx-4.2.1/etc/nls/gen_list and remove that line)
  • cd build && make install PREFIX=/where/you/want/to/install/stdcxx
  • At the moment, I’m trying to get Wt built with Sun Studio 12 on Linux. Given that SS12 is the compiler of choice for KDE4 on Solaris, I may try to get KDE4 built on Linux with SS12 at a later stage. That would help both the Solaris port and the Linux code.

    PS: Hello Planet KDE

    0 Thoughts on “Sun Studio 12 and Apache STDCXX

    1. Hey Pau,

      It was really nice meeting you at Akademy!

      I am looking forward to hearing your experience with building Wt on linux with Sun Studio 12. Incidently, just today, we have been able to build the latest Wt CVS using Sun Studio 12 on OpenSolaris using stlport … but not without pain. Also boost asio (as in boost 1.36*) needed some patches, but those may be more specific to OpenSolaris than to Sun Studio 12.

      Regards,
      koen

    2. We attempted to get around the lack of debian pkging of SS12 by providing a simple tarball: (option #2 when you go to d/l)

      https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=SSST9-120-T99M@CDS-CDS_Developer

      Would this be a usable workaround?

      /kso

    Leave a Reply

    Your email address will not be published. Required fields are marked *

     

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Post Navigation