conda-forge / ctng-compilers-feedstock

A conda-smithy repository for ctng-compilers.
BSD 3-Clause "New" or "Revised" License
12 stars 28 forks source link

Possible to add quadmath support for aarch64 Linux? #160

Closed matthewfeickert closed 1 week ago

matthewfeickert commented 1 week ago

Solution to issue cannot be found in the documentation.

Issue

From https://github.com/conda-forge/qcdloop-feedstock/pull/1 I've found that gcc_impl_linux-aarch64 does not currently support quadmath.

$ docker run --rm -ti --platform linux/aarch64 debian:bookworm
# uname -m
aarch64
# apt update && apt install -y curl
# curl -fsSL https://pixi.sh/install.sh | bash
# . /root/.bashrc
# mkdir debug && cd debug
# pixi init
# pixi add gcc
Added gcc >=14.2.0,<14.3
# pixi list
Package                       Version  Build         Size       Kind   Source
_openmp_mutex                 4.5      2_gnu         23.2 KiB   conda  _openmp_mutex-4.5-2_gnu.tar.bz2
binutils_impl_linux-aarch64   2.43     h4c662bb_2    6.4 MiB    conda  binutils_impl_linux-aarch64-2.43-h4c662bb_2.conda
gcc                           14.2.0   h89226b9_1    54.4 KiB   conda  gcc-14.2.0-h89226b9_1.conda
gcc_impl_linux-aarch64        14.2.0   hc4119dd_1    66.5 MiB   conda  gcc_impl_linux-aarch64-14.2.0-hc4119dd_1.conda
kernel-headers_linux-aarch64  4.18.0   h05a177a_18   1.1 MiB    conda  kernel-headers_linux-aarch64-4.18.0-h05a177a_18.conda
ld_impl_linux-aarch64         2.43     h80caac9_2    681.9 KiB  conda  ld_impl_linux-aarch64-2.43-h80caac9_2.conda
libgcc                        14.2.0   he277a41_1    522.7 KiB  conda  libgcc-14.2.0-he277a41_1.conda
libgcc-devel_linux-aarch64    14.2.0   h46490cb_101  2.1 MiB    conda  libgcc-devel_linux-aarch64-14.2.0-h46490cb_101.conda
libgomp                       14.2.0   he277a41_1    452.7 KiB  conda  libgomp-14.2.0-he277a41_1.conda
libsanitizer                  14.2.0   hff26f3d_1    4.2 MiB    conda  libsanitizer-14.2.0-hff26f3d_1.conda
libstdcxx                     14.2.0   h3f4de04_1    3.6 MiB    conda  libstdcxx-14.2.0-h3f4de04_1.conda
sysroot_linux-aarch64         2.17     h5b4a56d_18   14.9 MiB   conda  sysroot_linux-aarch64-2.17-h5b4a56d_18.conda
tzdata                        2024b    hc8b5060_0    119.5 KiB  conda  tzdata-2024b-hc8b5060_0.conda
# find . -type f -iname "*quadmath*"
./.pixi/envs/default/share/info/libquadmath.info

As quadmath is supported for linux-64 and linux-ppc64le is it possible to support for linux-aarch64?

linux/x86_64 comparison: ```console $ docker run --rm -ti --platform linux/x86_64 debian:bookworm # uname -m x86_64 # apt update && apt install -y curl # curl -fsSL https://pixi.sh/install.sh | bash # . /root/.bashrc # mkdir debug && cd debug # pixi init # pixi add gcc Added gcc >=14.2.0,<14.3 # pixi list Package Version Build Size Kind Source _libgcc_mutex 0.1 conda_forge 2.5 KiB conda _libgcc_mutex-0.1-conda_forge.tar.bz2 _openmp_mutex 4.5 2_gnu 23.1 KiB conda _openmp_mutex-4.5-2_gnu.tar.bz2 binutils_impl_linux-64 2.43 h4bf12b8_2 5.4 MiB conda binutils_impl_linux-64-2.43-h4bf12b8_2.conda gcc 14.2.0 h96c4ede_1 54.5 KiB conda gcc-14.2.0-h96c4ede_1.conda gcc_impl_linux-64 14.2.0 h6b349bd_1 69.1 MiB conda gcc_impl_linux-64-14.2.0-h6b349bd_1.conda kernel-headers_linux-64 3.10.0 he073ed8_18 921.4 KiB conda kernel-headers_linux-64-3.10.0-he073ed8_18.conda ld_impl_linux-64 2.43 h712a8e2_2 653.5 KiB conda ld_impl_linux-64-2.43-h712a8e2_2.conda libgcc 14.2.0 h77fa898_1 828.9 KiB conda libgcc-14.2.0-h77fa898_1.conda libgcc-devel_linux-64 14.2.0 h41c2201_101 2.6 MiB conda libgcc-devel_linux-64-14.2.0-h41c2201_101.conda libgomp 14.2.0 h77fa898_1 450.2 KiB conda libgomp-14.2.0-h77fa898_1.conda libsanitizer 14.2.0 h2a3dede_1 4.3 MiB conda libsanitizer-14.2.0-h2a3dede_1.conda libstdcxx 14.2.0 hc0a3c3a_1 3.7 MiB conda libstdcxx-14.2.0-hc0a3c3a_1.conda sysroot_linux-64 2.17 h4a8ded7_18 14.8 MiB conda sysroot_linux-64-2.17-h4a8ded7_18.conda tzdata 2024b hc8b5060_0 119.5 KiB conda tzdata-2024b-hc8b5060_0.conda # find . -type f -iname "*quadmath*" ./.pixi/envs/default/lib/gcc/x86_64-conda-linux-gnu/14.2.0/libquadmath.a ./.pixi/envs/default/lib/gcc/x86_64-conda-linux-gnu/14.2.0/include/quadmath_weak.h ./.pixi/envs/default/lib/gcc/x86_64-conda-linux-gnu/14.2.0/include/quadmath.h ./.pixi/envs/default/lib/libquadmath.so.0.0.0 ./.pixi/envs/default/share/info/libquadmath.info ```

