I am trying to install and run this software https://github.com/mit-biomimetics/Cheetah-Software
it's for a project but it can t compile for missing dependancies (eigen3).
I would like to create an auto install script to run it.
I have already do the most but i think i have problems in linking path in cmake and qt5.10 and eigen...
The autoinstall.sh code:
Install dependancies
sudo apt install mesa-common-dev freeglut3-dev coinor-libipopt-dev libblas-dev liblapack-dev gfortran liblapack-dev coinor-libipopt-dev cmake gcc build-essential libglib2.0-dev default-jdk python-all-dev liblua5.1-dev golang doxygen python-epydoc
Clone MIT Minicheetah software
git clone https://github.com/mit-biomimetics/Cheetah-Software.git
cd Cheetah-Software
Eigen library
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip
unzip eigen-3.3.7.zip
lcm library
wget https://github.com/lcm-proj/lcm/releases/download/v1.4.0/lcm-1.4.0.zip
unzip lcm-1.4.0.zip
cd lcm-1.4.0
mkdir build
cd build
cmake ..
make
sudo make install
cd ..
cd ..
Qt
wget http://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/5.10/5.10.0/qt-opensource-linux-x64-5.10.0.run
chmod +x qt-opensource-linux-x64-5.10.0.run
./qt-opensource-linux-x64-5.10.0.run
build
cd scripts # for now, you must actually go into this folder
./make_types.sh # you may see an error like `rm: cannot remove...` but this is okay
cd ..
mkdir build
cd build
cmake .. # there are still some warnings here
make -j
configure or setup.py or anything relqted in INSTALL or README.MD ( mandatory )
make
make install
but really you did not choose the most straitforward job, even as a developper I've been surprised many times when using cloned sources.
You should give a try to precompiled ROS for your robots or any distribution that let you install from binary yet you can still cross-compile when dev is done.
So i was able to compile and run it after several research and asking forums, it was a problem of compatibility with lcm library and openjdk, so download oracle jdk, do some linking manually and it was all good, absolutely no error in compilation.
Cheetah-Sofware-Ubuntu 18.04-AutoInstall.sh :
https://github.com/STRATOS-ROBOTICS/LeopardMK1/blob/master/install.sh
Related
I'm trying to add a pnp solver to opencv
I'm working on ubuntu OS.
first I followed a tutorial on how to install opencv from source by cloning the repositories, then I tested the example and it worked so it compiled and installed succesfully.
I began adding my files and I made sure that no names are duplicated and all the files have been added so there were no issues with dependancies.
then I ran the cmake again, and ran the make command, but it is giving me the following error:-
opencv/modules/calib3d/src/RansacOptimalNPnP/../NPnP/DualVar.h:71:8: error: ‘optional’ in namespace ‘std’ does not name a template type
71 | std::optional<std::tuple<Eigen::Matrix3d, Eigen::Vector3d, double>>
I looked it up online and there is a possibility that I need to use C++ version 17 but the standard version in opencv is set to 11.
what can I change in the opencv cmake list to change that?
As I understand it Thamognya's answer, while useful to most users, misses what you are trying to do :
author and build a new module, to be compiled into the OpenCV library, (and your new module depends on C++17).
Re Setting C++ version and other options in Cmake:
To set the C++ version, and other Cmake options, I recommend using "cmake-gui". This is part of cmake, but separately installed in Ubuntu (and most Linix distros).
sudo apt-get install cmake-gui
You will find the c++ compiler options in the CMAKE_CXX* variables.
Re extending OpenCV:
If you have not already done so, I recommend cloning the OpenCV-contrib and OpenCV-extra repositories.
git clone https://github.com/opencv/opencv_contrib.git
git clone https://github.com/opencv/opencv_extra.git
These provide
examples of how to write and build new modules for OpenCV,
the data to run all the unit tests, to ensure your build is working correctly.
Re C++ version compatability:
C++ is intended to be backwards compatible, but there are details...
ABI compatability between compiler versions is a related issue.
This thread gives information on mixing versions of C++ in a library: Is it safe to link C++17, C++14, and C++11 objects
I would recommend starting by setting C++ version in "cmake-gui", and seeing if there are problems in configuration, build file generation, and compilation. Start with a minimal build and add only what you need. (i.e. Don't take on more complexity/bugs than you have to.)
OpenCV has the option to build many of its dependencies from source, (rather than using the versions you may have insalled on your operating system). This may help avoid compatability issues.
You can install OpenCV from ubuntu's opencv package via the following:
for python:
sudo apt-get install python3-opencv
for libopencv-dev:
sudo apt-get install libopencv-dev
If you want to compile it and not use ubuntu's OpenCV package, do the following:
# dependencies
sudo apt-get install cmake
sudo apt-get install gcc g++
# for python2 support
sudo apt-get install python-dev python-numpy
# for python3 support
sudo apt-get install python3-dev python3-numpy
# GTK support
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
# GTK 2 support
sudo apt-get install libgtk2.0-dev
# GTK 3 support
sudo apt-get install libgtk-3-dev
# Optional Dependencies
sudo apt-get install libpng-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libopenexr-dev
sudo apt-get install libtiff-dev
sudo apt-get install libwebp-dev
now that you are done with dependencies continue to the actual installation
sudo apt-get install git
git clone https://github.com/opencv/opencv.git
mkdir build
cd build/
cmake ../
if properly configured this is the output
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.6)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
-- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2)
-- packages path: lib/python2.7/dist-packages
--
-- Python 3:
-- Interpreter: /usr/bin/python3.4 (ver 3.4.3)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (ver 3.4.3)
-- numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.8.2)
-- packages path: lib/python3.4/dist-packages
make
sudo make install
This was shamelessly copied from opencv docs py setup in ubunutu
I have not been able to install either llvm version 9 or clang version 9 on Ubuntu. We have installed them on Windows.
I have tried a command and saw this response.
sudo apt-get install llvm-9
Reading package lists... Done
Building dependency tree
Reading state information...
Done E: Unable to locate package llvm-9
I have also tried and saw this response.
sudo apt-get install clang-9
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package clang-9
My /etc/apt/sources.list file contains
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9.0 main
I found the website and saw that the folder was llvm-toolchain-xenial-9. Trying that version did not work either.
What else can I do?
I have looked at downloading the binaries but am not sure what installation steps I might be missing. I am not interested in compiling source code.
The Clang/LLVM project provides Nightly build packages for Ubuntu and Debian.
See the https://apt.llvm.org
The goal is to provide Debian and Ubuntu [Clang and LLVM] packages ready to be installed with minimal impact on the distribution.
Packages are available for amd64 and i386 (except for recent Ubuntu) and for both the stable, old-stable and development branches (currently 8, 9 and 10).
Packages are built using stage2 and extremely similar to the one shipping in Debian & Ubuntu.
To use:
Add the appropriate repositories to the /etc/apt/sources.list file; there are distinct repos for different Debian and Ubuntu versions.
Add the apt key (shown in the link).
Run an apt update to refresh the cache.
Add packages with apt install clang-9 (or other package as desired).
If something "did not work" using the vetted package system, diagnose that issue directly. Xenial has Clang/LLVM 9 packages, and I've recently installed the packages into Disco.
The described symptom ("Unable to locate package") sounds as though one neglected to run apt update, in which case the packages from the newly-added sources would not be visible to apt. This is a tool-usage issue, not a lack of available packages.
LLVM INSTALLATION STEPS
-----------------------
LLVM Compiler Prerequisites:
OPERATING SYSTEM : Ubuntu 16.04 LTS
RAM : Minimum 16GB to 32GB
SWAP MEMORY : Minimum 10GB to 20GB
MEMORY NEEDED : Minimum 70GB
Install CMake version 3.5.1:
$sudo apt install cmake
LLVM Compiler Installation Steps
Step1:
#download llvm from https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz
#download clang from https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/cfe-8.0.1.src.tar.xz
#extract files into folders:
tar -xf cfe-8.0.1.src.tar.xz
tar -xf llvm-8.0.1.src.tar.xz
#change directory names to llvm8 and clang
mv cfe-8.0.1.src clang
mv llvm-8.0.1.src llvm8
Step2 : #change present working directory to llvm_source_directory here it is llvm8
$cd llvm8
##create build directory
$mkdir build
##change pwd to build directory
$cd build
#Build (PATH =/llvm8/build)
#execute following command in build directory:
$cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../
Step3: #execute make command in pwd:
/llvm8/build$ make
Step4 : #after 100% of linking process execute following command in build directory:
$sudo make install
$ sudo reboot
step5 : #after installation restart your system!
#for checking llvm installation type
$llvm-config --version #it shows 8.0.1
$clang --version #it shows 8.0.1
Here are the commands for LLVM 9:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get update
sudo apt-get install clang-9 libclang-9-dev llvm-9-dev
Can't get SFML to work on Raspberry.
Can this be done? I need to play several soundfiles with short time between each one. And have successfully made a program on my mac. And this is going to be used on the RPi.
Have anyone done this successfully?
I have tried to set it up with g++ and with code::blocks but can't get it to work, I think it is something to do with linking the files.
But now i am starting to wonder if it is at all possible?
If it is not, any suggestion of an easy (i am not that experienced) library for playing soundfiles one the raspberry pi using c++?
Hope someone can point me in the right direction quickly....
I recently managed to get SFML 2.0 to work on my raspi but it was not easy.
SFML 1.6 is available for raspberry pi with:
sudo apt-get install libsfml-dev
but I found this not to be compatible with my program written with SFML 2.X. I also tried and failed to use the Linux 32bit binary package SFML provides.
I believe the reason for this is because the raspi uses the ARM processor which was not what that build was built for.
I finally succeeded by downloading the Linux source from the SFML download page. I got SFML 2.0 because the instructions I found for building SFML from source were for that version and it was new enough to be functional although you may want to try a newer version. I downloaded all the dependencies and attempted to install using the script I got here. This may work for you but I ran into problems with the freetype library. The solution I found was to copy all the freetype header files to the parent "include" directory. There may be a better way but that worked for me. I hope this helped.
Edit: I just had to do this again on a fresh Raspian install. This time I used SFML 2.3. I did not have the same problem with freetype but I did have to install the following dependencies:
sudo apt-get install libx11-xcb-dev
sudo apt-get install libxcb-image0-dev
sudo apt-get install libxcb-randr0-dev
sudo apt-get install libudev-dev
here are the scripts I used:
to install dependencies:
sudo apt-get install libpthread-stubs0-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libx11-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install libglew1.5-dev
sudo apt-get install libjpeg8-dev
sudo apt-get install libsndfile1-dev
sudo apt-get install libopenal-dev
sudo apt-get install cmake
sudo apt-get install g++
to build it:
echo Starting SFML 2.0 install
echo see install.log for install output..
echo No.. Really.. Read it, this is my first
echo batch script for linux, so expect bugs
echo especially because I can\'t be stuffed
echo using regex to look for error output
echo building make for dynamic release
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=TRUE > install.log
echo Complete
echo making
make >> install.log
echo Complete
echo Installing
sudo make install >> install.log
echo Complete
echo building make for dynamic debug
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=TRUE >> install.log
echo Complete
echo making
make >> install.log
echo Complete
echo Installing
sudo make install >> install.log
echo Complete
echo building make for static release
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=FALSE >> install.log
echo Complete
echo making
make >> install.log
echo Complete
echo Installing
sudo make install >> install.log
echo Complete
echo building make for static debug
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=FALSE >> install.log
echo Complete
echo making
make >> install.log
echo Complete
echo Installing
sudo make install >> install.log
echo Complete
to run these, simply
copy them into a text file
save it with the file extension .sh
in properties, make it executable
(or, in terminal : sudo chmod +x yourfile.sh)
open it and click 'execute in terminal'
(or, in terminal : ./yourfile.sh)
I am trying to use Tesseract OCR Library in order to create a program to read pictures of elevator floor numbers. I haven't found any example on how to include the Tesseract Library into a C++ file. Something like:
#include "tesseract.h"
I am using Tesseract v 3.00 on Ubuntu 10.10.
The PlatformStatus Page has some comments on how to install it. It has dependencies (leptonica) which also need to be installed.
Another solution also linked from the above discussion has similar details for other linux distributions.
When it comes to linking with your program, this post has some specifics
There is also a C wrapper to the underlying API calls; looking at the files included should tell you what to include. Other wrappers are available here.
The documentation of the base API class are here...
A comment from the Platform Status page for the installation.
Comment by tim.lawr...#gmail.com, Nov 23, 2011
I successfully installed tesseract-ocr on Ubuntu 11.10 64Bit using these commands:
sudo apt-get install libleptonica-dev autoconf automake libtool libpng12-dev libjpeg62- dev libtiff4-dev zlib1g-dev subversion g++
cd
svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr
cd tesseract-ocr
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
cd /usr/local/share/tessdata/
sudo wget http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz
sudo gunzip eng.traineddata.gz
cd ~/tesseract-ocr/
tesseract phototest.tif phototest
cat phototest.txt
I'm trying to build some code on Ubuntu 10.04 LTS that uses OpenSSL 1.0.0. When I run make, it invokes g++ with the "-lssl" option. The source includes:
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/des.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
I ran:
$ sudo apt-get install openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
But I guess the openssl package doesn't include the library. I get these errors on make:
foo.cpp:21:25: error: openssl/bio.h: No such file or directory
foo.cpp:22:28: error: openssl/buffer.h: No such file or directory
foo.cpp:23:25: error: openssl/des.h: No such file or directory
foo.cpp:24:25: error: openssl/evp.h: No such file or directory
foo.cpp:25:25: error: openssl/pem.h: No such file or directory
foo.cpp:26:25: error: openssl/rsa.h: No such file or directory
How do I install the OpenSSL C++ library on Ubuntu 10.04 LTS?
I did a man g++ and (under "Options for Linking") for the -l option it states: " The linker searches a standard list of directories for the library..." and "The directories searched include several standard system directories..." What are those standard system directories?
You want to install the development package, which is libssl-dev:
sudo apt-get install libssl-dev
Run:
apt-get install libssl-dev
All of these answers are very outdated and from when the package was still being developed. You can now just use the "normal" command listed below:
sudo apt install openssl
Edit: OP's question is poorly worded... after all, OpenSSL is a library itself, so I read his question too quickly before answering. The command above installs "normal" OpenSSL.
Toward the bottom of his question he mentions that make fails, suggesting he is compiling the package manually. And yes, even if you download the TAR ball, it will include all of the openssl and libssl files, which you can then make from.
What OP is really asking for is the OpenSSL Development Library, in which case you can first install OpenSSL using the above command, and then run this afterwards:
sudo apt install libssl-dev
More info: https://linuxtect.com/how-to-install-openssl-libraries-on-ubuntu-debian-mint/
I found a detailed solution here: Install OpenSSL Manually On Linux
From the blog post...:
Steps to download, compile, and install are as follows (I'm installing version 1.0.1g below; please replace "1.0.1g" with your version number):
Step – 1 : Downloading OpenSSL:
Run the command as below :
$ wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
Also, download the MD5 hash to verify the integrity of the downloaded file for just varifacation purpose. In the same folder where you have downloaded the OpenSSL file from the website :
$ wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz.md5
$ md5sum openssl-1.0.1g.tar.gz
$ cat openssl-1.0.1g.tar.gz.md5
Step – 2 : Extract files from the downloaded package:
$ tar -xvzf openssl-1.0.1g.tar.gz
Now, enter the directory where the package is extracted like here is openssl-1.0.1g
$ cd openssl-1.0.1g
Step – 3 : Configuration OpenSSL
Run below command with optional condition to set prefix and directory where you want to copy files and folder.
$ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
You can replace “/usr/local/openssl” with the directory path where you want to copy the files and folders. But make sure while doing this steps check for any error message on terminal.
Step – 4 : Compiling OpenSSL
To compile openssl you will need to run 2 command : make, make install as below :
$ make
Note: check for any error message for verification purpose.
Step -5 : Installing OpenSSL:
$ sudo make install
Or without sudo,
$ make install
That’s it. OpenSSL has been successfully installed. You can run the version command to see if it worked or not as below :
$ /usr/local/openssl/bin/openssl version
OpenSSL 1.0.1g 7 Apr 2014
How could I have figured that out for
myself (other than asking this
question here)? Can I somehow tell
apt-get to list all packages, and grep
for ssl? Or do I need to know the
"lib*-dev" naming convention?
If you're linking with -lfoo then the library is likely libfoo.so. The library itself is probably part of the libfoo package, and the headers are in the libfoo-dev package as you've discovered.
Some people use the GUI "synaptic" app (sudo synaptic) to (locate and) install packages, but I prefer to use the command line. One thing that makes it easier to find the right package from the command line is the fact that apt-get supports bash completion.
Try typing sudo apt-get install libssl and then hit tab to see a list of matching package names (which can help when you need to select the correct version of a package that has multiple versions or other variations available).
Bash completion is actually very useful... for example, you can also get a list of commands that apt-get supports by typing sudo apt-get and then hitting tab.
Another way to install openssl library from source code on Ubuntu, follows steps below, here WORKDIR is your working directory:
sudo apt-get install pkg-config
cd WORKDIR
git clone https://github.com/openssl/openssl.git
cd openssl
./config
make
sudo make install
# Open file /etc/ld.so.conf, add a new line: "/usr/local/lib" at EOF
sudo ldconfig
You want the openssl-devel package.
At least I think it's -devel on Ubuntu. Might be -dev. It's one of the two.
As a general rule, when on Debian or Ubuntu and you're missing a development file (or any other file for that matter), use apt-file to figure out which package provides that file:
~ apt-file search openssl/bio.h
android-libboringssl-dev: /usr/include/android/openssl/bio.h
libssl-dev: /usr/include/openssl/bio.h
libwolfssl-dev: /usr/include/cyassl/openssl/bio.h
libwolfssl-dev: /usr/include/wolfssl/openssl/bio.h
A quick glance at each of the packages that are returned by the command, using apt show will tell you which among the packages is the one you're looking for:
~ apt show libssl-dev
Package: libssl-dev
Version: 1.1.1d-2
Priority: optional
Section: libdevel
Source: openssl
Maintainer: Debian OpenSSL Team <pkg-openssl-devel#lists.alioth.debian.org>
Installed-Size: 8,095 kB
Depends: libssl1.1 (= 1.1.1d-2)
Suggests: libssl-doc
Conflicts: libssl1.0-dev
Homepage: https://www.openssl.org/
Tag: devel::lang:c, devel::library, implemented-in::TODO, implemented-in::c,
protocol::ssl, role::devel-lib, security::cryptography
Download-Size: 1,797 kB
APT-Sources: http://ftp.fr.debian.org/debian unstable/main amd64 Packages
Description: Secure Sockets Layer toolkit - development files
This package is part of the OpenSSL project's implementation of the SSL
and TLS cryptographic protocols for secure communication over the
Internet.
.
It contains development libraries, header files, and manpages for libssl
and libcrypto.
N: There is 1 additional record. Please use the '-a' switch to see it
Go to the official website and download the source code for the version you need
Then unzip the update package and execute the following command
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl -Wl,-rpath,/usr/local/ssl/lib shared
Because the default is to generate only static libraries, if you want dynamic libraries, add the "shared" option
make && make install
sudo apt-get install libcurl4-openssl-dev