Title: missing _math.o target in 2.7 Makefile
Type: Stage:
Components: Build Versions: Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: skip.montanaro, vstinner, zach.ware
Priority: normal Keywords:

Created on 2016-10-20 12:11 by skip.montanaro, last changed 2016-10-23 15:04 by skip.montanaro. This issue is now closed.

Messages (6)
msg279028 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2016-10-20 12:11
Unless I have my hg repo dependencies incorrect, this target seems to be missing from the 2.7

# This is shared by the math and cmath modules
Modules/_math.o: Modules/_math.c Modules/_math.h
	$(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<

My cpython repo pulls from, My 2.7 repo pulls from my cpython repo. I have other branches to build older 3.x versions which also pull from my cpython repo. The math and cmath modules build fine, though they don't seem to have that target either. So perhaps I'm barking up the wrong tree.

Either way, 2.7 won't build properly for me unless I explicitly execute

make Modules/_math.o
msg279029 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2016-10-20 12:12
Is this perhaps related to the (closed) issue 24421?
msg279030 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-10-20 12:28
> Unless I have my hg repo dependencies incorrect, this target seems to be missing from the 2.7

The math module is compiled by

        # math library functions, e.g. sin()
        exts.append( Extension('math',  ['mathmodule.c'],
                               depends=['_math.h', shared_math],
                               libraries=math_libs) )
msg279038 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2016-10-20 15:09
I'm not sure you understood my problem. Starting with

make distclean

the math and cmath modules fail to build  because Modules/_math.o is
missing. It's not a make thing. I did notice the cpython Makefile has a
target for Modules/_math.o and assumed that since it was missing from the
2.7 Makefile, that was the problem, but maybe not. Still, something is
fishy. Can you confirm that having my 2.7 repo depend on my cpython repo
should work? If that's the problem, I'd like to know. It certainly seems to
work for the other branches I build.

msg279039 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-10-20 15:19
Your HG setup sounds fine, though you may be interested in the 'share' extension.  It allows you to share the data store between several checkouts such that doing a 'pull' in one checkout makes any new changesets available in all checkouts without having to do additional local pulls.

This is a strange issue, though.  The make target for _math.o is here: and the 'sharedmods' target depends on it just below there, and it builds fine for me.

What does 'hg summary' give you?
msg279265 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2016-10-23 15:04
The problem is solved. It seems there were changes in my 2.7 checkout which hg update wouldn't overwrite. I vaguely remember applying somebody's patch for a bug quite awhile ago. Apparently, I failed to revert that change before moving on.

I obviously wasn't paying close attention, but I'm still kind of surprised that hg update wouldn't tell me about files it couldn't update based on local changes.
Date User Action Args
2016-10-23 15:04:44skip.montanarosetmessages: + msg279265
2016-10-20 15:19:31zach.waresetnosy: + zach.ware
messages: + msg279039
2016-10-20 15:09:58skip.montanarosetmessages: + msg279038
2016-10-20 12:28:48vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg279030

resolution: not a bug
2016-10-20 12:12:47skip.montanarosetmessages: + msg279029
2016-10-20 12:11:43skip.montanarocreate