I was able to build python-2.7.15 and all it's modules using MIPSpro, but I am just not having much luck with Python-3.7, I was wondering if someone can help guide me a bit here.
I guess I have three questions - first question - is something broken with gcc 4.7.1 and pthreads? I just couldn't get 4.7.1 to compile at all - here was the first line:
Code:
export CC=/usr/nekoware/gcc-4.7/bin/gcc
export CXX=/usr/nekoware/gcc-4.7/bin/g++
export CFLAGS="-std=gnu99 -g -O0 -mips4"
export CXXFLAGS="-g -O0 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/ncurses -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"
./configure --prefix=/usr/local
<snip>
-bash-4.2$ gmake
/usr/nekoware/gcc-4.7/bin/gcc -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -Wall -std=gnu99 -g -O0 -mips4 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -I/usr/local/include -I/usr/local/include/ncurses -I/usr/nekoware/include -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
In file included from ./Include/pythread.h:114:0,
from ./Include/pystate.h:11,
from ./Include/traceback.h:8,
from ./Include/Python.h:100,
from ./Programs/python.c:3:
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:277:33: error: unknown type name 'pthread_barrierattr_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:278:30: error: unknown type name 'pthread_barrierattr_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:279:36: error: unknown type name 'pthread_barrierattr_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:280:36: error: unknown type name 'pthread_barrierattr_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:281:26: error: unknown type name 'pthread_barrier_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:282:8: error: unknown type name 'pthread_barrierattr_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:283:26: error: unknown type name 'pthread_barrier_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:284:29: error: unknown type name 'pthread_barrier_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:297:26: error: unknown type name 'pthread_spinlock_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:298:23: error: unknown type name 'pthread_spinlock_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:299:23: error: unknown type name 'pthread_spinlock_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:300:26: error: unknown type name 'pthread_spinlock_t'
/usr/nekoware/gcc-4.7/lib/gcc/mips-sgi-irix6.5/4.7.1/include-fixed/pthread.h:301:25: error: unknown type name 'pthread_spinlock_t'
gmake: *** [Programs/python.o] Error 1
-bash-4.2$
2nd question - I don't really have the chops to figure out why MIPSpro was dying on this, here is where it died:
Code:
export CC=/usr/bin/cc
export CXX=/usr/bin/CC
export CFLAGS="-c99 -g0 -O2 -mips4"
export CXXFLAGS="-g0 -woff all -O2 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/ncurses -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"
./configure --prefix=/usr/local
gmake
<snip>
/usr/bin/cc -c -DNDEBUG -O -c99 -g0 -O2 -mips4 -c99 -g0 -O2 -mips4 -I. -I./Include -I/usr/local/include -I/usr/local/include/ncurses -I/usr/nekoware/include -I/usr/local/include -I/usr/local/include/ncurses -I/usr/nekoware/include -DPy_BUILD_CORE -o Objects/dictobject.o Objects/dictobject.c
cc-1142 cc: ERROR File = Objects/dictobject.c, Line = 424
There are too many initializers for a declared aggregate.
{DKIX_EMPTY, DKIX_EMPTY, DKIX_EMPTY, DKIX_EMPTY,
^
Here is the function in question:
Code:
static PyDictKeysObject empty_keys_struct = {
1, /* dk_refcnt */
1, /* dk_size */
lookdict_split, /* dk_lookup */
0, /* dk_usable (immutable) */
0, /* dk_nentries */
{DKIX_EMPTY, DKIX_EMPTY, DKIX_EMPTY, DKIX_EMPTY,
DKIX_EMPTY, DKIX_EMPTY, DKIX_EMPTY, DKIX_EMPTY}, /* dk_indices */
};
3rd question:
so I can get Python-3.7 to compile fine (I guess) using 3.4.6, but for the life of me I just can't seem to figure out why the modules (edit: really meant to say extensions) are all failing linking with unresolved symbols. I was able to fix it on Python-2.7.15 by appending the "ld" line with all the proper -L paths, but the same approach just isn't working for 3.7. I've spent a few days on it and I'm just not sure what I'm not seeing
Code:
export CC=gcc
export CXX=g++
export CFLAGS="-std=gnu99 -g -O0 -mips4"
export CXXFLAGS="-g -O0 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/ncurses -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"
./configure --prefix=/usr/local
gmake
Everything is compiling fine, when it gets to the modules it just starts failing the linking. I've tried to do the modules manually but they still fail for me:
Code:
gcc -fno-strict-aliasing -Wsign-compare -DNDEBUG -g -fwrapv -Wall -std=gnu99 -g -O0 -mips4 -std=gnu99 -g -O0 -mips4 -std=c99 -Wextra -Wno-unused-parameter -I./Include -I. -I/usr/local/include/ncurses -I/usr/nekoware/include -I/usr/local/include -I/usr/people/develop/dev/python/Python-3.7.0/Include -I/usr/people/develop/dev/python/Python-3.7.0 -c /usr/people/develop/dev/python/Python-3.7.0/Modules/_struct.c -o build/temp.irix-6.5-IP32-3.7/usr/people/develop/dev/python/Python-3.7.0/Modules/_struct.o
ld -L. -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib -L/usr/people/develop/dev/python/Python-3.7.0 build/temp.irix-6.5-IP32-3.7/usr/people/develop/dev/python/Python-3.7.0/Modules/_struct.o -L. -L/usr/people/develop/dev/python/Python-3.7.0 -L/usr/local/lib32 -L/usr/local/lib -L/usr/nekoware/lib -o build/lib.irix-6.5-IP32-3.7/_struct.so -L. -L/usr/people/develop/dev/python/Python-3.7.0 -L/usr/local/lib32 -L/usr/local/lib -L/usr/nekoware/lib
ld32: ERROR 33 : Unresolved text symbol "_xpg5_vsnprintf" -- 1st referenced by build/temp.irix-6.5-IP32-3.7/usr/people/develop/dev/python/Python-3.7.0/Modules/_struct.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "_linkfollow" -- 1st referenced by build/temp.irix-6.5-IP32-3.7/usr/people/develop/dev/python/Python-3.7.0/Modules/_struct.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: ERROR 33 : Unresolved text symbol "__xpg4_setregid" -- 1st referenced by build/temp.irix-6.5-IP32-3.7/usr/people/develop/dev/python/Python-3.7.0/Modules/_struct.o.
etc etc
4rth question:
I'm sort of new to Python - it doesn't seem there is a "gmake test" or "gmake check", anyone know how to run a test suite on Python? I found the Lib/test dir, but there was no readme file, and I must of missed a mention of it in the general readme file