Cross-compilation, CMake and Symlinks

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Cross-compilation, CMake and Symlinks

CMake mailing list
So I'm using this guide to cross-compile OpenCV for Raspberry Pi:

https://visualgdb.com/tutorials/raspberry/opencv/build/ I'm doing that
mainly because building anything on RPi is much slower than on Windows, and
because I need the remote debugging tools of Visual Studio. Everything
worked as expected especially with the advanced CMake subsystem of
VisualGDB. However, when I reached the deployment step I faced some
annoyances.

First, SmarTTY could not upload to the /usr directory because there is no
way to apply the sudo command in the application. I could copy everything to
the /home/pi directory and then I copied everything recursively to /usr,
which worked like a charm! I got remote debugging working and compiled
applications picked up all the required dependencies. I don't know if there
is an alternative to manually copying the files though.

The second annoyance was when I did used the ldconfig command:

pi@raspberrypi:~ $ sudo ldconfig

ldconfig: /usr/lib/libopencv_calib3d.so.4.0 is not a symbolic link

.....

pi@raspberrypi:/usr/lib $ ls libopencv_calib3d.* -al

-rwxr-xr-x 1 root root 9832912 Oct 17 18:16 libopencv_calib3d.so

-rwxr-xr-x 1 root root 9832912 Oct 17 18:17 libopencv_calib3d.so.4.0

-rwxr-xr-x 1 root root 9832912 Oct 17 18:16 libopencv_calib3d.so.4.0.0

As you can see, instead of creating one .so file and several symbolic links,
it creates multiple copies of the same file. This is basically because
Windows does not support symlinks. Now there are several adhoc solutions,
like scripts that convert duplicate files to symlinks but this doesn't
really look like a reliable approach. How do you solve this kind of problem
in your day to day cross-compilation tasks?



--
Sent from: http://cmake.3232098.n2.nabble.com/
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake