This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python/hypot.c is never used
Type: Stage:
Components: Build Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: loewis, mark.dickinson
Priority: normal Keywords:

Created on 2007-11-10 15:07 by mark.dickinson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
hypot.patch mark.dickinson, 2007-11-10 19:05
Messages (3)
msg57350 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2007-11-10 15:07
With the current ./configure setup, it looks to me as though there are 
no circumstances under which the file Python/hypot.c is compliled.
There's a line

AC_REPLACE_FUNCS(hypot)

in configure.in;  which is supposed (if I understand correctly) to check 
for a system hypot(), and use the replacement file hypot.c if the system 
hypot() isn't found;  but the mechanism for using the replacement file 
seems not to work:  I tried the following:

(1) replace all occurrences of hypot with myhypot in configure.in, 
pyport.h, complexobject.c, mathmodule.c and cmathmodule.c.
(2) move Python/hypot.c to Python/myhypot.c, and rename the function 
contained within from hypot to myhypot
(3) rerun autoconf and autoheader
(4) ./configure && make

The result:  as expected, during configuration I got:

checking for myhypot... no

but building failed with:

ar cr libpython2.6.a Objects/abstract.o Objects/boolobject.o Objects/
bufferobject.o Objects/cellobject.o Objects/classobject.o Objects/
cobject.o Objects/codeobject.o Objects/complexobject.o Objects/
descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/
genobject.o Objects/fileobject.o Objects/floatobject.o Objects/
frameobject.o Objects/funcobject.o Objects/intobject.o Objects/
iterobject.o Objects/listobject.o Objects/longobject.o Objects/
dictobject.o Objects/methodobject.o Objects/moduleobject.o Objects/
object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o 
Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o 
Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o 
Objects/unicodeobject.o Objects/unicodectype.o
ar cr libpython2.6.a Python/Python-ast.o Python/asdl.o Python/ast.o 
Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o 
Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o 
Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/
getmtime.o Python/getplatform.o Python/getversion.o Python/graminit.o 
Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o 
Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/
pyarena.o Python/pyfpe.o Python/pystate.o Python/pythonrun.o Python/
structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o 
Python/getopt.o Python/pystrtod.o Python/dynload_shlib.o Python/
mactoolboxglue.o Python/thread.o
ar cr libpython2.6.a Modules/config.o Modules/getpath.o Modules/main.o 
Modules/gcmodule.o 
ar cr libpython2.6.a Modules/threadmodule.o  Modules/signalmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/
symtablemodule.o  Modules/xxsubtype.o
ranlib libpython2.6.a
gcc -L/opt/local/lib -u _PyMac_Error -o python.exe \
                Modules/python.o \
                libpython2.6.a -ldl      
/usr/bin/ld: Undefined symbols:
_myhypot

(I'd like to know how to fix this:  I've been working on fixing some of 
the numerical problems in the cmath module, and hoped to imitate the 
hypot setup for the functions log1p, asinh and copysign.)
msg57357 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2007-11-10 19:05
hypot.patch contains a possible fix, together with a fix for the includes 
in hypot.c itself.  (As it was, compilation of hypot.c would fail due to 
ssize_t being referenced before definition, in pyport.h.)
msg57393 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-11-12 05:14
Thanks for the patch. Committed as r58941.
History
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45759
2007-11-12 05:14:26loewissetstatus: open -> closed
resolution: accepted
messages: + msg57393
2007-11-10 19:05:16mark.dickinsonsetfiles: + hypot.patch
messages: + msg57357
2007-11-10 17:59:13georg.brandlsetassignee: loewis
nosy: + loewis
2007-11-10 15:07:51mark.dickinsoncreate