Topics

Build only one python?

Larry Gritz
 

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

--
Larry Gritz
lg@...

Owen T.
 

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...

Larry Gritz
 

I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz




Nick Porcino
 

The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz






--
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982

darby johnston
 

You can do this with the CMake variables "CMAKE_DISABLE_FIND_PACKAGE_<PackageName>, as long as the find_package() calls don't have "REQUIRED" in them:



Darby


On Thursday, May 21, 2020, 5:15:04 PM PDT, Nick Porcino <nick.porcino@...> wrote:


The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz






--
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982

Larry Gritz
 

Precisely what I did today!



On May 21, 2020 5:14:48 p.m. PDT, Nick Porcino <nick.porcino@...> wrote:
The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz






--
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982


--
Larry Gritz
lg@...

Zach Lewis
 

tl;dr -- try specifying the desired interpreter path in the env var PYTHON_EXECUTABLE.

Larry, I'm experiencing very similar issues under very similar circumstances -- i.e., building for [["numpy-1.16", "python-2"], ["numpy-1.18","python-3"]] Rez variants. 

Here's my openexr package definition w/ build commands:

I'm mostly having luck with desired python executable as the environment variable $PYTHON_EXECUTABLE at build time. I'm using cmake-3.17, but i assume this will work with 3.12. I say 'mostly' cuz imathnumpy.so seems to get built but not actually installed; and although both python-2 and python-3 variants behave just fine on CentOS-7 and Ubuntu-18.04, the python-2.7 variant on osx-10.14.6 segfaults when importing iex or imath. (python-3.7 is fine). I can't tell if this is a me-problem or an everyone-problem. 

From what I've gathered from the CMake documentation (https://cmake.org/cmake/help/v3.17/module/FindPython.html#module:FindPython) I think the intention is to use either ('FindPython') OR  ('FindPython2' or 'FindPython3'), but not necessarily all three. I think 'FindPython' is probably the right way to go for PyIlmBase; and depending on the version of CMake used at build time, users can provide hints to guide CMake to choose the correct Python, or they can explicitly specify artifacts directly. 

