[NumPy-Tickets] [NumPy] #1626: numpy compilation fails on Solaris 10 with SunStudio 12.1 compiler

NumPy Trac numpy-tickets@scipy....
Wed Oct 6 00:53:22 CDT 2010


#1626: numpy compilation fails on Solaris 10 with SunStudio 12.1 compiler
------------------------+---------------------------------------------------
 Reporter:  plubans580  |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  2.0.0   
Component:  numpy.core  |     Version:  1.5.0   
 Keywords:              |  
------------------------+---------------------------------------------------
 numpy.core.umath fails to build on Solaris 10 with Sun Studio 12.1 when
 compiling numpy/core/src/umath/umathmodule_onefile.c.  The build gives the
 following error:

 {{{
 ...
 building 'numpy.core.umath' extension
 compiling C sources
 C compiler: /u/peterlu/solaris/sunstudio12.1/bin/cc -DNDEBUG -O
 -I/u/peterlu/solaris/python/deploy/include -Kpic

 creating build/temp.solaris-2.10-i86pc-2.5/numpy/core/src/umath
 compile options: '-Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/src/umath
 \
 -Inumpy/core/include
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/include/numpy \
 -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core
 -Inumpy/core/src/npymath \
 -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include \
 -I/u/peterlu/solaris/python/deploy/include/python2.5 \
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/src/multiarray \
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/src/umath -c'
 cc: numpy/core/src/umath/umathmodule_onefile.c
 "numpy/core/include/numpy/ufuncobject.h", line 384: warning: statement not
 reached
 "numpy/core/src/umath/loops.c.src", line 1386: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1387: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1386: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1387: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1386: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1387: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/ufunc_object.c", line 3823: warning: operands have
 incompatible pointer types: op "=="
 cc: acomp failed for numpy/core/src/umath/umathmodule_onefile.c
 "numpy/core/include/numpy/ufuncobject.h", line 384: warning: statement not
 reached
 "numpy/core/src/umath/loops.c.src", line 1386: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1387: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1386: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1387: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1386: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/loops.c.src", line 1387: operand must have real
 floating type: op "isnan"
 "numpy/core/src/umath/ufunc_object.c", line 3823: warning: operands have
 incompatible pointer types: op "=="
 cc: acomp failed for numpy/core/src/umath/umathmodule_onefile.c
 error: Command "/u/peterlu/solaris/sunstudio12.1/bin/cc -DNDEBUG -O \
 -I/u/peterlu/solaris/python/deploy/include -Kpic
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/src/umath \
 -Inumpy/core/include
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/include/numpy \
 -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core
 -Inumpy/core/src/npymath \
 -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include \
 -I/u/peterlu/solaris/python/deploy/include/python2.5
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/src/multiarray \
 -Ibuild/src.solaris-2.10-i86pc-2.5/numpy/core/src/umath \
 -c numpy/core/src/umath/umathmodule_onefile.c \
 -o
 build/temp.solaris-2.10-i86pc-2.5/numpy/core/src/umath/umathmodule_onefile.o"
 failed with exit status 1
 >
 }}}

 It looks like the sun compiler is very strict about what arguments its
 "isnan" built-in will accept. Replacing the literal '0's with '0.0's
 allows the build to complete:

 {{{

 --- numpy-1.5.0/numpy/core/src/umath/loops.c.src        2010-08-25
 08:32:15.000000000 -0400
 +++ numpy-1.5.0.new/numpy/core/src/umath/loops.c.src    2010-10-06
 01:29:46.735838000 -0400
 @@ -1376,22 +1376,22 @@
      }
  }

  NPY_NO_EXPORT void
  C@TYPE@_sign(char **args, intp *dimensions, intp *steps, void
 *NPY_UNUSED(func))
  {
      /* fixme: sign of nan is currently 0 */
      UNARY_LOOP {
          const @type@ in1r = ((@type@ *)ip1)[0];
          const @type@ in1i = ((@type@ *)ip1)[1];
 -        ((@type@ *)op1)[0] = CGT(in1r, in1i, 0, 0) ?  1 :
 -                            (CLT(in1r, in1i, 0, 0) ? -1 :
 +        ((@type@ *)op1)[0] = CGT(in1r, in1i, 0.0, 0.0) ?  1 :
 +                            (CLT(in1r, in1i, 0.0, 0.0) ? -1 :
                              (CEQ(in1r, in1i, 0, 0) ?  0 : NPY_NAN@C@));
          ((@type@ *)op1)[1] = 0;
      }
  }

  /**begin repeat1
   * #kind = maximum, minimum#
   * #OP = CGE, CLE#
   */
  NPY_NO_EXPORT void
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1626>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list