Python-3.5.0 - from mainline sources

This forum is for general developer support questions.
Post Reply
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Python-3.5.0 - from mainline sources

Post by Belxjander »

I've managed to minimally patch the python 3.5.0 mainline sources to only have the following show as missing

Python/pytime.o: In function `pymonotonic_new': 2 missing and 1 disabled due to missing functions.
../Python-3.5.0/Python/pytime.c:613: undefined reference to `clock_gettime' = missing
../Python-3.5.0/Python/pytime.c:626: undefined reference to `clock_getres' = missing
../Python-3.5.0/Python/pytime.c:632: undefined reference to `_PyTime_FromTimespec' = disabled
Modules/getpath.o: In function `calculate_path': 1 missing
../Python-3.5.0/Modules/getpath.c:309: undefined reference to `wcstok'
../Python-3.5.0/Modules/getpath.c:311: undefined reference to `wcstok'
../Python-3.5.0/Modules/getpath.c:313: undefined reference to `wcstok'

for anyone interested...the sources are stored online at https://github.com\Belxjander/Kirito.git

I've been working on this recently as a dependency for Perception-IME

I think I am doing okay for having made few if any modifications to the mainline sources.

Still hoping to have it build completely this year
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Python-3.5.0 - from mainline sources

Post by broadblues »

Building a -libunix python is trivial, (it aint no perl) I did one as temporary measure whilst porting blender, a properly amiga version is more work.

Why make your IME depend on a component not present in the OS?
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Python-3.5.0 - from mainline sources

Post by Belxjander »

I'm working on porting it for build-time scripting usage...

and the python3.x series has all strings as unicode by default

I only need to link "-lunix" then ? for completing the above ?

can you expand on the "-libunix" reference a bit more please ?

other than build time, I'm not depending on python itself at all (I just need the facilities to handle a couple of things ARexx simply is not equipped to handle in preprocessing some unicode data into the required indexing.

then it will make writing the C handling of the same data more trivial.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Python-3.5.0 - from mainline sources

Post by broadblues »

By libunix I mean compile with -lunix to support unix paths so you don;t ned to port the os modules completely.


If you need build time scriptingf support for utf8 then rather than try and port python why not use perl?

Check out http://perldoc.perl.org/utf8.html

5.16.3 comes with the SDK and unicode support is builtin.
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Python-3.5.0 - from mainline sources

Post by Belxjander »

@Broadblues
Well I have run into no issues with pathing anything yet, I do however need to find out more about this "-lunix" linkage option you have mentioned

as I have managed to keep minimal patching and for the most part bypass existing problems...

I do however need to write some code for this... and as for using perl... will it allow me to recursively "fold" 13000 Kanji Unicode Characters into a 513 readings mapping B+Tree arrangement ?

I'm needing to deal with recursion in building this index...and my knowledge (limited as it is) of python is far greater than what I know of perl.

that it comes in the SDK gives me a chance to actively run "slic3r" for a reprap toolchain however.

I'm not porting python just as a build-scripting support for Perception-IME...I'm also going to be needing it for after Perception-IME's scripting to handle some other scripting tasks as well and will most likely move the amiga specific sources into the Polymorph-VMM tree

I'm just doing this the way I think I need to do it... if you want to explain a better alternative for that, I don't mind trying to explain the steps I have in mind and hearing about an alternative...if you have the time for that ?
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Python-3.5.0 - from mainline sources

Post by Belxjander »

I have managed to sort out a full build of python using the sources with minimal modifications currently in my http://github.com/Belxjander/Kirito.git repository.

There is a lot of functionality that seems to be stripped out or optimized away as part of the build process.

If anyone cares to help for AOS4/AROS as a build target?

gcc -c -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O0 -Wall -Wstrict-prototypes -N -q -O0 -Wall -Wundef -Wpointer-arith -Wbad-function-cast -gstabs -I/SDK/includes/include_h/ -fPIC -shared -Werror=declaration-after-statement -I. -IInclude -I../Python-3.5.0/Include -DPy_BUILD_CORE -o Parser/myreadline.o ../Python-3.5.0/Parser/myreadline.c
../Python-3.5.0/Parser/myreadline.c: In function 'my_fgets':
../Python-3.5.0/Parser/myreadline.c:47: warning: will never be executed

is one of several hundred warning messages leading into a DSI exception that occurs during the build process.

any help with any of these warnings would be much appreciated.
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Python-3.5.0 - from mainline sources

Post by Belxjander »

Updated build again...

replacing the SDK:GCC with the newer archive from os4depot.net worked...

correcting the GCC:lib/GCC/ppc-amigaos/5.3.0/lib to GCC:lib/GCC/ppc-amigaos/5.3.0/new lib/lib path

this wiped most of the build errors and I still met a DSI during build when trying the _freeze_importlib command that is built and part of the build process.

Anyone mind helping me track down what I need to more specifically change to make this a more fully native build?
Post Reply