comp.lang.ada
 help / color / mirror / Atom feed
* components_4_64 Test_Python fails on Mac Monterey
@ 2022-10-21  1:58 Roger Mc
  2022-10-21  7:05 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Mc @ 2022-10-21  1:58 UTC (permalink / raw)


Test_Python builds Ok but execution fails with:
Execution terminated by abort of environment task
with no other output. 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21  1:58 components_4_64 Test_Python fails on Mac Monterey Roger Mc
@ 2022-10-21  7:05 ` Dmitry A. Kazakov
  2022-10-21 11:12   ` Roger Mc
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry A. Kazakov @ 2022-10-21  7:05 UTC (permalink / raw)


On 2022-10-21 03:58, Roger Mc wrote:
> Test_Python builds Ok but execution fails with:
> Execution terminated by abort of environment task
> with no other output.

[I never tested it under BSD]

1. Does the main test work? (components-python-test_python.gpr)

2. What are the scenarios, you use when building:

    arch
    Atomic_Access
    Target_OS

Depending on that a version of py-load_python_library.adb is selected 
which is responsible for loading the Python library.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21  7:05 ` Dmitry A. Kazakov
@ 2022-10-21 11:12   ` Roger Mc
  2022-10-21 12:46     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Mc @ 2022-10-21 11:12 UTC (permalink / raw)


On Friday, October 21, 2022 at 6:05:17 PM UTC+11, Dmitry A. Kazakov wrote:
> On 2022-10-21 03:58, Roger Mc wrote: 
> > Test_Python builds Ok but execution fails with: 
> > Execution terminated by abort of environment task 
> > with no other output.
> [I never tested it under BSD] 
> 
> 1. Does the main test work? (components-python-test_python.gpr) 
> 
> 2. What are the scenarios, you use when building: 
> 
> arch 
> Atomic_Access 
> Target_OS 
> 
> Depending on that a version of py-load_python_library.adb is selected 
> which is responsible for loading the Python library. 
> 
> -- 
> Regards, 
> Dmitry A. Kazakov 
> http://www.dmitry-kazakov.de

Thanks Dmitry
components-python-test_python builds but execution fails with
Execution terminated by abort of environment task

arch x86-64
Atomic_Access auto
Target_OS OSX

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21 11:12   ` Roger Mc
@ 2022-10-21 12:46     ` Dmitry A. Kazakov
  2022-10-21 17:04       ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry A. Kazakov @ 2022-10-21 12:46 UTC (permalink / raw)


On 2022-10-21 13:12, Roger Mc wrote:
> On Friday, October 21, 2022 at 6:05:17 PM UTC+11, Dmitry A. Kazakov wrote:
>> On 2022-10-21 03:58, Roger Mc wrote:
>>> Test_Python builds Ok but execution fails with:
>>> Execution terminated by abort of environment task
>>> with no other output.
>> [I never tested it under BSD]
>>
>> 1. Does the main test work? (components-python-test_python.gpr)
>>
>> 2. What are the scenarios, you use when building:
>>
>> arch
>> Atomic_Access
>> Target_OS
>>
>> Depending on that a version of py-load_python_library.adb is selected
>> which is responsible for loading the Python library.
>>
> components-python-test_python builds but execution fails with
> Execution terminated by abort of environment task
> 
> arch x86-64
> Atomic_Access auto
> Target_OS OSX

This selects py-load_python_library.adb from os/pthread which is just a 
copy of os/linux. Likely there are differences between Linux and OSX. If 
you have time I could fix it by tracing locations causing the problem on 
your target. Mail me, if you want.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21 12:46     ` Dmitry A. Kazakov
@ 2022-10-21 17:04       ` Simon Wright
  2022-10-21 18:30         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2022-10-21 17:04 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> This selects py-load_python_library.adb from os/pthread which is just
> a copy of os/linux. Likely there are differences between Linux and
> OSX.

dlopen() would need to see e.g.

  $FRAMEWORKS/Python.framework/Python/Versions/3.8/lib/libpython3.8.dylib

where $FRAMEWORKS would normally be /Library/Frameworks but, in Roger's
case (running Homebrew), would be $HOMEBREW_PREFIX/Frameworks (Roger
might have frameworks scattered bewtween the two places, for added fun).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21 17:04       ` Simon Wright
@ 2022-10-21 18:30         ` Dmitry A. Kazakov
  2022-10-21 19:41           ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry A. Kazakov @ 2022-10-21 18:30 UTC (permalink / raw)


