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

Installation with shared memory support fails on Ubuntu 22.04 #271

Closed
m-decoster opened this issue Oct 18, 2024 · 3 comments
Closed

Installation with shared memory support fails on Ubuntu 22.04 #271

m-decoster opened this issue Oct 18, 2024 · 3 comments

Comments

@m-decoster
Copy link

Aim and problem

I want to install cyclonedds-python on Ubuntu 22.04 with support for shared memory, via iceoryx. All installation processes succeed without error, but I cannot run cyclonedds-python code with shared memory support.

Steps I've taken

Installing iceoryx and cyclonedds

I followed the instructions of the cyclonedds manual to install iceoryx and cyclonedds with shared memory support: https://cyclonedds.io/docs/cyclonedds/latest/shared_memory/shared_memory.html

However, following the comment on #227, I used version 0.10.2 of cyclonedds by modifying one of the commands. So, I executed:

sudo apt update && sudo apt upgrade -y
sudo apt install cmake libacl1-dev libncurses5-dev pkg-config maven

git clone https://github.com/eclipse-iceoryx/iceoryx.git -b release_2.0
cd iceoryx
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DROUDI_ENVIRONMENT=on -DBUILD_SHARED_LIBS=ON -Hiceoryx_meta
cmake --build build --config Release --target install

cd ..
git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
cd cyclonedds
git checkout 0.10.2
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DENABLE_ICEORYX=On -DBUILD_EXAMPLES=On -DCMAKE_PREFIX_PATH=~/iceoryx/install/
cmake --build build --config Release --target install

Installing cyclonedds-python

I followed the instructions in this repository's README:

cd
export CYCLONEDDS_HOME=~/cyclonedds/install
pip3 install cyclonedds --no-binary cyclonedds

Configuration of shared memory

I then use this file for configuration, found at https://cyclonedds.io/docs/cyclonedds/latest/shared_memory/shared_mem_config.html:

<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/iceoryx/etc/cyclonedds.xsd">
    <Domain id="any">
        <General>
            <Interfaces>
                <PubSubMessageExchange name="iox" library="psmx_iox" config="LOG_LEVEL=INFO;"/>
            </Interfaces>
        </General>
    </Domain>
</CycloneDDS>

Issue

When I run a Python script and create a domain participant, I get this error:

1729260850.168537 [0]     python: Failed to load PSMX library 'psmx_iox' with error "psmx_iox: cannot open shared object file: No such file or directory".
1729260850.168544 [0]     python: error loading PSMX instance "iox"
@aratar-orome
Copy link

I think this psmx_iox directory is not part of the cyclonedds git tag 10.2. Try to build cyclonedds from the HEAD of the master branch. I got cyclone-python running with it together with iceoryx.

@m-decoster
Copy link
Author

m-decoster commented Nov 12, 2024

Thank you for your reply @aratar-orome. Unfortunately, I get the same error when building the master branch of cyclonedds.

Do you know which versions of iceoryx and cyclonedds you built?

@m-decoster
Copy link
Author

m-decoster commented Nov 12, 2024

Update: it appears to be working now, after also setting LD_LIBRARY_PATH to /home/$USER/iceoryx/install/lib/:/home/$USER/cyclonedds/install/lib/:

The solution is:

sudo apt update && sudo apt upgrade -y
sudo apt install cmake libacl1-dev libncurses5-dev pkg-config maven

git clone https://github.com/eclipse-iceoryx/iceoryx.git -b release_2.0
cd iceoryx
git checkout ebdf38728a29c6a8ee172efc440b8e2f4415ff7a  # The exact commit I used, release_2.0 branch HEAD at time of writing
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DROUDI_ENVIRONMENT=on -DBUILD_SHARED_LIBS=ON -Hiceoryx_meta
cmake --build build --config Release --target install

cd ..
git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
cd cyclonedds
git checkout d8cef891b9a27cc7bc52477e1c7b2c3f8edf81ba  # The exact commit I used, master branch HEAD at time of writing
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DENABLE_ICEORYX=On -DBUILD_EXAMPLES=On -DCMAKE_PREFIX_PATH=~/iceoryx/install/
cmake --build build --config Release --target install

cd
export CYCLONEDDS_HOME=~/cyclonedds/install
pip3 install git+https://github.com/eclipse-cyclonedds/cyclonedds-python@2b5231f620b9643b6651dc9647eb5dfbbd4fec0b  # The exact commit I used, master branch HEAD at time of writing

Using this configuration file for cyclonedds:

<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/iceoryx/etc/cyclonedds.xsd">
    <Domain id="any">
        <General>
            <Interfaces>
                <PubSubMessageExchange name="iox" library="psmx_iox" config="LOG_LEVEL=INFO;"/>
            </Interfaces>
        </General>
    </Domain>
</CycloneDDS>

And this iceoryx configuration file:

[general]
version = 1

[[segment]]

[[segment.mempool]]
size = 16448
count = 32768

In one terminal, starting roudi:

~/iceoryx/build/iox-roudi -c iox_config.toml

In another terminal,

export LD_LIBRARY_PATH=/home/$USER/iceoryx/install/lib:/home/$USER/cyclonedds/install/lib:$LD_LIBRARY_PATH
export CYCLONEDDS_URI=file://cyclone_config.xml
python my_test_script.py

Note this does not work with Python > 3.10 in my experience.

Hopefully this helps someone in the future. I will do a final check in a completely clean environment before closing this issue.

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

2 participants