With the above Rez package, the build process is able to find the right Python interpreter and an appropriate NumPy package; and then it proceeds to find a system Python and not find an importable NumPy (in my case; although even if the system interpreter were to find an importable numpy, you'd just end up building and installing extra libraries that never appear in the PYTHONPATH).

Hope this helps...



On Thu, May 21, 2020 at 8:15 PM Nick Porcino <nick.porcino@...> wrote:
The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz






--
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982

Larry Gritz
 

Ooh, thanks, Darby!

I did not know about that cmake variable. I do think that solves my problem and that I can abandon the changes I was about to submit.



On May 21, 2020, at 5:32 PM, darby johnston via lists.aswf.io <darbyjohnston=yahoo.com@...> wrote:

You can do this with the CMake variables "CMAKE_DISABLE_FIND_PACKAGE_<PackageName>, as long as the find_package() calls don't have "REQUIRED" in them:



Darby


On Thursday, May 21, 2020, 5:15:04 PM PDT, Nick Porcino <nick.porcino@...> wrote:


The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz








--
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982


--
Larry Gritz




Larry Gritz
 

Thanks, Zach. I really appreciate your sharing your package definition. I need to study it carefully, you do like 10 different things I didn't even know existed. :-)


On May 21, 2020, at 7:14 PM, Zach Lewis <zachcanbereached@...> wrote:

tl;dr -- try specifying the desired interpreter path in the env var PYTHON_EXECUTABLE.

Larry, I'm experiencing very similar issues under very similar circumstances -- i.e., building for [["numpy-1.16", "python-2"], ["numpy-1.18","python-3"]] Rez variants. 

Here's my openexr package definition w/ build commands:

I'm mostly having luck with desired python executable as the environment variable $PYTHON_EXECUTABLE at build time. I'm using cmake-3.17, but i assume this will work with 3.12. I say 'mostly' cuz imathnumpy.so seems to get built but not actually installed; and although both python-2 and python-3 variants behave just fine on CentOS-7 and Ubuntu-18.04, the python-2.7 variant on osx-10.14.6 segfaults when importing iex or imath. (python-3.7 is fine). I can't tell if this is a me-problem or an everyone-problem. 

From what I've gathered from the CMake documentation (https://cmake.org/cmake/help/v3.17/module/FindPython.html#module:FindPython) I think the intention is to use either ('FindPython') OR  ('FindPython2' or 'FindPython3'), but not necessarily all three. I think 'FindPython' is probably the right way to go for PyIlmBase; and depending on the version of CMake used at build time, users can provide hints to guide CMake to choose the correct Python, or they can explicitly specify artifacts directly. 

With the above Rez package, the build process is able to find the right Python interpreter and an appropriate NumPy package; and then it proceeds to find a system Python and not find an importable NumPy (in my case; although even if the system interpreter were to find an importable numpy, you'd just end up building and installing extra libraries that never appear in the PYTHONPATH).

Hope this helps...



On Thu, May 21, 2020 at 8:15 PM Nick Porcino <nick.porcino@...> wrote:
The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz








-- 
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982




--
Larry Gritz




Kimball Thurston
 

l-

I think for exr-next we should just delete the python 2/3 dual thing entirely. We've done our migration release that should allow people to experiment. I may not agree with the choices the python project made, but what's done is done, and I feel like the current exr release is fine to show how a migration can be done, and what the changes are that are necessary in the python code (for imath, not too many). Supporting both was neat to do, but also makes the cmake scripts significantly more complicated, so let's remove it.

But hopefully you've got things sorted w/ the existing release?

-k

On Fri, May 22, 2020 at 3:18 PM Larry Gritz <lg@...> wrote:
Thanks, Zach. I really appreciate your sharing your package definition. I need to study it carefully, you do like 10 different things I didn't even know existed. :-)


On May 21, 2020, at 7:14 PM, Zach Lewis <zachcanbereached@...> wrote:

tl;dr -- try specifying the desired interpreter path in the env var PYTHON_EXECUTABLE.

Larry, I'm experiencing very similar issues under very similar circumstances -- i.e., building for [["numpy-1.16", "python-2"], ["numpy-1.18","python-3"]] Rez variants. 

Here's my openexr package definition w/ build commands:

I'm mostly having luck with desired python executable as the environment variable $PYTHON_EXECUTABLE at build time. I'm using cmake-3.17, but i assume this will work with 3.12. I say 'mostly' cuz imathnumpy.so seems to get built but not actually installed; and although both python-2 and python-3 variants behave just fine on CentOS-7 and Ubuntu-18.04, the python-2.7 variant on osx-10.14.6 segfaults when importing iex or imath. (python-3.7 is fine). I can't tell if this is a me-problem or an everyone-problem. 

From what I've gathered from the CMake documentation (https://cmake.org/cmake/help/v3.17/module/FindPython.html#module:FindPython) I think the intention is to use either ('FindPython') OR  ('FindPython2' or 'FindPython3'), but not necessarily all three. I think 'FindPython' is probably the right way to go for PyIlmBase; and depending on the version of CMake used at build time, users can provide hints to guide CMake to choose the correct Python, or they can explicitly specify artifacts directly. 

With the above Rez package, the build process is able to find the right Python interpreter and an appropriate NumPy package; and then it proceeds to find a system Python and not find an importable NumPy (in my case; although even if the system interpreter were to find an importable numpy, you'd just end up building and installing extra libraries that never appear in the PYTHONPATH).

Hope this helps...



On Thu, May 21, 2020 at 8:15 PM Nick Porcino <nick.porcino@...> wrote:
The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz








-- 
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982




--
Larry Gritz




darby johnston
 

I actually just learned about those variables this week, so good timing with your question. :)


Darby


On Thursday, May 21, 2020, 8:14:37 PM PDT, Larry Gritz <lg@...> wrote:


Ooh, thanks, Darby!

I did not know about that cmake variable. I do think that solves my problem and that I can abandon the changes I was about to submit.



On May 21, 2020, at 5:32 PM, darby johnston via lists.aswf.io <darbyjohnston=yahoo.com@...> wrote:

You can do this with the CMake variables "CMAKE_DISABLE_FIND_PACKAGE_<PackageName>, as long as the find_package() calls don't have "REQUIRED" in them:



Darby


On Thursday, May 21, 2020, 5:15:04 PM PDT, Nick Porcino <nick.porcino@...> wrote:


The pattern I would like to see is CMake options that default to ON, that let us control whether find_package is invoked for each python.

For example:

-DPYILMBASE_PYTHON2=OFF -DPYILMBASE_PYTHON3=ON

would skip the python2 detection step.

The existing functionality is fine otherwise.

On Thu, May 21, 2020 at 4:49 PM Larry Gritz <lg@...> wrote:
I think it's quite common for people to want to build both (and/or "all" versions found on their system).

But in my case, I'm doing my builds inside a special Rez environment that is trying to expose only one python, so I do the python 2.7 and 3.7 variants as separate builds. But what's happening is that it's finding an unintended second Python in a system area somewhere, thinking "aha, I'll build that too", but there is not the right numpy and so it fails.

So here is a case where I want to be able to select just one python for a build and not have it go searching for the other.

Looks like I will need to add a couple options to add this capability and then submit as PR. (And, ugh, backport to 2.4, because we are still maintaining builds against that.)


On May 21, 2020, at 11:07 AM, Owen T. via lists.aswf.io <ownthmpsn=protonmail.ch@...> wrote:

One solution would be to skip Python2 whenever Python3 is detected, automatically. I have implemented this fix within a fork:

https://github.com/oxt3479/openexr

This actually saves a fair amount of time when building from what I can tell.
Is there any circumstance where building both of them would be necessary? Especially considering Python2 is no longer supported by its own maintainers?

You can see the precise difference here:
https://github.com/AcademySoftwareFoundation/openexr/compare/master...oxt3479:master

If the option to install both is important, it could be included in the new Imath. I am just not aware of when this functionality would be needed.

Owen Thompson
ownthmpsn@...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, May 20, 2020 8:06 PM, Larry Gritz <lg@...> wrote:

The cmake build system is nicely set up to build both python2 and python3 bindings for Imath.

But... is there an easy way that I can tell it "only build python2" or "only python3" on a particular build, even if the other could be found?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Larry Gritz
lg@...








--
Larry Gritz








--
--------------------------------
Nick Porcino @meshula
Virtual and augmented production, interactive applications, and robotics, since 1982


--
Larry Gritz