On 2022-10-21 19:04, Simon Wright wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> This selects py-load_python_library.adb from os/pthread which is just
>> a copy of os/linux. Likely there are differences between Linux and
>> OSX.
> 
> dlopen() would need to see e.g.
> 
>    $FRAMEWORKS/Python.framework/Python/Versions/3.8/lib/libpython3.8.dylib
> 
> where $FRAMEWORKS would normally be /Library/Frameworks but, in Roger's
> case (running Homebrew), would be $HOMEBREW_PREFIX/Frameworks (Roger
> might have frameworks scattered bewtween the two places, for added fun).

Thanks Simon.

Is the variable $FRAMEWORKS set or I have to search a whole set of 
subdirectories?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21 18:30         ` Dmitry A. Kazakov
@ 2022-10-21 19:41           ` Simon Wright
  2022-10-21 20:00             ` Dmitry A. Kazakov
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2022-10-21 19:41 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On 2022-10-21 19:04, Simon Wright wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>> 
>>> This selects py-load_python_library.adb from os/pthread which is just
>>> a copy of os/linux. Likely there are differences between Linux and
>>> OSX.
>> dlopen() would need to see e.g.
>>    $FRAMEWORKS/Python.framework/Python/Versions/3.8/lib/libpython3.8.dylib
>> where $FRAMEWORKS would normally be /Library/Frameworks but, in
>> Roger's
>> case (running Homebrew), would be $HOMEBREW_PREFIX/Frameworks (Roger
>> might have frameworks scattered bewtween the two places, for added fun).
>
> Thanks Simon.
>
> Is the variable $FRAMEWORKS set or I have to search a whole set of
> subdirectories?

It's not set; I'm not sure what the Homebrew version would look like,
but it's probably like /Library/Frameworks. And I left out Current,
which chooses between e.g. 3.8, 3.9.

libpython := '';
find_libpython:
for top in $HOMEBREW_PREFIX/Frameworks, /Library/Frameworks loop
   if exists $top/Python then
      libpython := $top/Python/Versions/Current/lib/libpython*.dylib;
      exit find_libpython;
   end if;
end loop find_libpython;
fail if libpython is still ''

==========

There is another macOS package manager, MacPorts, but I've settled on
Homebrew.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: components_4_64 Test_Python fails on Mac Monterey
  2022-10-21 19:41           ` Simon Wright
@ 2022-10-21 20:00             ` Dmitry A. Kazakov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry A. Kazakov @ 2022-10-21 20:00 UTC (permalink / raw)


On 2022-10-21 21:41, Simon Wright wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> On 2022-10-21 19:04, Simon Wright wrote:
>>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>>>
>>>> This selects py-load_python_library.adb from os/pthread which is just
>>>> a copy of os/linux. Likely there are differences between Linux and
>>>> OSX.
>>> dlopen() would need to see e.g.
>>>     $FRAMEWORKS/Python.framework/Python/Versions/3.8/lib/libpython3.8.dylib
>>> where $FRAMEWORKS would normally be /Library/Frameworks but, in
>>> Roger's
>>> case (running Homebrew), would be $HOMEBREW_PREFIX/Frameworks (Roger
>>> might have frameworks scattered bewtween the two places, for added fun).
>>
>> Thanks Simon.
>>
>> Is the variable $FRAMEWORKS set or I have to search a whole set of
>> subdirectories?
> 
> It's not set; I'm not sure what the Homebrew version would look like,
> but it's probably like /Library/Frameworks. And I left out Current,
> which chooses between e.g. 3.8, 3.9.
> 
> libpython := '';
> find_libpython:
> for top in $HOMEBREW_PREFIX/Frameworks, /Library/Frameworks loop
>     if exists $top/Python then
>        libpython := $top/Python/Versions/Current/lib/libpython*.dylib;
>        exit find_libpython;
>     end if;
> end loop find_libpython;
> fail if libpython is still ''
> 
> ==========
> 
> There is another macOS package manager, MacPorts, but I've settled on
> Homebrew.

I researched a little bit. Mac's Python is even more messy than Windows' 
one. That is an achievement of its own! (:-))

So far I come to the list

    /usr/lib
    /Library/Frameworks/Python.framework/Versions
    /sw/lib
    /opt/lib
    /opt/homebrew/lib

each to be searched recursively for the name:

    libpython3.*.dylib

P.S. It seems that I must check Julia bindings as well. So far it looks 
so that nobody ever used them on Mac.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-21 20:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  1:58 components_4_64 Test_Python fails on Mac Monterey Roger Mc
2022-10-21  7:05 ` Dmitry A. Kazakov
2022-10-21 11:12   ` Roger Mc
2022-10-21 12:46     ` Dmitry A. Kazakov
2022-10-21 17:04       ` Simon Wright
2022-10-21 18:30         ` Dmitry A. Kazakov
2022-10-21 19:41           ` Simon Wright
2022-10-21 20:00             ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox