TileDB-Inc/TileDB-Py

Provide Linux wheels for aarch64

Opened this issue · 8 comments

Hello,

Would it be possible to start providing Linux wheels for aarch64? These aarch64 machines are often much cheaper to lease on cloud services, and it appears to be non-trivial to build the wheels via pip install. Thanks.

Hello Brian,

Thank you for reaching out. We will evaluate whether it makes sense for us to provide wheels for Linux aarch64 at that point of time. In the meantime, could you let us know about any errors/problems you encounter when installing from the source distribution?

Thanks!


[sc-50707]

Thanks for opening the issue - also wanted to note that we do currently provide aarch64 packages via conda-forge: https://anaconda.org/conda-forge/tiledb/files

Thanks for opening the issue - also wanted to note that we do currently provide aarch64 packages via conda-forge: https://anaconda.org/conda-forge/tiledb/files

Thank you, this is good to know for others. However, then deploying applications to containers, I usually avoid conda if I can manage as it can greatly increase image sizes.

Hello Brian,

Thank you for reaching out. We will evaluate whether it makes sense for us to provide wheels for Linux aarch64 at that point of time. In the meantime, could you let us know about any errors/problems you encounter when installing from the source distribution?

Thanks!

[sc-50707]

Hello Agisilaos,

Assuming one has a base container image that builds libtiledb, building the Python wheel pretty much just works. The only problem I ran into was that my libtiledb gets installed to /lib, even though I pass --prefix=/usr to bootstrap. This means that when building the tiledb wheel, the compiler is looking for include files in /lib/include/tiledb, which is...odd. Unfortunately, when I build libtiledb the includes get installed to /usr/include/tiledb (where I would expect them to be installed by using /usr as the prefix). I can get around this in my image build by symlinking, but it's messy.

The bigger point however is that on x86_64, I can just pip install tiledb and it works without having to build my own libtiledb, so my image size can be much smaller as I don't need to have a compiler, etc. installed.

Let me know if there is any way I can help getting Linux aarch64 wheels going.

Thanks,

Brian

The only problem I ran into was that my libtiledb gets installed to /lib, even though I pass --prefix=/usr to bootstrap.

What steps are you running up to this point - are you building libtiledb separately or via the wheel build?

The only problem I ran into was that my libtiledb gets installed to /lib, even though I pass --prefix=/usr to bootstrap.

What steps are you running up to this point - are you building libtiledb separately or via the wheel build?

I am building libtiledb separately. Here are the relevant bits of my base Dockerfile:

FROM debian:bookworm-slim AS builder

# Install dependencies
RUN apt-get update && \
    apt-get install -y git build-essential cmake ninja-build openssh-client \
    curl zip unzip tar \
    libglib2.0-dev \
    libboost-date-time1.81-dev \
    libboost-filesystem1.81-dev \
    libboost-system1.81-dev \
    libxml2-dev \
    libsqlitecpp-dev \
    libutfcpp-dev \
    libproj-dev \
    libgsf-1-dev \
    libcurl4-openssl-dev \
    libssl-dev \
    uuid-dev \
    zlib1g-dev \
    libpulse-dev \
    wget

...

# Install vcpkg since TileDB uses it for installing its dependencies
WORKDIR /tmp
RUN git clone https://github.com/microsoft/vcpkg && \
    export CC=gcc && \
    export CXX=g++ && \
    export VCPKG_FORCE_SYSTEM_BINARIES=1 && \
    ./vcpkg/bootstrap-vcpkg.sh

# Install TileDB
WORKDIR /tmp
# Note: Make sure TileDB version here matches the underlying version used by TileDB-Py used elsewhere
RUN git clone https://github.com/TileDB-Inc/TileDB.git -b 2.23.0
WORKDIR /tmp/TileDB
RUN mkdir build && \
    cd build && \
    export AWSSDK_ROOT_DIR=/usr/ && \
    export VCPKG_ROOT=/tmp/vcpkg && \
    export CC=gcc && \
    export CXX=g++ && \
    export VCPKG_FORCE_SYSTEM_BINARIES=1 && \
    ../bootstrap \
        --disable-tests \
        --prefix=/usr \
        --enable-verbose \
        --enable-s3 \
        --enable-serialization \
        --enable=${enable} && \
    make -j$(nproc) && \
    make install-tiledb
RUN rm -rf /tmp/TileDB

...

Hi, it would like to add a vote for linux aarch64 wheels.

I am trying to use tiledb within an ubuntu docker container running on an aarch64 on M3 Macbook Pro. When doing pip install tiledb it triggers a build that fails with the error below. It's not clear to me what is the cause of this issue, afaiu the linker is failing but i don't see why or how to fix it. Since my project builds a package with a pyproject.toml it would be much easier not to need the build step.