Installed packages

# pixi list
Package                       Version  Build         Size       Kind   Source
_openmp_mutex                 4.5      2_gnu         23.2 KiB   conda  _openmp_mutex-4.5-2_gnu.tar.bz2
binutils_impl_linux-aarch64   2.43     h4c662bb_2    6.4 MiB    conda  binutils_impl_linux-aarch64-2.43-h4c662bb_2.conda
gcc                           14.2.0   h89226b9_1    54.4 KiB   conda  gcc-14.2.0-h89226b9_1.conda
gcc_impl_linux-aarch64        14.2.0   hc4119dd_1    66.5 MiB   conda  gcc_impl_linux-aarch64-14.2.0-hc4119dd_1.conda
kernel-headers_linux-aarch64  4.18.0   h05a177a_18   1.1 MiB    conda  kernel-headers_linux-aarch64-4.18.0-h05a177a_18.conda
ld_impl_linux-aarch64         2.43     h80caac9_2    681.9 KiB  conda  ld_impl_linux-aarch64-2.43-h80caac9_2.conda
libgcc                        14.2.0   he277a41_1    522.7 KiB  conda  libgcc-14.2.0-he277a41_1.conda
libgcc-devel_linux-aarch64    14.2.0   h46490cb_101  2.1 MiB    conda  libgcc-devel_linux-aarch64-14.2.0-h46490cb_101.conda
libgomp                       14.2.0   he277a41_1    452.7 KiB  conda  libgomp-14.2.0-he277a41_1.conda
libsanitizer                  14.2.0   hff26f3d_1    4.2 MiB    conda  libsanitizer-14.2.0-hff26f3d_1.conda
libstdcxx                     14.2.0   h3f4de04_1    3.6 MiB    conda  libstdcxx-14.2.0-h3f4de04_1.conda
sysroot_linux-aarch64         2.17     h5b4a56d_18   14.9 MiB   conda  sysroot_linux-aarch64-2.17-h5b4a56d_18.conda
tzdata                        2024b    hc8b5060_0    119.5 KiB  conda  tzdata-2024b-hc8b5060_0.conda

Environment info

# pixi info
System
------------
      Pixi version: 0.36.0
          Platform: linux-aarch64
  Virtual packages: __unix=0=0
                  : __linux=6.10.11=0
                  : __glibc=2.36=0
                  : __archspec=1=m1
         Cache dir: /root/.cache/rattler/cache
      Auth storage: /root/.rattler/credentials.json
  Config locations: No config files found

Global
------------
           Bin dir: /root/.pixi/bin
   Environment dir: /root/.pixi/envs
      Manifest dir: /root/.pixi/manifests/pixi-global.toml

Project
------------
              Name: debug
           Version: 0.1.0
     Manifest file: /debug/pixi.toml
      Last updated: 14-11-2024 21:05:32

Environments
------------
       Environment: default
          Features: default
          Channels: conda-forge
  Dependency count: 1
      Dependencies: gcc
  Target platforms: linux-aarch64
matthewfeickert commented 1 week ago

Pinging @isuruf on this as I think they might know how feasible this is in general.

isuruf commented 1 week ago

quadmath is not available on aarch64 as aarch64 has a native __float128 type.

matthewfeickert commented 1 week ago

Thanks @isuruf. Closing this, as there's not a path forward.

I haven't given this any thought, but if you have any off the top of your head ideas on how to take code that needs quadmath on x86 and make it also work on aarch64 I'd be interested.

matthewfeickert commented 7 hours ago

@isuruf Just to check that I understand correctly, as

aarch64 has a native __float128 type.

then as quadmath defines its own __float128 constants, as aarch64 already defines __float128, the responsibility would be on quadmath to add support aarch64, correct? It isn't just a matter of having programs that normally use quadmath check for the platform and disable quadmath at compile time to use aarch64's __float128 types instead?