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

BUG: _sysconfigdata__linux_aarch64-linux-gnu.py contains invalid compiler options in CFLAGS #13106

Closed
6 of 8 tasks
geoffreyblake opened this issue Dec 9, 2022 · 4 comments
Closed
6 of 8 tasks

Comments

@geoffreyblake
Copy link

geoffreyblake commented Dec 9, 2022

Checklist

  • I added a descriptive title.
  • I searched through existing issues and couldn't find a solution or duplicate issue.
  • I searched on the web (e.g. Google) and didn't find any helpful information.
  • I searched the Anaconda documentation and didn't find any helpful information.

Impacted product

  • A conda package (built by Anaconda)
  • Anaconda Distribution (formerly Anaconda Individual Edition)
  • Miniconda
  • Anaconda.org

What happened?

Downloaded and installed Miniconda3-latest-Linux-aarch64.sh on an Ubuntu 20.04 VM on Graviton2 and discovered that certain Python packages with binary dependencies will not install properly due to bad CFLAGS directives causing compiler errors in the distribution's lib/_sysconfigdata__linux_aarch64-linux-gnu.py file that is used by setuptools and distutils to compile python modules from source.

Inspecting this file I see mal-formed compiler directives for AWS Graviton instances:

  • -n1 -> -mcpu=neoverse-n1
  • .2-a+fp16+rcpc+dotprod+crypto -> -march=armv8.2-a+fp16+rcpc+dotprod+crypto

Others have seen this behavior: https://stackoverflow.com/questions/74739356/python-cant-install-ta-lib-in-oracle-arm64-vm-ubuntu-20-04

The workaround is use the system python.

Expected behavior or outcome

The vended Miniconda and Anaconda distributions should come with well formed information in lib/_sysconfigdata__linux_aarch64-linux-gnu.py so it can used in the same way as any python distribution.

Conda info

active environment : base
    active env location : /home/ubuntu/miniconda3
            shell level : 1
       user config file : /home/ubuntu/.condarc
 populated config files :
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.9.12.final.0
       virtual packages : __linux=5.15.0=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=aarch64
       base environment : /home/ubuntu/miniconda3  (writable)
      conda av data dir : /home/ubuntu/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-aarch64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-aarch64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/ubuntu/miniconda3/pkgs
                          /home/ubuntu/.conda/pkgs
       envs directories : /home/ubuntu/miniconda3/envs
                          /home/ubuntu/.conda/envs
               platform : linux-aarch64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.12 Linux/5.15.0-1026-aws ubuntu/20.04.5 glibc/2.31
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False


### Conda config

```shell
I get no output

Conda list

# packages in environment at /home/ubuntu/miniconda3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
_openmp_mutex             5.1                      51_gnu    defaults
brotlipy                  0.7.0           py39hfd63f10_1002    defaults
ca-certificates           2022.3.29            hd43f75c_1    defaults
certifi                   2021.10.8        py39hd43f75c_2    defaults
cffi                      1.15.0           py39h9a3cfec_1    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
colorama                  0.4.4              pyhd3eb1b0_0    defaults
conda                     4.12.0           py39hd43f75c_0    defaults
conda-content-trust       0.1.1              pyhd3eb1b0_0    defaults
conda-package-handling    1.8.1            py39h2f4d8fa_0    defaults
cryptography              36.0.0           py39h3d58568_0    defaults
idna                      3.3                pyhd3eb1b0_0    defaults
ld_impl_linux-aarch64     2.36.1               h0ab8de2_3    defaults
libffi                    3.3                  h7c1a80f_2    defaults
libgcc-ng                 10.2.0              h1234567_51    defaults
libgomp                   10.2.0              h1234567_51    defaults
libstdcxx-ng              10.2.0              h1234567_51    defaults
ncurses                   6.3                  h2f4d8fa_2    defaults
openssl                   1.1.1n               h2f4d8fa_0    defaults
pip                       22.3.1                   pypi_0    pypi
pycosat                   0.6.3            py39hfd63f10_2    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pyopenssl                 22.0.0             pyhd3eb1b0_0    defaults
pysocks                   1.7.1            py39hd43f75c_0    defaults
python                    3.9.12               hc137634_0    defaults
readline                  8.1.2                h2f4d8fa_1    defaults
requests                  2.27.1             pyhd3eb1b0_0    defaults
ruamel_yaml               0.15.100         py39h2f4d8fa_0    defaults
setuptools                65.6.3                   pypi_0    pypi
six                       1.16.0             pyhd3eb1b0_1    defaults
sqlite                    3.38.2               h6632b73_0    defaults
tk                        8.6.11               h241ca14_0    defaults
tqdm                      4.63.0             pyhd3eb1b0_0    defaults
tzdata                    2022a                hda174b7_0    defaults
urllib3                   1.26.8             pyhd3eb1b0_0    defaults
wheel                     0.37.1             pyhd3eb1b0_0    defaults
xz                        5.2.5                hfd63f10_1    defaults
yaml                      0.2.5                hfd63f10_0    defaults
zlib                      1.2.12               h2f4d8fa_1    defaults

Additional information

No response

@geoffreyblake
Copy link
Author

There is a _sysconfigdata__linux_aarch64-linux-gnu.py.orig in the same directory as the bad _sysconfigdata__linux_aarch64-linux-gnu.py file and that appears to have properly formed compiler directives. Why is there an .orig file in the release build? Was there a bad merge?

@AndrewVallette
Copy link

Thank you for reporting this issue, Geoffrey. We are investigating.

@AndrewVallette
Copy link

There was indeed an issue with a previous python 3.9.12 package (build hc137634_0) for linux-aarch64, which was included in older Miniconda installers.

To resolve this issue, you can upgrade to the latest Miniconda release (22.11.1-1), which can be downloaded here: https://docs.conda.io/en/latest/miniconda.html

You can then install the new Miniconda with the following command:
bash Miniconda3-latest-Linux-aarch64.sh

Alternatively, if you wish to stay with an existing Miniconda installation, you can upgrade python with conda update python, and this should also resolve the issue. The latest python version for linux-aarch64 is currently 3.9.15 build h89984f6_2.

@AndrewVallette AndrewVallette self-assigned this Jan 6, 2023
@geoffreyblake
Copy link
Author

Thanks @AndrewVallette for the speedy work, the problem is fixed.

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

No branches or pull requests

3 participants