Skip to content
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

[chamcham] shared object naming causes install issues #421

Open
sanjayankur31 opened this issue Aug 27, 2020 · 4 comments
Open

[chamcham] shared object naming causes install issues #421

sanjayankur31 opened this issue Aug 27, 2020 · 4 comments

Comments

@sanjayankur31
Copy link

Hello,

I see that we look for the system suffix for the _moose.so shared object here:

https://github.com/BhallaLab/moose-core/blob/chamcham/python/setup.cmake.py#L36

While building on ppc64 on Fedora, this results in build failures because while the setup.py mentions _moose + suffix as the package data, the shared object that is compiled is still only _moose.so (without the suffix).

So, removing the bit that sets the ppc64 specific suffix fixes the build, but I'm not entirely sure if that's the right thing to do:
sanjayankur31@bf55271

You can see the failed build here, and I'm attaching the build logs too:
moose-3.1.5-1-ppc-build-log.txt

What do you think?

Cheers,
Ankur

@dilawar
Copy link
Contributor

dilawar commented Aug 27, 2020

Hi Ankur,

Since we don't officially support Windows, I guess .so is the least common denominator Linux, BSD and OSX?

Can you post the output of the following on ppc64le machine?

import importlib.machinery
res = importlib.machinery.EXTENSION_SUFFIXES
print(res)

Maybe it will be a good idea to change the expression of package_data={'moose': ['_moose' + suffix]}, to package_data={'moose': ['_moose*.so']}, or to a more generic pattern?

@sanjayankur31
Copy link
Author

Hello!

Thanks for the quick reply!

I'm afraid I don't know about WIndows either. On Linux, yes, .so should be the primary suffix.
The build log on the ppc64le machine says this:

[INFO] Suffix for python SO: .cpython-39-powerpc64le-linux-gnu.so

If the wildcard works, that would indeed be the cleanest solution.

dilawar pushed a commit to dilawar/pymoose-community that referenced this issue Aug 29, 2020
Instead of using the full name of module, use wildcard `_moose*.so` in the
`package_data` field. On some platforms, platform info is added between the name
and the suffix e.g. `.cpython-39-powerpc64le-linux-gnu.so`. Using `_moose*.so` will take
care of such cases.
@dilawar
Copy link
Contributor

dilawar commented Aug 29, 2020

dilawar@a044beb is an attempt to fix this.

hrani pushed a commit that referenced this issue Sep 8, 2020
* Fixes to #419

* A better fix to #419

dict `locals_` is not Py_XINCREF anywhere that is why Py_XDECREF caused segfault.
While `globals_` does not have this issue. In the previous fix c570f7c,
I removed the `Py_XINCREF(globals_)` line as well which would cause memory leak.

* Related to #421 | Use wildard in package_data

Instead of using the full name of module, use wildcard `_moose*.so` in the
`package_data` field. On some platforms, platform info is added between the name
and the suffix e.g. `.cpython-39-powerpc64le-linux-gnu.so`. Using `_moose*.so` will take
care of such cases.

Co-authored-by: Dilawar Singh <dilawars@ncbs.res.in>
@dilawar
Copy link
Contributor

dilawar commented Nov 15, 2020

I guess this can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants