#7849: MPRI issue with Sun Studio and --enable-cxx
--------------------------------------------------------------+-------------
   Reporter:  drkirkby                                        |       Owner:  
drkirkby               
       Type:  defect                                          |      Status:  
needs_review           
   Priority:  major                                           |   Milestone:  
sage-4.3.1             
  Component:  solaris                                         |    Keywords:    
                     
Work_issues:                                                  |      Author:  
Bill Hart, David Kirkby
   Upstream:  Reported upstream. Developers acknowledge bug.  |    Reviewer:    
                     
     Merged:                                                  |  
--------------------------------------------------------------+-------------
Changes (by newvalueoldvalue):

  * status:  new => needs_review
  * component:  porting => solaris
  * author:  => Bill Hart, David Kirkby


Comment:

 I added

 {{{
 if [ "x`uname`" = "xSunOS" ] ; then
    echo "Copying a version of gmp-h.in which is patched for Sun Studio"
    cp patches/gmp-h.in src/
    if ! [ $? -eq 0 ]; then
       echo "Failed to patch for Sun Studio"
       exit 1
    fi
 fi
 }}}

 to spkg-install, so the file is only copied over on Solaris. The actual
 changes to the file gmp-h.in are the addition of these few lines

 {{{
 #ifdef __SUNPRO_CC    /* See:
 http://trac.sagemath.org/sage_trac/ticket/7849 */
 #include <stddef.h>   /* This is Bill Hart's fix, but I've applied it only
 */
 #include <stdarg.h>   /* on Sun Studio */
 #endif
 }}}

 Whether this patch should be applied on Linux or not is unknown - in any
 case, Linux systems running Sun Studio are very rare. Currently the patch
 is applied on all Solaris systems, but is only seen by the Sun C++
 compiler, not by g++.

 http://boxen.math.washington.edu/home/kirkby/portability/mpir-1.2.2.p0/

 '''Here's the errors before the fix'''
 {{{

 drkir...@hawk:~/sage-4.3.1.alpha0$ ./sage -f mpir-1.2.2

 <SNIP>

  /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -I. -I..
 -D__GMP_WITHIN_GMPXX -I.. -m64 -library=stlport4 -c isfuns.cc  -KPIC -DPIC
 -o .libs/isfuns.o
 /bin/sh ../libtool --tag=CXX --mode=compile /opt/sunstudio12.1/bin/CC
 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMPXX -I..    -m64
 -library=stlport4 -c -o ismpf.lo ismpf.cc
  /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -I. -I..
 -D__GMP_WITHIN_GMPXX -I.. -m64 -library=stlport4 -c ismpf.cc  -KPIC -DPIC
 -o .libs/ismpf.o
 /bin/sh ../libtool --tag=CXX --mode=compile /opt/sunstudio12.1/bin/CC
 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMPXX -I..    -m64
 -library=stlport4 -c -o ismpq.lo ismpq.cc
  /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -I. -I..
 -D__GMP_WITHIN_GMPXX -I.. -m64 -library=stlport4 -c ismpq.cc  -KPIC -DPIC
 -o .libs/ismpq.o
 /bin/sh ../libtool --tag=CXX --mode=compile /opt/sunstudio12.1/bin/CC
 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMPXX -I..    -m64
 -library=stlport4 -c -o ismpz.lo ismpz.cc
  /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -I. -I..
 -D__GMP_WITHIN_GMPXX -I.. -m64 -library=stlport4 -c ismpz.cc  -KPIC -DPIC
 -o .libs/ismpz.o
 /bin/sh ../libtool --tag=CXX --mode=compile /opt/sunstudio12.1/bin/CC
 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMPXX -I..    -m64
 -library=stlport4 -c -o ismpznw.lo ismpznw.cc
  /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -I. -I..
 -D__GMP_WITHIN_GMPXX -I.. -m64 -library=stlport4 -c ismpznw.cc  -KPIC
 -DPIC -o .libs/ismpznw.o
 /bin/sh ../libtool --tag=CXX --mode=compile /opt/sunstudio12.1/bin/CC
 -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMPXX -I..    -m64
 -library=stlport4 -c -o osdoprnti.lo osdoprnti.cc
  /opt/sunstudio12.1/bin/CC -DHAVE_CONFIG_H -I. -I. -I..
 -D__GMP_WITHIN_GMPXX -I.. -m64 -library=stlport4 -c osdoprnti.cc  -KPIC
 -DPIC -o .libs/osdoprnti.o
 "../mpir.h", line 629: Error: va_list is not defined.
 "../mpir.h", line 634: Error: va_list is not defined.
 "../mpir.h", line 639: Error: va_list is not defined.
 "../mpir.h", line 644: Error: va_list is not defined.
 "../mpir.h", line 649: Error: va_list is not defined.
 "../mpir.h", line 668: Error: va_list is not defined.
 "../mpir.h", line 673: Error: va_list is not defined.
 "../mpir.h", line 678: Error: va_list is not defined.
 "../gmp-impl.h", line 3682: Error: va_list is not defined.
 "../gmp-impl.h", line 3785: Error: va_list is not defined.
 "../gmp-impl.h", line 3791: Error: va_list is not defined.
 "../gmp-impl.h", line 3811: Error: va_list is not defined.
 12 Error(s) detected.
 make[2]: *** [osdoprnti.lo] Error 1
 make[2]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha0/spkg/build/mpir-1.2.2/src/cxx'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha0/spkg/build/mpir-1.2.2/src'
 make: *** [all] Error 2
 Error building MPIR.
 }}}


 '''Here's the result ofter the fix'''
 {{{
 drkir...@hawk:~/sage-4.3.1.alpha0$ ./sage -f mpir-1.2.2.p0
 <SNIP>
 +-------------------------------------------------------------+
 | CAUTION:                                                    |
 |                                                             |
 | If you have not already run "make check", then we strongly  |
 | recommend you do so.                                        |
 |                                                             |
 | MPIR has been carefully tested by its authors, but compilers|
 | are all too often released with serious bugs.  MPIR tends to|
 | explore interesting corners in compilers and has hit bugs   |
 | on quite a few occasions.                                   |
 |                                                             |
 +-------------------------------------------------------------+

 make[4]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha0/spkg/build/mpir-1.2.2.p0/src'
 make[3]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha0/spkg/build/mpir-1.2.2.p0/src'
 make[2]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha0/spkg/build/mpir-1.2.2.p0/src'
 make[1]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha0/spkg/build/mpir-1.2.2.p0/src'

 real    0m56.690s
 user    0m27.805s
 sys     0m30.550s
 Successfully installed mpir-1.2.2.p0
 }}}
 And when 'make check' was run outside of Sage, all tests passed.


 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7849#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB
-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.


Reply via email to