ubuntu@1f691b1b13fe:~$ test/bin/pip3 install tiledb
Collecting tiledb
  Downloading tiledb-0.31.1.tar.gz (365 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 365.9/365.9 kB 6.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy>=1.25 (from tiledb)
  Using cached numpy-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (62 kB)
Using cached numpy-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.7 MB)
Building wheels for collected packages: tiledb
  Building wheel for tiledb (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for tiledb (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [154 lines of output]
      *** scikit-build-core 0.10.5 using CMake 3.30.3 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmpi57ckl70/build/CMakeInit.txt
      -- The C compiler identification is GNU 13.2.0
      -- The CXX compiler identification is GNU 13.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /home/ubuntu/test/bin/python3 (found version "3.12.3") found components: Interpreter Development.Module NumPy
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Found pybind11: /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include (found version "2.13.5")
      -- Downloading TileDB default version ...
      -- [download 100% complete]
      -- Using libtiledb path: /tmp/tmpi57ckl70/build/_deps/tiledb-src/lib/cmake/TileDB
      -- Adding "libtiledb" into install group
      -- Configuring done (5.8s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/tmpi57ckl70/build
      *** Building project with Ninja...
      [1/33] Building CXX object tiledb/CMakeFiles/main.dir/util.cc.o
      [2/33] Building CXX object tiledb/CMakeFiles/main.dir/main.cc.o
      [3/33] Building CXX object tiledb/CMakeFiles/main.dir/tests/test_webp.cc.o
      [4/33] Generating libtiledb.cc
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/libtiledb.pxd
        tree = Parsing.p_module(s, pxd, full_module_name)
      [5/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/common.cc.o
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.cc: In function ‘tiledb_datatype_t np_to_tdb_dtype(pybind11::dtype)’:
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.cc:156:26: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
        156 |   if (kind == py::str("S"))
            |                          ^
      In file included from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/detail/type_caster_base.h:12,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/cast.h:15,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/attr.h:14,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/detail/class.h:12,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:13,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/numpy.h:12,
                       from /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.h:4,
                       from /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.cc:1:
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pytypes.h:299:10: note: declared here
        299 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
            |          ^~~~~~~~
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.cc:158:26: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
        158 |   if (kind == py::str("U"))
            |                          ^
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pytypes.h:299:10: note: declared here
        299 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
            |          ^~~~~~~~
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.cc: In function ‘pybind11::size_t get_ncells(pybind11::dtype)’:
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/common.cc:195:28: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
        195 |   if (type == py::dtype("S"))
            |                            ^
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pytypes.h:299:10: note: declared here
        299 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
            |          ^~~~~~~~
      [6/33] Building CXX object tiledb/CMakeFiles/main.dir/tests/test_serialization.cc.o
      [7/33] Building CXX object tiledb/CMakeFiles/main.dir/npbuffer.cc.o
      [8/33] Building CXX object tiledb/CMakeFiles/main.dir/schema_evolution.cc.o
      [9/33] Building CXX object tiledb/CMakeFiles/main.dir/fragment.cc.o
      [10/33] Building CXX object tiledb/CMakeFiles/main.dir/tests/test_metadata.cc.o
      [11/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/array.cc.o
      [12/33] Building CXX object tiledb/CMakeFiles/main.dir/serialization.cc.o
      [13/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/attribute.cc.o
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/attribute.cc: In function ‘pybind11::array libtiledbcpp::get_fill_value(tiledb::Attribute&)’:
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/attribute.cc:50:54: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
         50 |   if (py::str(value_type.attr("kind")) == py::str("V")) {
            |                                                      ^
      In file included from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/detail/type_caster_base.h:12,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/cast.h:15,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/attr.h:14,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/detail/class.h:12,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pybind11.h:13,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/numpy.h:12,
                       from /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/attribute.cc:4:
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pytypes.h:299:10: note: declared here
        299 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
            |          ^~~~~~~~
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/attribute.cc:55:42: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
         55 |   if (value_type == py::dtype("complex64") ||
            |                                          ^
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pytypes.h:299:10: note: declared here
        299 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
            |          ^~~~~~~~
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/attribute.cc:56:43: warning: ‘bool pybind11::handle::operator==(const pybind11::handle&) const’ is deprecated: Use obj1.is(obj2) instead [-Wdeprecated-declarations]
         56 |       value_type == py::dtype("complex128")) {
            |                                           ^
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/pybind11/include/pybind11/pytypes.h:299:10: note: declared here
        299 |     bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }
            |          ^~~~~~~~
      [14/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/consolidation_plan.cc.o
      [15/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/context.cc.o
      [16/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/dimension_label.cc.o
      [17/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/domain.cc.o
      In file included from /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/domain.h:40,
                       from /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/array_schema.h:39,
                       from /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/array.h:38,
                       from /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/tiledb:49,
                       from /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/domain.cc:1:
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h: In instantiation of ‘std::pair<_FIter, _FIter> tiledb::Dimension::domain() const [with T = double]’:
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/domain.cc:97:44:   required from here
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h:159:19: note: parameter passing for argument of type ‘std::pair<double, double>’ when C++17 is enabled changed to match C++14 in GCC 10.1
        159 |   std::pair<T, T> domain() const {
            |                   ^~~~~~
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h: In instantiation of ‘std::pair<_FIter, _FIter> tiledb::Dimension::domain() const [with T = float]’:
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/domain.cc:101:43:   required from here
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h:159:19: note: parameter passing for argument of type ‘std::pair<float, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/domain.cc: In lambda function:
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/domain.cc:97:45: note: parameter passing for argument of type ‘std::pair<double, double>’ when C++17 is enabled changed to match C++14 in GCC 10.1
         97 |               auto dom = dim.domain<double>();
            |                                             ^
      /tmp/pip-install-or3a1e7z/tiledb_8fbcb76f970544dfba8da3cb2ac6a5b0/tiledb/cc/domain.cc:101:44: note: parameter passing for argument of type ‘std::pair<float, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1
        101 |               auto dom = dim.domain<float>();
            |                                            ^
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h: In member function ‘std::pair<_FIter, _FIter> tiledb::Dimension::domain() const [with T = double]’:
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h:159:19: note: parameter passing for argument of type ‘std::pair<double, double>’ when C++17 is enabled changed to match C++14 in GCC 10.1
        159 |   std::pair<T, T> domain() const {
            |                   ^~~~~~
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h: In member function ‘std::pair<_FIter, _FIter> tiledb::Dimension::domain() const [with T = float]’:
      /tmp/tmpi57ckl70/build/_deps/tiledb-src/include/tiledb/dimension.h:159:19: note: parameter passing for argument of type ‘std::pair<float, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1
      [18/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/enumeration.cc.o
      [19/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/filter.cc.o
      [20/33] Building CXX object tiledb/CMakeFiles/main.dir/core.cc.o
      [21/33] Linking CXX shared module tiledb/main.cpython-312-aarch64-linux-gnu.so
      FAILED: tiledb/main.cpython-312-aarch64-linux-gnu.so
      : && /usr/bin/aarch64-linux-gnu-g++ -fPIC -O3 -DNDEBUG  -flto -shared  -o tiledb/main.cpython-312-aarch64-linux-gnu.so tiledb/CMakeFiles/main.dir/main.cc.o tiledb/CMakeFiles/main.dir/core.cc.o tiledb/CMakeFiles/main.dir/npbuffer.cc.o tiledb/CMakeFiles/main.dir/fragment.cc.o tiledb/CMakeFiles/main.dir/schema_evolution.cc.o tiledb/CMakeFiles/main.dir/util.cc.o tiledb/CMakeFiles/main.dir/serialization.cc.o tiledb/CMakeFiles/main.dir/tests/test_metadata.cc.o tiledb/CMakeFiles/main.dir/tests/test_webp.cc.o tiledb/CMakeFiles/main.dir/tests/test_serialization.cc.o  -Wl,-rpath,/tmp/tmpi57ckl70/build/_deps/tiledb-src/lib:  _deps/tiledb-src/lib/libtiledb.so.2.25 && cd /tmp/tmpi57ckl70/build/tiledb && /usr/bin/aarch64-linux-gnu-strip /tmp/tmpi57ckl70/build/tiledb/main.cpython-312-aarch64-linux-gnu.so
      /usr/bin/ld: _deps/tiledb-src/lib/libtiledb.so.2.25: error adding symbols: file in wrong format
      collect2: error: ld returned 1 exit status
      [22/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/filestore.cc.o
      [23/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/object.cc.o
      [24/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/group.cc.o
      [25/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/query.cc.o
      [26/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/enum.cc.o
      [27/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/schema.cc.o
      [28/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/tiledbcpp.cc.o
      [29/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/subarray.cc.o
      [30/33] Building CXX object tiledb/cc/CMakeFiles/cc.dir/vfs.cc.o
      [31/33] Building CXX object tiledb/CMakeFiles/libtiledb.dir/libtiledb.cc.o
      In file included from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1909,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from /tmp/tmpi57ckl70/build/tiledb/libtiledb.cc:1243:
      /tmp/pip-build-env-ff_9wwrx/overlay/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
         17 | #warning "Using deprecated NumPy API, disable it with " \
            |  ^~~~~~~
      ninja: build stopped: subcommand failed.
      
      *** CMake build failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tiledb
Failed to build tiledb

We are actively working on this; blocking PR is in progress here: TileDB-Inc/TileDB#5271