Error related to Eigen while installing Caffe2 - ubuntu-16.04

I'm getting an error while installing Caffe2. After the succesful build, in the sudo make install step, it throws an error as #error Caffe2 requires Eigen to be at least 3.3.0

The solution is:
Check the Eigen version with: cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION
It will show some version variable values like below:
EIGEN_WORLD_VERSION 3
EIGEN_MAJOR_VERSION 2
EIGEN_MINOR_VERSION 192
These values are telling your problem directly. Your Eigen version is 3.2.192 instead of 3.3.0. So we need to upgrade this package.
Install the latest version of eigen from http://eigen.tuxfamily.org/index.php?title=Main_Page .
Extract the file wherever you want and rename it to eigen3.
cd /usr/include
sudo rm -rf eigen3/
Place the file you just extracted withsudo mv path/of/eigen3 /usr/include/
Lastly check the version again with cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h | grep VERSION
You should see these variables:
EIGEN_WORLD_VERSION 3
EIGEN_MAJOR_VERSION 3
EIGEN_MINOR_VERSION 4
You can run sudo make install again in the caffe2 directory and you will see that everything will be installed succesfully!

Related

rpmbuild unable to find the custom installed package

There are plenty of perl packages missing in Centos 8 and Rocky Linux. So, I try to get the rpm spec by cpanspec and build rpm by myself. But, it seems like that rpmbuild could not find the rpm I built.
This is the script for me to build rpm.
cd /root/rpmbuild
cpanspec --packer 'Example <example#example.com>' <Perl-Package-Name>
mkdir SOURCES
cp <Perl-Package-Name>.tar.gz SOURCES
rpmbuild -ba perl-<Package-Name>.spec
Let's say we have two package A and B. A is needed by B.
I try to build both of the packages through the script above. I build A first, switch into /root/rpmbuild/RPMS/noarch and install A.rpm. Then, I try to build package B.
I got
error: Failed build dependencies:
perl(A) is needed by perl-<B>
I try to check the existence of package A.
yum list installed | grep A
and
perldoc -l A
Both of the commands show that A exists.
Did I miss something?
update 2022/06/07
I just gave up and commented the BuildRequires: A in B package. This is not a good approach but it works.

/lib/modules/<version>/build/ not existent

I am trying to write a very basic "Hello World" device driver example which is taught in any device driver implementation introductory course. My makefile is as follows:
obj-m := hello.o
KDIR := /lib/modules/$(shell uname -r)/bulid
PWD := $(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
When I am using the make command, it is showing that /lib/modules/version_no/build/ is not existent. So I entered the directory /lib/modules/version_no and found that there is one directory build but if I use the ls command, it is printed in red colour, which means that the directory is deprecated. It contains one link to ../../../usr/src/version_no, but to my surprise, the version number in that link and the name of the actual folder in /usr/src/ are not same. Can anyone point out what is the issue? I am using centos 6.1.
This is because you have not yet downloaded the linux headers of your particular kernel version.
Assuming your kernel version is 4.15.0-32-generic, install the required header files using sudo apt install linux-headers-4.15.0-32-generic
In your case you can get it by
yum install kernel-devel kernel-headers

How to set up an additional glibc compiler on centOS

I'm using CentOS 7 and it is having glibc version 2.17.
I want to set up additional glibc compiler(same or another version) on this OS.
Please anyone help me in this.
Let us assume you want to install 2.14 along 2.17 on centOS 7 and use it to compile your projects, just follow the steps below :
mkdir ~/glibc_install; cd ~/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd build
../configure --prefix=/opt/glibc-2.14
make -j4
sudo make install
export LD_LIBRARY_PATH=/opt/glibc-2.14/lib
PS: Building process takes 2.5 hours on slow AWS.

How to uninstall opencv in Ubuntu?

I have the following system:
Linux 64 bit LTS 12.04
I have multiple installations of opencv library on the system.
I want to know the procedure to remove all opencv libraries from the system.
I am having trouble while executing my program through Eclipse IDE.
Though I can build the project when I try to execute it, it gives the following error:
OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in release, file /build/buildd /opencv-2.3.1/modules/core/src/matrix.cpp, line 1364
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp:1364: error: (-215) k == STD_VECTOR_MAT in function release
Confusing thing is I am not able to find the path specified in the error i.e.
/build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp
I am able to compile the same source code using command line tool gcc and using pkg-config.
However I am unable to do the same through eclipse IDE.
You can also uninstall by going to the "build" folder directory of opencv from terminal, and execute the following
make uninstall
cd ..
sudo rm -r build
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
I remember I used this command a while ago to remove all opencv related things. It is interactive which promote you to remove the file. choose y or n depending.Take your time and be-careful
$> sudo find / -name "*opencv*" -exec rm -i {} \;
The correct way is cd /path/to/cv/build then sudo make uninstall. Of course you will have to have the source code with you
I tried the exec rm thing but nothing changed. Also FYI, sudo apt-get remove libopencv-* did not remove openCV for me

Compiling MongoDB r2.0.2 on ubuntu 10.04 resulted in error

I am compiling MongoDB from source with instructions from http://www.mongodb.org/display/DOCS/Building+for+Linux
I ran into this error after ran "scons all":
rty/js-1.7/jsscan.c
third_party/js-1.7/jsscan.c:112:22: error: jsautokw.h: No such file or directory
third_party/js-1.7/jsscan.c: In function 'FindKeyword':
third_party/js-1.7/jsscan.c:122: warning: label 'test_guess' defined but not used
third_party/js-1.7/jsscan.c:119: warning: label 'got_match' defined but not used
scons: *** [third_party/js-1.7/jsscan.o] Error 1
scons: building terminated because of errors
I am on a 64 bit ubuntu 10.04. gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5), scons version is:
script: v1.2.0.d20100117.r4629, 2010/01/17 22:23:21, by scons on scons-dev
engine: v1.2.0.d20100117.r4629, 2010/01/17 22:23:21, by scons on scons-dev
Does anyone have the same problem? There are similar errors reported for this jsscan file in earlier versions, but has been fixed since.
Dude it worked! Do this:
sudo apt-get remove xulrunner-1.9.2-dev xulrunner-1.9.2
curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
tar zxvf js-1.7.0.tar.gz
cd js/src
export CFLAGS="-DJS_C_STRINGS_ARE_UTF8"
make -f Makefile.ref
sudo JS_DIST=/usr make -f Makefile.ref export
Then run scons all again
There is no need to uninstall "xulrunner-1.9.2-dev" and "xulrunner-1.9.2" as it's also uninstalls other packages you may need later.
Just install the newer version of scons package (I used for it scons-2.1.0).
Download scons-2.1.0.tar.gz
Install it and use the installed one instead of the scons v1.2.0 repository package for Ubuntu 10.04.
It worked for me without any additional tricks.