help with building Python-3.7
#11
RE: help with building Python-3.7
(10-03-2018, 11:13 AM)gijoe77 Wrote:  BTW here is my build enviroment

Code:
export CC=gcc
export CXX=g++
export CFLAGS="-std=gnu99 -g -O1 -mips4"
export CXXFLAGS="-g -O1 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/openssl -I/usr/local/include/ncurses -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib -lssl -lcrypt -lcurses -ltermcap"
export LD_LIBRARYN32_PATH=/usr/local/lib:/usr/local/lib32:/usr/nekoware/lib

./configure --prefix=/usr/local
gmake
Hey gijoe,

That's looking in the right direction, but you can streamline it a bit (and be more correct).

For the "CPPFLAGS" - you should "-I" include the root of the directory where include files will be looked for - in the case of openssl and ncurses, packages normally try and


Code:
#include <openssl/ssh.h>

so it's not necessary to include each individual subdirectory, only each root where includes are found.

So I'd tweak the CPPFLAGS to be:
Code:
export CPPFLAGS="-I/usr/local/include -I/usr/nekoware/include"

For the LDFLAGS you could explicitly include the libraries with "-l" parameters - but the autoconf "configure" script will normally figure out which libraries need to be pulled in.

So I'd tweak that to be:

Code:
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"

This _does_ mostly only apply to things using autoconf - for projects with raw makefile or their own way of configuring/setting up (looking at you, perl), you may indeed need to be specific about adding libraries in the LDFLAGS or by editing makefiles.

One other variable that can help out in discovering libraries + package locations - PKG_CONFIG_PATH (from pkgconfig).

Given what you've written above, I'd set it something like this:


Code:
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/nekoware/lib/pkgconfig"


I realise this is quite a learning curve .-)


Hopefully this week I'll have a new release of "didbs" (this fixes issues running on machines where nekoware already installed) - I'd like to ask you to be a guinea pig for it (just run + report errors) - my goal is then I can point you at didbs and say "run didbs with these flags to see what environment I set up for package X".

Still a bit of work to do there for me before we are there, but with your help maybe I can learn enough to start on an irisware bootstrap proof-of-concept (I haven't forgotten Raion!).

Cheers
mrthinlysliced
Octane

Posts: 76
Threads: 5
Joined: May 2018
Find Reply
10-05-2018, 11:46 AM
#12
RE: help with building Python-3.7
(10-05-2018, 11:46 AM)mrthinlysliced Wrote:  
(10-03-2018, 11:13 AM)gijoe77 Wrote:  BTW here is my build enviroment

Code:
export CC=gcc
export CXX=g++
export CFLAGS="-std=gnu99 -g -O1 -mips4"
export CXXFLAGS="-g -O1 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/openssl -I/usr/local/include/ncurses -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib -lssl -lcrypt -lcurses -ltermcap"
export LD_LIBRARYN32_PATH=/usr/local/lib:/usr/local/lib32:/usr/nekoware/lib

./configure --prefix=/usr/local
gmake
Hey gijoe,

That's looking in the right direction, but you can streamline it a bit (and be more correct).

For the "CPPFLAGS" - you should "-I" include the root of the directory where include files will be looked for - in the case of openssl and ncurses, packages normally try and


Code:
#include <openssl/ssh.h>

so it's not necessary to include each individual subdirectory, only each root where includes are found.

So I'd tweak the CPPFLAGS to be:
Code:
export CPPFLAGS="-I/usr/local/include -I/usr/nekoware/include"

For the LDFLAGS you could explicitly include the libraries with "-l" parameters - but the autoconf "configure" script will normally figure out which libraries need to be pulled in.

So I'd tweak that to be:

Code:
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"

This _does_ mostly only apply to things using autoconf - for projects with raw makefile or their own way of configuring/setting up (looking at you, perl), you may indeed need to be specific about adding libraries in the LDFLAGS or by editing makefiles.

One other variable that can help out in discovering libraries + package locations - PKG_CONFIG_PATH (from pkgconfig).

Given what you've written above, I'd set it something like this:


Code:
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/nekoware/lib/pkgconfig"


I realise this is quite a learning curve .-)


Hopefully this week I'll have a new release of "didbs" (this fixes issues running on machines where nekoware already installed) - I'd like to ask you to be a guinea pig for it (just run + report errors) - my goal is then I can point you at didbs and say "run didbs with these flags to see what environment I set up for package X".

Still a bit of work to do there for me before we are there, but with your help maybe I can learn enough to start on an irisware bootstrap proof-of-concept (I haven't forgotten Raion!).

Cheers

Hello mrthinlyslicedSmile

I originally started with a much more streamlined env, something like:


Code:
export CC=gcc
export CXX=g++
export CFLAGS="-std=gnu99 -g -O1 -mips4"
export CXXFLAGS="-g -O1 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/nekoware/include"
export LDFLAGS="-L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib"
export LD_LIBRARYN32_PATH=/usr/local/lib:/usr/local/lib32:/usr/nekoware/lib

./configure --prefix=/usr/local
gmake

but as I started running into tons of module/extension problems I started tweaking stuff and eventually I sort of lost track of what was working and what wasn't (once the first set of object files were built, I'd tweak something else and the next set of object files were built, and so on and so on until I basically compiled everything and all of a sudden I have this somewhat convoluted string of redundant -I and -L lines, where I sort of lost track of what fixed what).  I need a better method of keeping track of stuff, but I realize its just my novice showing Smile.  

I think the root of my issue with this Python build is I just can't seem to figure out where in the Makefile/libtool/script/whoknowswhat I can tweak the "ld" line for the modules so I just started throwing everything at the CPPFLAGS and LDFLAGS and seeing what stuck (horrible method but it did have results and I got almost all of the modules compiled!)

I'm just going to slowly back away from Python because it's a bit more than I can chew at the moment Smile

Thanks for the PKG_CONFIG_PATH headsup, and I've been reading the libtool documentation and came across this (I'm still trying to sort it all out):


Code:
You will also need to do one of the following:
  - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
    during execution
  - add LIBDIR to the 'LD_RUN_PATH' environment variable
    during linking

Also, I'll give didbs a run, do you want to open a particular thread for it?  I was going to give it a spin anyway because of issues I ran into building libtool and I was going to see how you handled the issue I was running into, but I wasn't sure by looking at your scripts so I wanted to do a deeper dive.
gijoe77
Tezro

Posts: 468
Threads: 27
Joined: Jun 2018
Find Reply
10-11-2018, 01:41 AM
#13
RE: help with building Python-3.7
(10-11-2018, 01:41 AM)gijoe77 Wrote:  Also, I'll give didbs a run, do you want to open a particular thread for it?  I was going to give it a spin anyway because of issues I ran into building libtool and I was going to see how you handled the issue I was running into, but I wasn't sure by looking at your scripts so I wanted to do a deeper dive.

I made a more recent "release" of didbs on the end of my "ThinlySliced Developments" thread:

https://forums.irix.cc/thread-41-post-4025.html#pid4025

If you have the patience to give it a try and run into issues feel free to stick your problems on the end of that thread. Be aware it will take significant time - but you can interrupt it and re-launching it will start from the start of the last unfinished package.

You'll want that 0.0.2 release since you've already got bits of nekoware installed.

OK enough marketing blah blah .-)
mrthinlysliced
Octane

Posts: 76
Threads: 5
Joined: May 2018
Find Reply
10-12-2018, 06:51 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)