Ray's module: _raylet.so compile from where? - ray

I am debugging the Ray source code, but I find the code destination is the _raylet.so . Where is _raylet.so compile from? Can you tell me where is the source code in the https://github.com/ray-project/ray?
I use the pip install ray in the centOS7, _raylet.so is in this path: /usr/local/lib/python3.6/site-packages/ray

The bazel target is defined here https://github.com/ray-project/ray/blob/master/BUILD.bazel#L2064 and you can find related file according to the target.

Related

LNK1181 Error while compiling the core after adding a module

I'm trying to compile my core with some modules but i'm getting the following error when building worldserver:
cannot open input file '..\..\..\modules\RelWithDebInfo\modules.lib' worldserver
This error only happens when compiling with the mod-gain-honor-guard module. I've installed a repack before that came with this module pre-installed, which makes me think that i'm the one missing something.
Any ideas?
Thanks!
I've compiled the core succesfully with only one module, then i've added the one mentioned before and that error came up. CMake didn't show me any error when i regenerated the source for building after adding the module
You always need to regenerate the source in CMake when you add or remove any files to the source.
Did you get the module via git clone? If not, and it's a direct download, you need to remove the -master or any other branch name from the folder name.

libgsl.so.25: cannot open shared object file: No such file or directory Google Colab project

I'm using Google Colab to compile and run some code in CUDA and C++ (mostly because I dont have a CUDA capable GPU). For reference, the project Im trying to replicate is here:
https://github.com/franrruiz/shopper-src
For the project I need to install and configure the GSL Library, which I have done by following these steps:
Download GSL library from ftp://ftp.gnu.org/gnu/gsl/
Upload zipped file into Colab
Run the following code in Colab
# Unzip and change directory
!unzip "gsl-2.6.zip"
%cd "/content/gsl-2.6"
# Gives permissions
!chmod 755 "/content/gsl-2.6/configure"
# Configure
!./configure
!make
!make check
!make install
Compiling the code works perfectly fine, but when I attempt to run the code on a workable dataset I get the following error:
/content/shopper: error while loading shared libraries:
libgsl.so.25: cannot open shared object file: No such file or directory
What I've already Tried
!export LD_LIBRARY_PATH="/contents/gsl-2.6/.libs"
and
!export LD_LIBRARY_PATH="/usr/local/lib/"
However, neither of them fixed the issue. If it's helpful,
!sudo find / -name "libgsl.so.25"
returns
/usr/local/lib/libgsl.so.25
/content/gsl-2.6/.libs/libgsl.so.25
So we know the files exist. I just cant seem to point my code to it correctly.
Thanks in advance
I have the same issue with a different library. I also tried the export, which does not work, seems like the python in colab does not read environmental variables.
My solution is the following
!ln -s /usr/local/lib/<your_shared_library> /usr/lib/<your_shared_library>

"unsupported/Eigen/CXX11/Tensor: No such file or directory" while working with TensorFlow

