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

graviton gcc flags break pip install #208

Closed
liquidcarbon opened this issue Mar 29, 2022 · 4 comments
Closed

graviton gcc flags break pip install #208

liquidcarbon opened this issue Mar 29, 2022 · 4 comments

Comments

@liquidcarbon
Copy link

I'm running into trouble with C-dependent python packages, specifically psutil on Amazon Linux 2 x2gd.large

It seems like it was meaning to run gcc -march=armv8.2-a+fp16+rcpc+dotprod+crypto _some_target_, but instead an extra space sneaked in and the whole .2-a+fp16+rcpc etc. part fell off. Anyone knows how to get around this?

  Command ['/home/ec2-user/.cache/pypoetry/virtualenvs/env-FCAoHQDC-py3.9/bin/pip', 'install', '--no-deps', 'file:///home/ec2-user/.cache/pypoetry/artifacts/b1/56/ea/8f76ac8e3267dcd0b251a107803fa457585315936bb70ef39c1775c7d1/psutil-5.9.0.tar.gz'] errored with the following return code 1, and output:
  Processing /home/ec2-user/.cache/pypoetry/artifacts/b1/56/ea/8f76ac8e3267dcd0b251a107803fa457585315936bb70ef39c1775c7d1/psutil-5.9.0.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'
  Building wheels for collected packages: psutil
    Building wheel for psutil (setup.py): started
    Building wheel for psutil (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [10 lines of output]
        running bdist_wheel
        running build
        running build_py
        running build_ext
        building 'psutil._psutil_linux' extension
        gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
        gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
        gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
        gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
        error: command '/usr/bin/gcc' failed with exit code 1
        [end of output]
@liquidcarbon liquidcarbon changed the title gcc flags graviton gcc flags break pip install Mar 29, 2022
@AGSaidi
Copy link
Member

AGSaidi commented Mar 30, 2022

I tried setting CFLAGS manually and installing psutil on AL2 and it seems to work. Node that GCC7 (the default) on AL2 doesn't recognize rcpc

$ sudo yum install "@Development tools" python3-pip python3-devel
$ python3 -m pip install --user --upgrade pip
$ export CFLAGS="-march=armv8.2-a+fp16+crypto"
$ pip install    --force-reinstall psutil
Defaulting to user installation because normal site-packages is not writeable
Collecting psutil
  Using cached psutil-5.9.0.tar.gz (478 kB)
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Installing collected packages: psutil
  Attempting uninstall: psutil
    Found existing installation: psutil 5.9.0
    Uninstalling psutil-5.9.0:
      Successfully uninstalled psutil-5.9.0
  Running setup.py install for psutil ... done
Successfully installed psutil-5.9.0

@tbbharaj
Copy link

Was able to install psutil on AL2:

$ sudo yum install "@Development tools" python3-devel
$ python3 -m pip install psutil --no-cache-dir
Defaulting to user installation because normal site-packages is not writeable
Collecting psutil
  Downloading psutil-5.9.0.tar.gz (478 kB)
     |████████████████████████████████| 478 kB 26.2 MB/s 
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Installing collected packages: psutil
    Running setup.py install for psutil ... done
Successfully installed psutil-5.9.0

Also doing make install on psutil repo was successful

@sebpop
Copy link
Contributor

sebpop commented Mar 31, 2022

@liquidcarbon were you able to get psutil installed with pip on Graviton AL2?
If you still see the error, please post detailed steps on how to reproduce the issue.
Thanks!

@liquidcarbon
Copy link
Author

Thanks everyone for replies. I reverted to x86 for now but if we need to move to Graviton I feel like there's enough pointers here. Feel free to close.

@sebpop sebpop closed this as completed Mar 31, 2022
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

4 participants