-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake improvements and fixes #102
cmake improvements and fixes #102
Conversation
I assume the reason for the removal of several chunks is that they are redundant with the Imath setup? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Let's get some more eyes on it before landing.
Yes, these snippets are all defined in Imath/config/ImathSetup.cmake. |
src/python/PyImath.pc.in
Outdated
@@ -12,5 +12,5 @@ libsuffix=@LIB_SUFFIX_DASH@ | |||
Name: PyImath | |||
Description: Python bindings for the Imath libraries | |||
Version: @IMATH_VERSION@ | |||
Libs: -L${libdir} -lImath${libsuffix} -lPyImath${libsuffix} | |||
Libs: -L${libdir} -lImath${libsuffix} -lPyImath@PYIMATH_LIB_PYTHONVER_ROOT@@Python3_VERSION_MAJOR@_@Python3_VERSION_MINOR@${libsuffix} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me. But shouldn't the reference to "Python3" be agnostic regarding 3 vs 2? Will this work for python2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I doubt this works with python2, although I haven't tested it.
Can I safely assume, that Imath only supports one python version at any time, i.e. no parallel installations of e.g. libPyImath_Python2_7-3_0.so and libPyImath_Python3_8-3_0.so?
If so, we could add a variable, something like PYIMATH_PYTHON_SUFFIX in the blocks at https://github.com/AcademySoftwareFoundation/Imath/blob/master/src/python/CMakeLists.txt#L106 and line 114, by using the PYIMATH_LIB_PYTHONVER_ROOT
and corresponding Python{2,3}_VERSION_{MAJOR,MINOR}
vars and substitue this one variable in PyImath.pc.in. What do you think?
47e37d0
to
f60690f
Compare
This patch works for python3. |
I tested this change with python2 and it indeed produces an incorrect .pc file that references a "-lPyImath_Python3" library. But don't we actually need two pkg-config files, one for python2 and one for python3? The CMake files are currently set up to build for both if both are installed, so in this case a single .pc file won't do. |
This only works if build for one python version. If both are build, the set statement in the python3 block will override the setting from the python2 block. |
f60690f
to
e31e93f
Compare
Revert the last patch. |
#103 removed the PYIMATH_ENABLE_EXCEPTIONS option, which is conflicting here, can you fix that? Our emerging consensus is that we'd like to simplify this further by eliminating the dual simultaneous build and instead build for a single python version, with a configuration variable to specify which. But this PR is a good step in that direction and improves the current state dramatically. I'll merge it in if you can resolve the conflict, and we'll go from there. Thanks for the contributions. |
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Bug: AcademySoftwareFoundation#101 Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
e31e93f
to
b3ecb9a
Compare
Rebased and fixed the conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes some of the issues in #101
I've not yet found the source of whyimathnumpy.so
is going to get installed.Looks like the missing install call has been the source for this.