Closed SebastianRiedel closed 9 years ago
I found out that the following command sequence works:
mkdir build
cd build
cmake ../
mkdir ecto_tutorial
vim CMakeFiles/tutorial_ectomodule.dir/link.txt (editing link.txt, see remarks below)
make
The original link.txt generated using cmake looks like:
/usr/bin/c++ -fPIC -shared-libgcc -shared -Wl,-soname,tutorial.so -o //ecto_tutorial/tutorial.so CMakeFiles/tutorial_ectomodule.dir/tutorial.cpp.o CMakeFiles/tutorial_ectomodule.dir/hello.cpp.o -lboost_python -lboost_thread -lboost_system -lpthread -lpython2.7 /home/sebastian/software/ecto/build/devel/lib/libecto.so -lpython2.7 /home/sebastian/software/ecto/build/devel/lib/libecto.so -Wl,-rpath,/home/sebastian/software/ecto/build/devel/lib:
in which the option -o //ecto_tutorial/tutorial.so
has to be changed to -o ./ecto_tutorial/tutorial.so
to make the library generation work. Also, I need to create the directory manually using mkdir ecto_tutorial
(see command sequence above).
I hope this helps in finding the error.
@vrabaud the issue described here results from the commit 2e020c478e52903efbd71c343f9a812550632b07 where cmake checks for ROS_GROOVY etc have been removed. That leads to the hard requirement that in ectoMacros.cmake catkin specific cmake variables have to be set (e.g. CATKIN_DEVEL_PREFIX). If they are not set they result in empty substitution and therefore paths like the above linking option -o //ecto_tutorial/tutorial.so
.
The issue is resolved as soon as one adds find_package(catkin REQUIRED)
to the ecto_tutorial CMakeLists.txt. That could be updated in the tutorials in https://plasmodic.github.io/ecto/ecto/usage/tutorials/hello.html and https://plasmodic.github.io/ecto/ecto/usage/client_usage.html
I followed this tutorial: http://plasmodic.github.io/ecto/ecto/usage/tutorials/hello.html. After adding "find_package(catkin REQUIRED) ", I can cmake my ecto_tutorial folder. Things in ecto_tutorial are "build/ CMakeLists.txt ecto_tutorial/ Hello.cpp hello.py* init.py tutorial.cpp".
Then I cd build, mkdir ecto_tutorial (~/ecto_tutorial/build$ mkdir ecto_tutorial), then things are: catkin/ CATKIN_IGNORE CMakeFiles/ CTestTestfile.cmake ecto_tutorial/ Makefile catkin_generated/ CMakeCache.txt cmake_install.cmake devel/ gtest/ test_results/
Then export PYTHONPATH=~/ecto_tutorial/build:$PYTHONPATH
Then I can run "touch ./build/ecto_tutorial/init.py". Everything is fine now.
However, if I run "chmod 755 hello.py && ./hello.py" (~/ecto_tutorial$ chmod 755 hello.py && ./hello.py), I got error: ImportError: No module named tutorial
I don't know why this can happen?
And in my build folder after "vim CMakeFiles/tutorial_ectomodule.dir/link.txt", the line is different from the sitution of @SebastianRiedel in MY CASE: -o devel/lib/python2.7/ecto_tutorial/tutorial.so
Here is my folder: https://drive.google.com/folderview?id=0B6lGtF9IuZWCd21ONEljQXBLMFE&usp=sharing
Thanks very much!
Following the tutorial from https://plasmodic.github.io/ecto/ecto/usage/tutorials/hello.html I have the following problem when trying to build the project:
What now follows is the complete build process listing, the used CMakeLists.txt and the resulting files in the build-folder cmake was executed in.
My complete build process listing:
Used CMakeLists.txt:
Created files in build directory (no *.so file at all):
The tutorial.cpp, hello.cpp and hello.py are exactly as in the tutorial. Seems to be the same error as in https://groups.google.com/a/plasmodic.org/forum/#!topic/ecto-dev/H_Qo4BLW40s
System information: Ubuntu 14.04 x64