6 Replies Latest reply: Feb 11, 2014 2:28 PM by user5903255 RSS

    Solaris Studio 12.3 sunmath missing

    user5903255

      after searching the docs and some time on the net in general i figured i have to ask here since i couldn't find anything else.

       

      i'm using 12.3 on linux (debian 6) and ran into the good old "undefined symbol: __sincos" issue. now the usual trick was to add -lsunmath. the problem however is that there is no sunmath anymore and using sunimath instead didn't solve the issue.

       

      so if anyone could shed some light on this i'd be really greatful because that's a show stopper right now and i'd very much like to keep using sunpro :-)

        • 1. Re: Solaris Studio 12.3 sunmath missing
          Steve.Clamage-Oracle

          The sunmath library was introduced many years ago to provide some math functions that at the time were not in the standard Solaris math library libm. By the time we started providing compilers on Linux, the functionality provided by libsunmath was incorporated into libm (which is now included in libc). In that sense libsunmath is a legacy library, so that existing makefiles and scripts linking libsunmath would continue to work.  As such, it was not ported to Linux.

           

          The sunimath library has nothing to do with libsunmath. It is the library that supports interval arithmetic. (Interval math works with ranges of data instead of single values.)

           

          Oracle Linux, derived from Red Hat, provides __sincos in libm, so references to that function should be satisfied. Debian Linux is not supported by Oracle Solaris Studio, so the results you get will be hit or miss. I would expect __sincos to be an available function, but you might have to hunt around in system libraries to find it.

          • 2. Re: Solaris Studio 12.3 sunmath missing
            user5903255

            Steve_Clamage wrote:

             

            As such, it was not ported to Linux.

            are you sure? looking at a SunStudio12ml-linux-x86-200709-ii right now and it does contain a libsunmath.a which actually is a link to libsunmath_sol.a

            Debian Linux is not supported by Oracle Solaris Studio, so the results you get will be hit or miss. I would expect __sincos to be an available function, but you might have to hunt around in system libraries to find it.

            much thanks for that excellent reply! looks like i need to go through some headers ...



            EDIT: i tried the mentioned version 12 and adding libsunmath_sol.a to the link line which was a success! next i'll try to use that with 12.3 ...
            CORRECTION: adding libsunmath_sol.a wasn't the solution but version 12 itself. using libsunmath_sol.a with 12.3 gave the same problem and using 12 without it worked, too. i used the same options for both versions.

            RESULT: all 3 versions after 12 came up with the same error. adding libsunmath_sol.a didn't help so it seems like 12 it is for me.
            • 3. Re: Solaris Studio 12.3 sunmath missing
              user5903255

              maybe you wanna consider that for the next version because it's quite a pity not being able to use it because of such a trivial issue. and from what i've seen this is the only obstacle

              • 4. Re: Solaris Studio 12.3 sunmath missing
                marc1842fr

                Steve_Clamage wrote:

                 

                Oracle Linux, derived from Red Hat, provides __sincos in libm, so references to that function should be satisfied. Debian Linux is not supported by Oracle Solaris Studio, so the results you get will be hit or miss. I would expect __sincos to be an available function, but you might have to hunt around in system libraries to find it.

                The shared libm.so only provides sincos (no underscore). The static libm.a does seem to provide __sincos as well, so that could be a workaround for now.

                • 5. Re: Solaris Studio 12.3 sunmath missing
                  Steve.Clamage-Oracle

                  In Solaris 10 and later, system libraries are provided only as shared (.so). Relying on libm.a is not a good solution.

                   

                  In addition, __sincos is a private, undocumented interface.Relying on __sincos is also not a good solution.

                   

                  But sincos (without the underbars) is a public supported interface (at least on Solaris and Oracle LInux). The best solution is to change uses of __sincos to sincos. Run the command

                  man sincos

                  for more information.

                  • 6. Re: Solaris Studio 12.3 sunmath missing
                    user5903255

                    Steve_Clamage wrote:

                    The best solution is to change uses of __sincos to sincos.

                     

                    well that was/is one part of the problem, neither sincos nor __sincos appears anywhere in the source of the program in question.