NVlabs / handover-sim

A simulation environment and benchmark for human-to-robot object handovers
https://handover-sim.github.io
BSD 3-Clause "New" or "Revised" License
87 stars 14 forks source link

Having problem when installing OMG-Planner #8

Closed Lingzhi3 closed 11 months ago

Lingzhi3 commented 1 year ago

Hi, I hope you are doing good.

When installing OMG-Planner following "example/README.md", I am trying to execute """cmake .. \ -DPYTHON_EXECUTABLE=$VIRTUAL_ENV/bin/python \ -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )""" in terminal and I have modified "$VIRTUAL_ENV". But two errors occur:

  1. CMake Error at CMakeLists.txt:18 (find_package): find_package called with invalid argument "."

  2. CMake Error at cmake/FindSIP.cmake:63 (MESSAGE): Could not find SIP Call Stack (most recent call first): CMakeLists.txt:21 (find_package)

Could you please fix it as soon as possible?

ychao-nvidia commented 1 year ago

Thanks for reporting. Can you try using -DPYTHON_LIBRARY instead:

cmake .. \
  -DPYTHON_LIBRARY=/path/to/libpython3.so \
  -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )
a5ylum22 commented 11 months ago

Thanks for reporting. Can you try using -DPYTHON_LIBRARY instead:

cmake .. \
  -DPYTHON_LIBRARY=/path/to/libpython3.so \
  -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )

Hi, I have used that command above, but it still gave me the same error, could you please tell me how to fix it as soon as possible?

ychao-nvidia commented 11 months ago

Your problem is coming from this line because your cmake cannot find your Python installation. What did you set for -DPYTHON_LIBRARY above?

a5ylum22 commented 11 months ago

I used this: cmake .. \ -DPYTHON_LIBRARY=miniconda3/envs/handover/lib/libpython3.so \ -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd ) & this alternatively cmake .. \ -DPYTHON_LIBRARY=miniconda3/envs/handover/lib/libpython3.8.so \ -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )

I got the error on both of these scripts. I am running WSL2 on win10 with Ubuntu20.04 and CUDA 10.1

ychao-nvidia commented 11 months ago

Can you try using absolute path for -DPYTHON_LIBRARY?

a5ylum22 commented 11 months ago

I did, but I am still getting the same error.

ychao-nvidia commented 11 months ago

Can you provide more detail about your environment and steps, or anything that could help reproduce the issue on my end?

a5ylum22 commented 11 months ago

Yes, for sure. I created a conda env for running handover sim on my wsl2 system with ubuntu 20.04, I first created the env with python 3.8 and cuda toolkit version 10.1. I then installed handover-sim in that env following the readme on the main page. I then installed the GA-DDPG baseline and was able to run it successfully. I then tried to run OMG Planner and came to this issue here.

https://docs.google.com/document/d/1zAClw-GybUNYRfIu76yz6ABCpCOQ9O93ld-0rDNEvrA/edit?usp=sharing

The link above has my env specs; feel free to look into them and point out any error.

ychao-nvidia commented 11 months ago

I did a run of installing handover-sim + OMG-Planner in a conda env with your setup, and the installation works fine for me. I've tried:

  1. cmake without -DPYTHON_EXECUTABLE nor -DPYTHON_LIBRARY.
  2. cmake with -DPYTHON_EXECUTABLE.
  3. cmake with -DPYTHON_LIBRARY.

All three above worked. Below is my installation script:

git clone --recursive git@github.com:NVlabs/handover-sim.git
cd handover-sim

conda create -p envs python=3.8 nvidia::cudatoolkit=10.1
conda activate ./envs

pip install -e .
pip install --no-deps -e ./mano_pybullet

git clone --recursive https://github.com/liruiw/OMG-Planner.git
cd OMG-Planner
git checkout a3b8b68

sed -i "s/opencv-python==3.4.3.18/opencv-python/g" requirements.txt
sed -i "s/torch==1.4.0/torch/g" requirements.txt
sed -i "s/torchvision==0.4.2/torchvision/g" requirements.txt
pip install -r requirements.txt

cd ycb_render
python setup.py develop
cd ..

git clone https://gitlab.com/libeigen/eigen.git
cd eigen
git checkout 3.4.0
mkdir -p release && mkdir -p build && cd build
cmake .. \
  -DCMAKE_INSTALL_PREFIX=$( cd ../release && pwd )
make -j8
make install
cd ../..

cd Sophus
mkdir -p release && mkdir -p build && cd build
cmake .. \
  -DCMAKE_INSTALL_PREFIX=$( cd ../release && pwd ) \
  -DEIGEN3_INCLUDE_DIR=$( cd ../../eigen/release/include/eigen3 && pwd )
make -j8
make install
cd ../..

cd layers
sed -i "s@/usr/local/include/eigen3\", \"/usr/local/include@$( cd ../eigen/release/include/eigen3 && pwd )\", \"$( cd ../Sophus/release/include && pwd )@g" setup.py
python setup.py install
cd ..

cd orocos_kinematics_dynamics
cd sip-4.19.3
python configure.py
make -j8
make install
cd ../orocos_kdl
mkdir -p release && mkdir -p build && cd build
cmake .. \
  -DCMAKE_INSTALL_PREFIX=$( cd ../release && pwd ) \
  -DEIGEN3_INCLUDE_DIR=$( cd ../../../eigen/release/include/eigen3 && pwd )
make -j8
make install
cd ../../python_orocos_kdl
mkdir -p build && cd build
cmake .. \
  -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )
make -j8
cp PyKDL.so $CONDA_PREFIX/lib/python3.8/site-packages
cd ../../..

# Download data.

cd ..

Note that in the above I did not set -DPYTHON_EXECUTABLE nor -DPYTHON_LIBRARY for the cmake:

cmake .. \
  -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )

However, it also works for me if I set either of them like below:

cmake .. \
  -DPYTHON_EXECUTABLE=$CONDA_PREFIX/bin/python3.8 \
  -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )
cmake .. \
  -DPYTHON_LIBRARY=$CONDA_PREFIX/lib/libpython3.8.so.1.0 \
  -DCMAKE_PREFIX_PATH=$( cd ../../orocos_kdl/release && pwd )
a5ylum22 commented 11 months ago

This worked, and I was successfully able to run OMG with only a few tweaks. Thank you for your solution!