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

PowerPC64LE support #366

Closed
programmerjake opened this issue Oct 22, 2020 · 10 comments
Closed

PowerPC64LE support #366

programmerjake opened this issue Oct 22, 2020 · 10 comments

Comments

@programmerjake
Copy link
Contributor

Wheel name numpy-1.19.2-cp38-cp38-linux_ppc64le.whl
.so name lapack_lite.cpython-38-powerpc64le-linux-gnu.so

python-sysconfig.txt

I have to install maturin using:

cargo install maturin --no-default-features --features=auditwheel,log,human-panic

since ring doesn't support powerpc64le-unknown-linux-gnu: briansmith/ring#389 (comment)

@mzpqnxow
Copy link
Contributor

mzpqnxow commented Oct 24, 2020

I tried replacing the check_call arguments in setup.py with:

                ["cargo", "rustc", "--bin", "maturin", "--", "-C", "link-arg=-s", '--no-default-features', '--features=auditwheel,log,human-panic']

But no luck, same error. I also pulled the latest stable rustc, same issue:

rustc 1.47.0 (18bf6b4f0 2020-10-07)

Updated to a nightly toolchain, same issue:

cargo 1.49.0-nightly (dd83ae55c 2020-10-20)
rustc 1.49.0-nightly (7bade6ef7 2020-10-23)

@mzpqnxow
Copy link
Contributor

@programmerjake I think I figured it out.. sorry for bugging you ;)

I ended up using your command to install maturin, then commenting out the check_call in setup.py, then modifying the path in the file copy function to point at the maturin that was already installed and that seems to take care of it..

@mzpqnxow
Copy link
Contributor

For anyone else having this issue, a more explicit explanation of the solution from @programmerjake

$ cat > maturin-setuptools.patch << 'EOF'
--- ../setup.py	2020-08-17 14:47:52.000000000 +0000
+++ setup.py	2020-10-24 21:25:06.074357597 +0000
@@ -56,9 +56,10 @@
                     "(https://www.rust-lang.org/tools/install) and try again"
                 )
             subprocess.check_call(
-                ["cargo", "rustc", "--bin", "maturin", "--", "-C", "link-arg=-s"]
-            )
+                 ['cargo', 'install', 'maturin', '--no-default-features', '--features=auditwheel,log,human-panic'])
             source = os.path.join(source_dir, "target", "debug", executable_name)
+            source = os.path.join(os.getenv('HOME'), '.cargo', 'bin', 'maturin')
+
         # run this after trying to build with cargo (as otherwise this leaves
         # venv in a bad state: https://github.com/benfred/py-spy/issues/69)
         install.run(self)
EOF
$ pip download maturin==0.8.3  # or whatever version you need- orjson wants 0.8.3<0.9
$ mkdir build-maturin && cd build-maturin && tar -xvzf ../maturin-0.8.3.tar.gz
$ patch -p1 < ../maturin-setuptools.patch
$ pip install .

Thanks again @programmerjake for the help, I thought I was stuck until the AES-GCM code was fixed in ring :)

@mzpqnxow
Copy link
Contributor

@programmerjake so I was able to get what I needed working (though it required a lot more hacking on the package I was building, which had a dependency on simd - at least I learned some rust ..) but I needed to make a patch to run-time logic in maturin because it refused to attempt to build anything without adding explicit "support" for ppc64le

I put in a PR (#367) that patches the run-time architecture check in case it's helpful to you. That change (plus the one in setup.py) was enough to be able to successfully build orjson (and it works)

konstin added a commit that referenced this issue Nov 10, 2020
Add ppc64le/POWERPC64 as a "supported" target (issue #366)
@konstin
Copy link
Member

konstin commented Nov 10, 2020

Does #367 fix this?

@programmerjake
Copy link
Contributor Author

Yes, though not completely, we're still blocked on ring gaining PowerPC64LE support, since that's required for enabling all the default features.

@mzpqnxow
Copy link
Contributor

mzpqnxow commented Nov 14, 2020

Yes, though not completely, we're still blocked on ring gaining PowerPC64LE support, since that's required for enabling all the default features.

And I'm not expecting that being resolved any time soon. That AES thread has been open for quite a while and seems to have stalled out :/

Though the current state of things works well enough for me

For posterity, the ring issue is briansmith/ring#389

@mzpqnxow
Copy link
Contributor

@konstin are you planning on releasing 0.9.0b1 to PyPi? Or are you waiting until you have a stable 0.9 release?

@konstin
Copy link
Member

konstin commented Jan 14, 2021

Sorry it took so long, but there's a stable 0.9.0 release now

@konstin konstin closed this as completed Jan 14, 2021
@mzpqnxow
Copy link
Contributor

mzpqnxow commented Feb 6, 2021

Thanks!

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

3 participants