Pybind11 - Failing in Travis / Virtualenv - travis-ci

My Pybind project seems to be compiling fine on my system, but when I perform unit testing on travis, it throws the following error:
-- Found PythonInterp: /opt/pyenv/shims/python3.7 (found version "1.4")
CMake Error at 3rdparty/pybind11/tools/FindPythonLibsNew.cmake:95 (message):
Python config failure:
pyenv: python3.7: command not found
The `python3.7' command exists in these Python versions:
3.7
3.7.1
This seems to be something to do with virtualenv which I have never used. I currently have no idea how to solve this issue, and given that its in a travis instance, i'm not sure how to recreate it on my system so I may fix it

What is happening in your case is that the wrong Python version is being used by travis.
For example, if you are using Ubuntu 16.04 (Xenial) in your .travis.yml configuration, you have to specify the version you want for Python when you call CMAKE.
For example, something like
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(python-config --prefix)/bin/python3.5 -DPYTHON_LIBRARY=$(python-config --prefix)/lib/libpython3.5m.so -DPYTHON_INCLUDE_DIR=$(python-config --prefix)/include/python3.5m ..
Other versions of Ubuntu will have different versions of Python.
References:
https://github.com/vgc/vgc/issues/42
https://github.com/pybind/pybind11/issues/99#issuecomment-207782425

just to add to Murilo's answer, you could use Miniconda as a workaround as well, and configure CMAKE in a similar way by just changing the paths to the ones in your Miniconda env. I ran into issues when using multiple jobs for different Ubuntu distributions (xenial and bionic), which had somewhat different paths to the python libraries and headers.
Here there's a link to a travis with miniconda snippet which you could use to setup miniconda along a travis build.
You can then use the following CMAKE configuration in your travis.yml file (note that the environment with name travis_env was created with python=3.6):
script:
# ...
- cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$HOME/miniconda/envs/travis_env/bin/python3.6 -DPYTHON_LIBRARY=$HOME/miniconda/envs/travis_env/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=$HOME/miniconda/envs/travis_env/include/python3.6m ..
# ...

Related

ros tuetlebot3 launh file

bug
I am using ubuntu version 20.0.4
I have followed all the turtlebot simulation instruction here but don't what is the issue I also check my bashrc file all the path are correct. Can anyone help me
Update by bashrc file
Run the turtlebot launch file
You're running 20.04, which means your ROS version will be Noetic. However the tutorial you're referencing is written for Kinetic; which means you're installing a package for the wrong version.
You can either repeat the install instructions with: git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git. Or cd into the cloned package and checkout the right branch via: git checkout noetic-devel.
Note that you'll most likely need to clean your workspace as it will not have built right.

How do I delete a ros/gazebo-simulation completly

I have a kinda weird problem. I'm currently messing around with the VRX-Simulator, which simulates an unmanned-watersurface-vehicle.
For the installation I followed the guide on https://bitbucket.org/osrf/vrx/wiki/tutorials/SystemSetupInstall.
Then I tried to modify some of the files and tried to rebuild the project.
This was the point when I noticed it always used the "old" version of my simulation within gazebo.
From now on no matter what I did (I even deleted the whole catkin workspace folder) ROS somehow managed to always launch the original version of my simulation even without any build/src folder existing when I used roslaunch.
roslaunch vrx_gazebo sandisland.launch
So my question would be how can I get rid of my simulation/model and where does ros/gazebo cache my simulation?
You most probably installed the package with the command from the tutorial sudo apt install ros-melodic-vrx-gazebo. So the package launched with roslaunch vrx_gazebo sandisland.launch was not in your catkin workspace. If you want to get rid of it you can uninstall it with sudo apt remove ros-melodic-vrx-gazebo. But this is not strictly necessary.
There are several ways to find out where some ros package is located, try running some of these commands:
rospack find vrx_gazebo will show you where the package used is located
roscd vrx_gazebo will take you to the folder where it is installed something like
/opt/ros/melodic/share/vrx_gazebo
If you also followed the tutorials installing from source code then the issue most likely was not sourcing the built packages. The last line of the guide is a bit misleading. The line *Remember to run this command every time you open a new terminal. is meant to reference the command source ~/vrx_ws/devel/setup.bash
Whether the installed package or the package built from source is used depends on which order they are listed in the environment variable ROS_PACKAGE_PATH. This variable is modified by both source /opt/ros/melodic/setup.bash and source ~/vrx_ws/devel/setup.bash. So have a look at the variable after each step with printenv | grep ROS or echo $ROS_PACKAGE_PATH. Theoretically if you source your terminal in the order I had the source commands it should be using the package built from source, you can verify with the rospack find ... and roscd ... commands mentioned earlier.
In the end it is probably easier to add the sourcing commands to your .bashrc file so you would not forget to source the terminals as mentioned in the ROS installation tutorial. You can add the sourcing of the workspace to the the same file, you will just have to be aware that you would need to change the file, should you want to use a different workspace.
http://wiki.ros.org/melodic/Installation/Ubuntu#melodic.2BAC8-Installation.2BAC8-DebEnvironment.Environment_setup
relevant command from the tutorial:
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
you could do the same for the workspace:
echo "source ~/vrx_ws/devel/setup.bash" >> ~/.bashrc
And after running those commands run exec bash to get the changes into the current terminal. All future terminals will have those commands already loaded.

Bazel internal shell issue using windows

I am trying to migrate a huge project having visual studio and maven projects to bazel. I need to access our in house maven server which is encrypted. To get access I need the load the maven_jar skylark extension since the default impl does not support encryption (get error 401). using the extension leads to a lot of troubles, like:
ERROR: BUILD:4:1: no such package '#org_bouncycastle_bcpkix_jdk15on//jar': Traceback (most recent call last):
File ".../external/bazel_tools/tools/build_defs/repo/maven_rules.bzl", line 280
_maven_artifact_impl(ctx, "jar", _maven_jar_build_file_te...)
File ".../external/bazel_tools/tools/build_defs/repo/maven_rules.bzl", line 248, in _maven_artifact_impl
fail(("%s: Failed to create dirs in e...))
org_bouncycastle_bcpkix_jdk15on: Failed to create dirs in execution root.
The main issue seems to be the shell that needs to be provided to bazel in BAZEL_SH environment variables:
I am working under windows
I am using bazel 0.23.2
bazel seems to run a bash command using "bash" directly and not the one provided by env variable.
I got a ubuntu shell installed in windows. bazel was using everything from ubuntu, especially when using maven (settings.xml was using from ubuntu ~/.m2 and not from windows user)
after uninstalling ubuntu and making sure that bash in a cmd ends up in "command not found" I also removed the BAZEL_SH env var and bazel throws the message above
after setting the BAZEL_SH variable again it fails with the same error message
I am assuming that bazel gets a bash from somewhere or is ignoring the env variable. My questions are:
1. How to setup a correct shell?
2. Is BAZEL_SH needed when using current version?
For me the doc at bazel website about setup is outdated.
Cheers
Please consider using rules_jvm_external to manage your Maven dependencies. It supports both Windows and private repositories using HTTP Basic Authentication.
For me the doc at bazel website about setup is outdated.
The Bazel team is aware of this and will be updating our docs shortly.

How to install waf?

I have cloned and built the waf script using:
./waf-light configure
Then to build my project (provided by Gomspace) I need to add waf and the eclipse.py to my path. So far I haven't found better than this setenv script:
WAFROOT=~/git/waf/
export PYTHONPATH=$WAFROOT/waflib/extras/:$PYTHONPATH
export PATH=~/git/waf/:$PATH
Called with:
source setenv
This is somehow a pretty ugly solution. Is there a more elegant way to install waf?
You don't install waf. The command you found correctly builds waf: /waf-light configure build Then for each project you create, you put the built waf script into that projects root directory. I can't find a reference, but this is the way in which waf:s primary author Thomas Nagy wants the tool to be used. Projects that repackage waf to make the tool installable aren't "officially sanctioned."
There are advantages and disadvantages with non-installation:
Disadvantages:
You have to add the semi-binary 100kb large waf file to your repository.
Because the file contains binary code, people can have legal objections to distributing it.
Advantages:
It doesn't matter if new versions of waf break the old API.
Users don't need to install waf before compiling the project -- having Python on the system is enough.
Fedora (at least Fedora 22) has a yum package for waf, so you could see that it's possible to do a system install of waf, albeit with a hack.
After you run something like python3 ./waf-light configure build, you'll get a file called waf that's actually a Python script with some binary data at the end. If you put it into /usr/bin and run it as non-root, you'll get an error because it fails to create a directory in /usr/bin. If you run it as root, you'll get the new directory and /usr/bin/waf runs normally.
Here's the trick that I learned from examining the find_lib() function in the waf Python script.
Copy the waf to /usr/bin/waf
As root, run /usr/bin/waf. Notice that it creates a directory. You'll see something like /usr/bin/.waf-2.0.19-b2f63c807a4215294bf6005410c74c18
mv that directory to /usr/lib, dropping the . in the directory name, e.g. mv /usr/bin/.waf-2.0.19-b2f63c807a4215294bf6005410c74c18 /usr/lib/waf-2.0.19-b2f63c807a4215294bf6005410c74c18
If you want to use waf with Python3, repeat Steps 2-3 running the Python script /usr/bin/waf under Python3. Under Python3, the directory names will start with .waf3-/waf3- instead instead of .waf-/waf-.
(Optional) Remove the binary data at the end of /usr/bin/waf.
Now, non-root should be able to just use /usr/bin/waf.
That said, here's something to consider, like what another answer said: I believe waf's author intended waf to be embedded in projects so that each project can use its own version of waf without fear that a project will fail to build when there are newer versions of waf. Thus, the one-global-version use case seems to be not officially supported.

kerl --with-wx doesn't create wxe_driver.so

kerl --with-wx doesn't create an erlang installation with wxe_driver.so. Should it? I'm trying to make an erlang build that will run observe, but still get:
ERROR: Could not find 'wxe_driver.so' in: /home/don/erlangs/17.4/lib/wx-1.3.2/priv
.kerlrc contains:
KERL_CONFIGURE_OPTIONS="--with-wx"
Erlang build procedure just skips some optional components build steps if build host system does not have all the required dependencies to build that components, even configure (or kerl) was told to make build with that components included
If you find yourself in a situation where Erlang, that was built from source, blames some module could not be loaded, you should check if it was built
In this particular case
Look for errors in a file named config.log under ~/.kerl. It should indicate what's missing.
To build wxe_driver you should have WX development libraries installed on your system. You have to refer to your system documentation to learn how to install them. In this case, since glu.h was missing, running sudo apt-get install build-essential libsdl1.2debian libsdl1.2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl-image1.2 libsdl-image1.2-dev added the missing file.

Resources