Ticket #328 (closed defect: wontfix)

Opened 4 years ago

Last modified 2 years ago

cython 0.11.2 runtest.py errors on solaris 8 (sparc) due to fmodf()

Reported by: jholg Owned by:
Priority: minor Milestone: Dupe/Invalid
Component: Testing Keywords: solaris fmodf
Cc:

Description

Hi, running the cython testsuite on solaris 8 fails:

cdivision_CEP_516.cpp: In function 'PyObject* __pyx_pf_17cdivision_CEP_516_mod_float_c(PyObject*, PyObject*, PyObject*)':
cdivision_CEP_516.cpp:875: error: 'fmodf' was not declared in this scope
cdivision_CEP_516.cpp: In function 'float __Pyx_mod_float(float, float)':
cdivision_CEP_516.cpp:2482: error: 'fmodf' was not declared in this scope
======================================================================
ERROR: compiling (c) and running cdivision_CEP_516
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 345, in run
    doctest.DocTestSuite(self.module).run(result)
  File "/apps/prod/gcc/4.2.1/lib/python2.6/doctest.py", line 2269, in DocTestSuite
    module = _normalize_module(module)
  File "/apps/prod/gcc/4.2.1/lib/python2.6/doctest.py", line 203, in _normalize_module
    return __import__(module, globals(), locals(), ["*"])
ImportError: ld.so.1: python2.6: fatal: relocation error: file /ae/data/tmp/hjoukl/solaris/Cython-0.11.2/BUILD/run/c/cdivision_CEP_516.so: symbol fmodf: referenced symbol not found
 
======================================================================
ERROR: compiling (cpp) and running cdivision_CEP_516
----------------------------------------------------------------------
Traceback (most recent call last):
  File "runtests.py", line 343, in run
    self.runCompileTest()
  File "runtests.py", line 227, in runCompileTest
    self.directory, self.expect_errors, self.annotate)
  File "runtests.py", line 331, in compile
    self.run_distutils(module, workdir, incdir)
  File "runtests.py", line 299, in run_distutils
    build_extension.run()
  File "/apps/prod/gcc/4.2.1/lib/python2.6/distutils/command/build_ext.py", line 343, in
run
    self.build_extensions()
  File "/apps/prod/gcc/4.2.1/lib/python2.6/distutils/command/build_ext.py", line 469, in
build_extensions
    self.build_extension(ext)
  File "runtests.py", line 45, in build_extension
    _build_ext.build_extension(self, ext)
  File "/apps/prod/gcc/4.2.1/lib/python2.6/distutils/command/build_ext.py", line 534, in
build_extension
    depends=ext.depends)
  File "/apps/prod/gcc/4.2.1/lib/python2.6/distutils/ccompiler.py", line 697, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/apps/prod/gcc/4.2.1/lib/python2.6/distutils/unixccompiler.py", line 180, in _compile
    raise CompileError, msg
CompileError: command 'gcc' failed with exit status 1
 
----------------------------------------------------------------------
Ran 1422 tests in 18.442s
 
FAILED (errors=2)
Following tests excluded because of missing dependencies on your system:
   run.numpy_ValueError_T172
   run.numpy_bufacc_T155
   run.numpy_test

$ gcc --version
gcc (GCC) 4.2.1
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
SunOS adevp02 5.8 Generic_117350-25 sun4u sparc SUNW,Sun-Fire-V440 Solaris

Running the tests on solaris 10 works fine. I think this is due to fmodf missing in the solaris 8 headers:

$ grep fmodf /usr/include/*/*.h
/usr/include/iso/math_iso.h:extern float __fmodf(float, float);
/usr/include/iso/math_iso.h:    inline float fmod(float __X, float __Y) { return __fmodf(__X, __Y); }

(Whereas in Solaris 10:
$ grep fmodf /usr/include/*/*.h
/usr/include/iso/math_c99.h:extern float fmodf __P((float, float));
/usr/include/iso/math_c99.h:#pragma does_not_read_global_data(fmodf, remainderf, remquof)/usr/include/iso/math_c99.h:#pragma does_not_write_global_data(fmodf, remainderf)
/usr/include/iso/math_c99.h:#pragma no_side_effect(fmodf, remainderf)
/usr/include/iso/math_iso.h:extern float __fmodf(float, float);
/usr/include/iso/math_iso.h:    inline float fmod(float __X, float __Y) { return __fmodf(__X, __Y); }
)

To make this work on solaris 8 I suspect adding some preprocessor directive to the code generation, like such:

#ifdef __sun
static float fmodf(float x, float y)
{
    double ipart;
    return (float)modf(x/y, &ipart);
}
#endif

might help (certainly improved to respect the solaris version as this is not a problem on solaris 10, maybe also the processor type - don't know about solaris on x86).

Holger

Change History

Changed 3 years ago by robertwb

  • status changed from new to closed
  • resolution set to wontfix

Solaris 8 is ten years old and, no longer shipping, and close to end of life (which is saying something for a Sun product).

 http://www.sun.com/software/solaris/releases.jsp  http://www.sun.com/service/eosl/Solaris8.html

Unless this represents an actual use case, I'm not convinced that its worth adding this code to every generated Cython file (and even if it is, it is easy enough to include this definition manually).

Changed 2 years ago by robertwb

  • milestone changed from wishlist to Dupe/Invalid
Note: See TracTickets for help on using tickets.