I'm trying to use tensorflow as a external library in my C++ application (mainly following this tutorial). What I done so far:
I have cloned the tensorflow reporitory (let's say, that the repo root dir is $TENSORFLOW)
Run /.configure (which all settings default, so no CUDA, no OpenCL etc.).
Build shared library with bazel build -c /opt //tensorflow:libtensorflow_cc.so (build completed successfully)
Now I'm trying to #include "tensorflow/core/public/session.h". But after including it (and adding $TENSORFLOW and $TENSORFLOW/bazel-genfiles to include path), I'm receiving error:
$TENSORFLOW/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:42:
fatal error: unsupported/Eigen/CXX11/Tensor: No such file or directory
There is a github issue created for similar problem, but it's marked as closed without any solution provided. Also I tried with master branch as well as v.1.4.0 release.
Do you happen to know, what could cause this kind of problem and how to deal with it?
I (and many others) agonized over the same problem. It probably can be solved using bazel but I don't know that tool well enough and now I solve this using make. The source of confusion is that a file named Tensor is included and it itself includes a file named Tensor, which has caused some people to wrongly conclude Tensor is including itself.
If you built and installed the python .whl file there will be a tensorflow directory in dist-packages and an include directory below that, e.g. on my system:
/usr/local/lib/python2.7/dist-packages/tensorflow/include
From the include directory
find . -type f -name 'Tensor' -print
./third_party/eigen3/unsupported/Eigen/CXX11/Tensor
./external/eigen_archive/unsupported/Eigen/CXX11/Tensor
The first one has
#include "unsupported/Eigen/CXX11/Tensor"
and the file that should satisfy this is the second one.
So to compile session.cc that includes session.h, the following will work
INC_TENS1=/usr/local/lib/python2.7/dist-packages/tensorflow/include/
INC_TENS2=${INC_TENS1}external/eigen_archive/
gcc -c -std=c++11 -I $INC_TENS1 -I $INC_TENS2 session.cc
I've seen claims that you must build apps from the tensorflow tree and you must use bazel. However, I believe all the header files you need are in dist-packages/tensorflow/include and at least for starters you can construct makefile or cmake projects.
Slightly off-topic, but I had the same error with a C++ project using opencv-4.5.5 and compiled with Visual Studio (no problem with opencv-4.3.0, and no problem with MinGW).
To make it work, I had to add to my root CMakeLists.txt:
add_definitions(-DOPENCV_DISABLE_EIGEN_TENSOR_SUPPORT)
If that can help someone...
the problem was actually in the relative path of the header file taken in the Tensor file.
installed path for Tensor is /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor
but mentioned in the Tensor file is "unsupported/Eigen/CXX11/Tensor"
So there should be an entry upto /usr/include/eigen3/ in the project path to run this correctly so that it can be used.

Setting up ROS package in CLion

I am using CLion (C++ IDE) for editing a ROS package. I was able to open a package by opening the CMakeLists.txt file. But, I get an error,
"FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that
no ROS setup.sh was sourced before"
How do I solve this problem? Will I be able to make the project in CLion (If so, how do I) after I make changes to the code or do I have to catkin_make in a separate terminal?
Try this (for Linux):
Open a command line
Run catkin_make on your package.
source your catkin_workspace/devel/setup.bash file e.g. source ~/my_dev_folder/catkin_ws/devel/setup.bash
Start CLion from [CLion install dir]/bin/clion.sh e.g. cd ~/Downloads/clion-1.2.4/bin && ./clion.sh
CLion should then start with knowledge about the packages in your catkin workspace, through the local environment variables set up by the setup.bash file.
To add on to what WillC suggested, you can also modify the desktop entry to start the application from bash instead of manually doing so.
To do this, edit the desktop file located at
~/.local/share/applications/jetbrains-clion.desktop
by modifying the line containing Exec= to
Exec=bash -i -c "/INSTALL_LOCATION/clion-2016.3.2/bin/clion.sh" %f
To add on to what WillC suggested,CLion reload the last cmake compiling result by default.
However, if you failed to find catkin.cmake during the last attempt even though you source the devel/setup.bash and open CLion, you also cannot find catkin.cmake.
You should click File --> Reload Cmake Project and you should get the right result.

How to install 2 Opencv versions on one Ubuntu machine and How to activate one at a time for compilation?

I have installed two versions of opencv in my ubuntu12.04 machine , one in /usr/local/ (opencv3.0.0) and another in /usr/ (opencv2.4.9).
To activate particular version i am using these commands in terminals.
Example :To activate opencv2.4.9,
sudo sh -c 'echo "/usr/" > /etc/ld.so.conf.d/opencv.conf' (shell script)
sudo ldconfig
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
After executing these commands version is changing.
Checked with command, pkg-config --modversion opencv.
Then i compiled my code and checked used libraries, Using ldd command,
It is listing opencv3.0.0 version not opencv2.4.9.
Please help correct way of switching opencv versions.
Thanks in advance
Thank you,
I found a solution for this problem, but I am not sure the solution what iIfound is correct way or not. But it is working fine for me.
When we install two versions of opencv in different locations,we will found two opencv.pc file in {path}/lib/pkgconfig/opencv.pc.
In above example opencv2.4.9's opencv.pc file is in this path usr/lib/pkgconfig/opencv.pc.
and opencv3.0.0's opencv.pc file is in this path /usr/local/lib/pkgconfig/opencv.pc
When we compile a code it will search in both location for opencv.pc configuration file, it will use which ever first it is getting, neglecting second one.
so if want compile code with particular version we need to remove this opencv.pc file from that location.
If you want to use opencv2.4.9 remove(or rename)opencv.pc from opencv3.0.0's lib/pkgconfig/ location. Again if want activate opencv3.0.0 add opencv.pc to its lib/pkgconfig/ location and remove opencv2.4.9's opencv.pc file from /lib/pkgconfig/opencv.pc.
If somebody knows a better way to do this, please comment.
You still can install both versions and append on the environment path the path of the version you want to use.
If you don't know how to change system path check this ( How to permanently set $PATH on Linux? )