Hi nicko,
the main focus of PyInstaller is to create self-contained executables
that will work independently of the host OS.
So this means:
- bundle all dynamic libraries
- override LD_LIBRARY_PATH
- use from the host OS only minimum of .so libraries
However, you could achieve your goal by:
- removing .so files from the dist folder
- libpython is exception since it is loaded dynamically by dlopen()
where the path to libpython is not derived from LD_LIBRARY_PATH
but from homepath/temppath.
- or looking at the following merge request
https://github.com/pyinstaller/pyinstaller/pull/8
[email protected] píše v Po 22. 04. 2013 v 06:44 -0700:
> Hi,
>
> I was using PyInstaller in onefile mode. However, it doesn't fill my
> needs, as it requires to have a /tmp partition mounted without the
> noexec option. So I start to try the onedir mode. And I fall back into
> a well-known problem here: linking against shared libraries outside
> the directory where the generated ELF binary is located.
>
> Indeed, after building, in my dist directory is located my ELF binary
> and all the needed shared library. However, I want this binary to link
> with the shared library installed in the system, the ones located
> in /lib, /usr/lib, etc... I first try using LD_LIBRARY_PATH, at
> execution time of my binary, but this doesn't work. After googling, I
> saw that the PyInstaller bootloader resets this environment variable
> to "homepath" in onedir mode (so to the binary path, right ?). This
> happens in source/linux/utils.c. Following some posts here, I try to
> modify the set_dynamic_library_path so that LD_LIBRARY_PATH is not
> overwritten but concatenated with "homepath". However, this does not
> change the behaviour of execution:
>
> Python library not found.
>
> Indeed this happens in launch.c, as the code looks for the Python
> library either in homepath or in temppath, but not using
> LD_LIBRARY_PATH. No matter, to test I hardcode dllpath
> to /usr/lib/libpython2.6.so.1.0. Ok, knows execution does not complain
> about missing Python library. But now others shared libraries are not
> found, like bz2. So LD_LIBRARY_PATH is ignored ?
>
> Is anybody solve the problem of moving the binary outside the
> directory and succeed to execute it ?
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.