New submission from Michael Osipov <1983-01...@gmx.net>:

I do compile Python from master on HP-UX with aCC:

# echo $LDFLAGS $CPPFLAGS
-L/opt/ports/lib/hpux32 -I/opt/ports/include
UNIX_STD=1998 LDFLAGS="$LDFLAGS -lreadline" CPPFLAGS="-I$PREFIX/include/ncurses 
$CPPFLAGS" ./configure --prefix=/opt/python \
  --libdir=/opt/python/lib/hpux32 --with-system-expat 
--with-openssl=/opt/openssl

having libs in hpux32 or hpux64 is a convention on this platform. When Python 
is installed the following happens:

$ /opt/python/bin/python3
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.8.0a3+ (default, Apr 30 2019, 12:09:29) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/opt/python/lib/python38.zip', '/opt/python/lib/python3.8', 
'/opt/python/lib/lib-dynload', 
'/net/home/osipovmi/.local/lib/python3.8/site-packages', 
'/opt/python/lib/python3.8/site-packages']

I don't see hpux32 anywhere here. Though all shared objects are there.

Reconfiguring:

# echo $LDFLAGS $CPPFLAGS
-L/opt/ports/lib/hpux32 -I/opt/ports/include
UNIX_STD=1998 LDFLAGS="$LDFLAGS -lreadline" CPPFLAGS="-I$PREFIX/include/ncurses 
$CPPFLAGS" ./configure --prefix=/opt/python \
  --with-system-expat --with-openssl=/opt/openssl

gives me the expected result:
$ /opt/python/bin/python3
Python 3.8.0a3+ (default, Apr 30 2019, 12:21:15) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/opt/python/lib/python38.zip', '/opt/python/lib/python3.8', 
'/opt/python/lib/python3.8/lib-dynload', 
'/net/home/osipovmi/.local/lib/python3.8/site-packages', 
'/opt/python/lib/python3.8/site-packages']
>>>

It pretty much seems like '--libdir' is not correctly passed down to the 
installation.

I can see that at least this is wrong:
./Lib/distutils/tests/test_install.py:59:        libdir = 
os.path.join(destination, "lib", "python")
./Lib/distutils/command/install.py:32:        'purelib': 
'$base/lib/python$py_version_short/site-packages',
./Lib/distutils/command/install.py:33:        'platlib': 
'$platbase/lib/python$py_version_short/site-packages',
./Lib/distutils/command/install.py:39:        'purelib': '$base/lib/python',
./Lib/distutils/command/install.py:40:        'platlib': '$base/lib/python',
./Lib/sysconfig.py:23:        'stdlib': 
'{installed_base}/lib/python{py_version_short}',
./Lib/sysconfig.py:24:        'platstdlib': 
'{platbase}/lib/python{py_version_short}',
./Lib/sysconfig.py:25:        'purelib': 
'{base}/lib/python{py_version_short}/site-packages',
./Lib/sysconfig.py:26:        'platlib': 
'{platbase}/lib/python{py_version_short}/site-packages',
./Lib/sysconfig.py:35:        'stdlib': '{installed_base}/lib/python',
./Lib/sysconfig.py:36:        'platstdlib': '{base}/lib/python',
./Lib/sysconfig.py:37:        'purelib': '{base}/lib/python',
./Lib/sysconfig.py:38:        'platlib': '{base}/lib/python',
./Lib/sysconfig.py:65:        'stdlib': 
'{userbase}/lib/python{py_version_short}',
./Lib/sysconfig.py:66:        'platstdlib': 
'{userbase}/lib/python{py_version_short}',
./Lib/sysconfig.py:67:        'purelib': 
'{userbase}/lib/python{py_version_short}/site-packages',
./Lib/sysconfig.py:68:        'platlib': 
'{userbase}/lib/python{py_version_short}/site-packages',
./Lib/sysconfig.py:74:        'stdlib': '{userbase}/lib/python',
./Lib/sysconfig.py:75:        'platstdlib': '{userbase}/lib/python',
./Lib/sysconfig.py:76:        'purelib': '{userbase}/lib/python/site-packages',
./Lib/sysconfig.py:77:        'platlib': '{userbase}/lib/python/site-packages',
./configure.ac:4653:  
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
./Misc/python-config.sh.in:50:LIBDEST=${prefix_real}/lib/python${VERSION}
./Modules/getpath.c:129:    wchar_t *lib_python;               /* 
"lib/pythonX.Y" */
./Modules/getpath.c:131:    wchar_t zip_path[MAXPATHLEN+1];    /* 
".../lib/pythonXY.zip" */
./Modules/getpath.c:520:     * e.g. /usr/local/lib/python1.5 is reduced to 
/usr/local.
./Modules/getpath.c:1018:    err = joinpath(calculate->zip_path, 
L"lib/python00.zip", zip_path_len);
./Modules/getpath.c:1147:    calculate->lib_python = 
Py_DecodeLocale("lib/python" VERSION, &len);
./Python/coreconfig.c:103:#  define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"


I have changed those files manually by adding '/hpux32' everywhere and ran 
configure with custom libdir:
no avail. 'lib/python' will still be used. If this cannot be changed, a warning 
should be issued with ./configure that custom libdir will lead to loading 
issues.

----------
components: Build, Installation
messages: 341148
nosy: michael-o, vstinner
priority: normal
severity: normal
status: open
title: configured libdir not correctly passed to Python executable
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36758>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to