Skip to content

Install swig from package manager #143

Open

Description

@Aposhian

The docker build that builds the python interface builds swig from source. Is there a reason for that? It seems to work just fine when installing swig as a binary package (ex: via apt).

For ROS users using rosdep, adding swig to the package.xml would then automate this dependency installation (and also this would apply for bloom).

Activity

  1. Gonzalo-Mier commented on May 22, 2024

    @Gonzalo-Mier
    Member

    Hi @Aposhian,

    Not sure to which docker file you are refering to.

    On Dockerfile, swig is only installed by source with GDAL 3.0 - 3.2. We are using in this Docker GDAL 3.6, so that check is only used for testing, and doesn't affect the normal user. We found some issues between the apt swig version and those in GDAL, so we had to install the last version of swig by source.

    Fields2Cover/Dockerfile

    Lines 77 to 87 in fc35541

    RUN if gdalinfo --version | grep -o " 3\.[0-2]\."; then \
    apt-get install -y --no-install-recommends --allow-unauthenticated autoconf automake autotools-dev libpcre2-dev bison \
    && git clone https://github.com/swig/swig.git \
    && cd swig \
    && ./autogen.sh \
    && ./configure \
    && make -j8 \
    && make install; \
    else \
    apt-get install -y --no-install-recommends --allow-unauthenticated swig; \
    fi

    Due to those compilation issues, on the workflow "build" we install swig by source to control the swig version used, to avoid these kind of issues again.

    We don't want to install the python interface by default when compiling F2C by source. Do you know if there is away to add compilation options in the package.xml for the bloom env?

  2. Aposhian commented on May 22, 2024

    @Aposhian
    Author

    Thanks for the explanation on why swig is being installed from source. I'm using Ubuntu 22.04 which has GDAL 3.4 and Swig 4.0 as the latest packaged versions and those seem to be working fine.

    If we add swig to the package.xml, it doesn't require the python interface to be compiled. It will pull it in as a bloom dependency and it will install it for users with rosdep, but doesn't require anything to be compiled.

    I would think that it makes sense for the ROS bloomed package to have the python interface built anyway, and if users don't want to build it then they can build from source.

    Another alternative would be splitting the python interface into a separate package internally, and that would contain the swig dependency.

  3. tonynajjar commented on May 24, 2024

    @tonynajjar
    Contributor

    I created #144 before seeing this issue.

    I would think that it makes sense for the ROS bloomed package to have the python interface built anyway

    From a user perspective, I'd love that as well so I don't have to build it myself
    The next best thing is adding swig in package.xml so that I don't have to do it manually outside of the rosdep workflow

  4. Gonzalo-Mier commented on May 27, 2024

    @Gonzalo-Mier
    Member

    #144 merged! Should we turn on the python compilation flag by default?

  5. Aposhian commented on May 29, 2024

    @Aposhian
    Author

    I think with that PR merged we call this complete

  6. tonynajjar commented on May 29, 2024

    @tonynajjar
    Contributor

    #144 merged! Should we turn on the python compilation flag by default?

    Yeah but that would still be nice 🙈 if there are no big downsides to it

  7. Gonzalo-Mier commented on Jun 4, 2024

    @Gonzalo-Mier
    Member

    Done 😄

  8. tonynajjar commented on Aug 9, 2024

    @tonynajjar
    Contributor

    Hey guys, did any of you confirm that this work?

    docker run -it --rm osrf/ros:humble-desktop-full bash -ic 'sudo apt update && sudo apt install ros-humble-fields2cover -y && python3 -c "import fields2cover"'

    This should theoretically work no? But it doesn't -> ModuleNotFoundError: No module named 'fields2cover'

  9. tonynajjar commented on Jan 9, 2025

    @tonynajjar
    Contributor

    This should theoretically work no? But it doesn't -> ModuleNotFoundError: No module named 'fields2cover'

    @Gonzalo-Mier same with jazzy, can you check?

  10. vinnnyr commented on Jan 9, 2025

    @vinnnyr
    Contributor

    @tonynajjar you are right, I checked on Humble a few different ways, and it seems as if though only the cpp library is installed via apt.

  11. tonynajjar commented on Jan 9, 2025

    @tonynajjar
    Contributor

    Thank you for checking, let's at least reopen this ticket to keep track of it

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions