Title: Cannot build CPython3.6 with module “testcapimodule” statically
Type: compile error Stage:
Components: Build Versions: Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Nan Zhang, haypo
Priority: normal Keywords:

Created on 2017-05-15 02:55 by Nan Zhang, last changed 2017-05-18 20:36 by haypo.

Pull Requests
URL Status Linked Edit
PR 1658 open python-dev, 2017-05-18 20:13
Messages (1)
msg293664 - (view) Author: Nan Zhang (Nan Zhang) * Date: 2017-05-15 02:55
up vote
down vote
I am trying to build CPython3.6 from GitHub statically with the Documentation below:

Changed *shared* to *static*

And only uncommented the module "testcapimodule" in Modules/Setup file:

_testcapi _testcapimodule.c # Python C API test module

And ran with 'make LINKFORSHARED=" "'

However I got errors that:

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers   -I. -I./Include    -DPy_BUILD_CORE  -c ./Modules/_testcapimodule.c -o Modules/_testcapimodule.o
./Modules/_testcapimodule.c: In function ‘test_datetime_capi’:
        ./Modules/_testcapimodule.c:2191:9: error: ‘PyDateTimeAPI’ undeclared (first use in this function)
             if (PyDateTimeAPI) {
        ./Modules/_testcapimodule.c:2191:9: note: each undeclared identifier is reported only once for each function it appears in
        ./Modules/_testcapimodule.c:2203:5: error: ‘PyDateTime_IMPORT’ undeclared (first use in this function)
        ./Modules/_testcapimodule.c:2208:1: warning: control reaches end of non-void function [-Wreturn-type]
        make: *** [Modules/_testcapimodule.o] Error 1

But when I build Cpython3.6 with *shared*, it can succeed.
Date User Action Args
2017-05-18 20:36:38hayposetnosy: + haypo
2017-05-18 20:13:23python-devsetpull_requests: + pull_request1752
2017-05-15 02:55:39Nan Zhangcreate