Re: [C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread Andrew Voelkel
Nope, doesn’t help.

However, based on your input, I found install_name_tool and used it to modify 
hello_ext.so to point to the actual location. That works well, so at least I 
have a path forward with boost.python.

I’m not sure the bjam approach is buying me much compared to Xcode or make, but 
at least I’ve got it to work.


  *   Andy

From: Cplusplus-sig 
 on behalf of 
stefan 
Reply-To: Development of Python/C++ integration 
Date: Wednesday, May 22, 2019 at 11:36 AM
To: "cplusplus-sig@python.org" 
Subject: Re: [C++-sig] Getting simple boost.python extension to work outside 
the test scripts - HELP!



On 2019-05-22 2:30 p.m., Jones, Torrin A (US) wrote:
You may need to set PYTHONPATH.  Search for PYTHONPATH on this page for a 
description.

https://docs.python.org/3/using/cmdline.html

No, PYTHONPATH is used by the Python runtime to locate (Python) modules. It is 
not used to resolve shared library dependencies.
[Stefan]

--



  ...ich hab' noch einen Koffer in Berlin...


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread stefan


On 2019-05-22 2:30 p.m., Jones, Torrin A (US) wrote:


You may need to set PYTHONPATH.  Search for PYTHONPATH on this page 
for a description.


https://docs.python.org/3/using/cmdline.html

No, PYTHONPATH is used by the Python runtime to locate (Python) modules. 
It is not used to resolve shared library dependencies.


Stefan

--

  ...ich hab' noch einen Koffer in Berlin...


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread stefan


On 2019-05-22 2:28 p.m., Andrew Voelkel wrote:


That is helpful. It might indeed be an issue with System Integrity 
Protection, now that I do the right google search.


But that leads to the second question. It is possible to indicate 
within hello_ext.so where to look for the dylib. Then in theory this 
wouldn’t a problem, because I wouldn’t need to set DYLD_LIBRARY_PATH.


Is this insertion of the path of libboost_python37.dylib into 
hello_ext.so something I can do with bjam, or am I going to have to 
figure out how to use a separate build system?


I'm cross-posting this to the Boost.Build mailing list, since that's the 
best (only ?) place where you'll get an answer to this question.



Stefan

--

  ...ich hab' noch einen Koffer in Berlin...


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread Jones, Torrin A (US)
You may need to set PYTHONPATH.  Search for PYTHONPATH on this page for a 
description.

https://docs.python.org/3/using/cmdline.html


From: Cplusplus-sig 
[mailto:cplusplus-sig-bounces+torrin.jones=baesystems@python.org] On Behalf 
Of Andrew Voelkel
Sent: Wednesday, May 22, 2019 10:56 AM
To: Development of Python/C++ integration 
Subject: [C++-sig] Getting simple boost.python extension to work outside the 
test scripts - HELP!

*** WARNING ***
EXTERNAL EMAIL -- This message originates from outside our organization.

Hi,

I spent most of yesterday trying to get the simple tutorials and example to 
build from within the Boost example folders, and finally succeeded. It was not 
super straightforward as the instructions seem incomplete and out of date. But 
after finding a tutorial on Boost.Build and understanding how it works, I was 
able to debug the build process and get the test scripts to run successfully.

Now I'd like to move to Spyder and run simple tests on the extension. However, 
when I try to execute a simple "import hello_ext" statement, I get an error 
trying to locate a dependent library. No amount of setting paths seem to help.

(I copied libboost_python37.dylib to /Users/andy before running this script. 
I'm on Mac OS Mojave

Commands:


import os
print(os.environ['PATH'])
os.environ['PATH'] += ':/Users/andy'
os.environ['DYLD_LIBRARY_PATH'] = '/Users/andy'
print(os.environ['PATH'])
print(os.environ['DYLD_LIBRARY_PATH'])
import hello_ext

Output:

/Users/andy/anaconda3/bin:/Users/andy/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
/Users/andy/anaconda3/bin:/Users/andy/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/andy
/Users/andy
Traceback (most recent call last):

File "", line 7, in
import hello_ext

ImportError: dlopen(/Users/andy/Dropbox 
(Personal)/Developer/boost_1_70_0/libs/python/example/tutorial/hello_ext.so, 
2): Library not loaded: libboost_python37.dylib
Referenced from: /Users/andy/Dropbox 
(Personal)/Developer/boost_1_70_0/libs/python/example/tutorial/hello_ext.so
Reason: image not found
What magic is the boost environment performing to make this work? What can I do 
to make my python extensions look for libboost_python37.dylib in the location 
where it lives?

Thanks in advance for any help!

-  Andy


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread Andrew Voelkel
That is helpful. It might indeed be an issue with System Integrity Protection, 
now that I do the right google search.

But that leads to the second question. It is possible to indicate within 
hello_ext.so where to look for the dylib. Then in theory this wouldn’t a 
problem, because I wouldn’t need to set DYLD_LIBRARY_PATH.

Is this insertion of the path of libboost_python37.dylib into hello_ext.so 
something I can do with bjam, or am I going to have to figure out how to use a 
separate build system?


  *   Andy

From: Cplusplus-sig 
 on behalf of 
stefan 
Reply-To: Development of Python/C++ integration 
Date: Wednesday, May 22, 2019 at 11:07 AM
To: "cplusplus-sig@python.org" 
Subject: Re: [C++-sig] Getting simple boost.python extension to work outside 
the test scripts - HELP!



On 2019-05-22 1:55 p.m., Andrew Voelkel wrote:
What magic is the boost environment performing to make this work? What can I do 
to make my python extensions look for libboost_python37.dylib in the location 
where it lives?

Boost.Build does inject a variety of paths into the system-specific path 
variable (I believe on MacOS that would be DYLD_LIBRARY_PATH) such that test 
executables can locate any shared libs they require.

But I also remember having seen cases where some OSX releases specifically 
would prevent that mechanism from working due to some security concerns. I'm 
not a Mac user, so all of this is second-hand information.

Best,
[Stefan]

--



  ...ich hab' noch einen Koffer in Berlin...


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread stefan


On 2019-05-22 1:55 p.m., Andrew Voelkel wrote:


What magic is the boost environment performing to make this work? What 
can I do to make my python extensions look for libboost_python37.dylib 
in the location where it lives?


Boost.Build does inject a variety of paths into the system-specific path 
variable (I believe on MacOS that would be DYLD_LIBRARY_PATH) such that 
test executables can locate any shared libs they require.


But I also remember having seen cases where some OSX releases 
specifically would prevent that mechanism from working due to some 
security concerns. I'm not a Mac user, so all of this is second-hand 
information.


Best,

Stefan

--

  ...ich hab' noch einen Koffer in Berlin...


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


[C++-sig] Getting simple boost.python extension to work outside the test scripts - HELP!

2019-05-22 Thread Andrew Voelkel
Hi,

I spent most of yesterday trying to get the simple tutorials and example to 
build from within the Boost example folders, and finally succeeded. It was not 
super straightforward as the instructions seem incomplete and out of date. But 
after finding a tutorial on Boost.Build and understanding how it works, I was 
able to debug the build process and get the test scripts to run successfully.

Now I’d like to move to Spyder and run simple tests on the extension. However, 
when I try to execute a simple “import hello_ext” statement, I get an error 
trying to locate a dependent library. No amount of setting paths seem to help.

(I copied libboost_python37.dylib to /Users/andy before running this script. 
I’m on Mac OS Mojave

Commands:


import os
print(os.environ['PATH'])
os.environ['PATH'] += ':/Users/andy'
os.environ['DYLD_LIBRARY_PATH'] = '/Users/andy'
print(os.environ['PATH'])
print(os.environ['DYLD_LIBRARY_PATH'])
import hello_ext

Output:

/Users/andy/anaconda3/bin:/Users/andy/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
/Users/andy/anaconda3/bin:/Users/andy/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/andy
/Users/andy
Traceback (most recent call last):

File "", line 7, in
import hello_ext

ImportError: dlopen(/Users/andy/Dropbox 
(Personal)/Developer/boost_1_70_0/libs/python/example/tutorial/hello_ext.so, 
2): Library not loaded: libboost_python37.dylib
Referenced from: /Users/andy/Dropbox 
(Personal)/Developer/boost_1_70_0/libs/python/example/tutorial/hello_ext.so
Reason: image not found
What magic is the boost environment performing to make this work? What can I do 
to make my python extensions look for libboost_python37.dylib in the location 
where it lives?

Thanks in advance for any help!


  *   Andy


___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] Python support in boost::python (what version)

2019-05-22 Thread Jones, Torrin A (US)
What did you expect ? It's obvious that a given release of Boost.Python can not 
make any compatibility guarantees about future Python releases

. . .

What's your point, exactly ? What are you trying to do ?
You're right.  All I'm trying to do is gather information that I can submit and 
hopefully get approved.

I would *hope* that Boost.Python 1.66.0 was compatible with Python 3.6.4

Agreed.  That was just an example for illustration.  Not a criticism.  And 
since you made the point about the major and minor version of python and 
backward-compatibility that's something else for me to think about before I 
present something.

Thanks for your help on this.


From: Cplusplus-sig 
[mailto:cplusplus-sig-bounces+torrin.jones=baesystems@python.org] On Behalf 
Of Stefan Seefeld
Sent: Monday, May 20, 2019 9:16 AM
To: cplusplus-sig@python.org
Subject: Re: [C++-sig] Python support in boost::python (what version)

*** WARNING ***
EXTERNAL EMAIL -- This message originates from outside our organization.



On 2019-05-20 11:20 a.m., Jones, Torrin A (US) wrote:
For clarity, my boss is asking, "what version of python does boost python 
support?"  I was hoping there was some kind of table or something, but I guess 
the answer is something like, "It supports whatever version of python was out 
at the time that boost python was released?"  And then we can go back and look 
at release dates.  LOL.

What did you expect ? It's obvious that a given release of Boost.Python can not 
make any compatibility guarantees about future Python releases, unless, of 
course, Python itself promises to be fully backward compatible. That's 
precisely why the versioning scheme used by Python supports the distinction 
between "major" and "minor" version, to be able to make statements as to what 
degree of backward-compatibility to expect.
Ex: boost python 1.66.0 was released/tagged on Nov 17, 2017.  Python 3.6.3 was 
released on Oct 3, 2017.  Python 3.6.4 was released on Dec 19. 2017.  So in 
theory boost python 1.66.0 has support for Python 3.6.3, but does not have 
support for Python 3.6.4.  I know that's ludicrous but, I work in the corporate 
world so here we are.

What's your point, exactly ? What are you trying to do ?

(For the specific case, I would *hope* that Boost.Python 1.66.0 was compatible 
with Python 3.6.4, for the reason I cite above. But of course, there is no 
guarantee. Boost is Free Software, and its license 
(https://www.boost.org/users/license.html) clearly states that it is provided 
"...without warranty of any kind...". So make of it what you want.)

[Stefan]

--



  ...ich hab' noch einen Koffer in Berlin...
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig