Monday, 11 January 2021

Sunday, 3 January 2021

How to get / install latest cmake version?

The most common situation is when you want to install the latest version of cmake, but your Operating System's repositories are not updated. For example, in my case I have a laptop running Ubuntu 16.04, and when I executed the command sudo apt install cmake the installed version was 3.5.1; instead of 3.19.1 which is the current version at cmake.org.

How can I get the latest version?

Well, we can install it by following one of these methods: Building and Installing or Using binary files.

A. Building and Installing (recommended)

A-1. Uninstall the default version provided by Ubuntu's package manager and configuration by using:

sudo apt remove --purge --auto-remove cmake

or:

sudo apt purge --auto-remove cmake

A-2. Go to the official CMake webpage, then download and extract the latest version. Update the version and build variables in the following command to get the desired version:

version=3.19
build=1
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/

A-3. Install the extracted source by running:

./bootstrap
make -j$(nproc)
sudo make install

A-4. Test your new cmake version.

$ cmake --version

Results of cmake --version:

cmake version 3.19.X

CMake suite maintained and supported by Kitware (kitware.com/cmake).

B. Using binary files (cmake-gui wont work well)

B-1. Uninstall the default version provided by Ubuntu's package manager as in A-1.

B-2. Go to the official CMake webpage, then download and install the latest .sh version in opt/cmake. Update the version and build variables in the following command to get the desired version:

version=3.19
build=1
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build-Linux-x86_64.sh 
sudo mkdir /opt/cmake
sudo sh cmake-$version.$build-Linux-x86_64.sh --prefix=/opt/cmake

B-3. Add the installed binary link to /usr/local/bin/cmake by running this:

sudo ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake

B-4. Test your new cmake version as in A-4.

Note

In 3.19.X the X represents the last part of the version that we defined as build. The build may change if cmake is updated. According to the official web page the Latest Release is 3.19.1. If you want the Previous Release 3.18.5 just replace the version and build parameters like this:

version=3.18
build=5

Tuesday, 8 December 2020

How to copy a file to docker container?

1. to check the container id

# docker ps


2. to copy a file from host to container

# sudo docker cp ./test.mp4 73411ab49381:/workspace/input

Thursday, 3 December 2020

How to configure a Makefile with Opencv?

 First compile the opencv using the previous post


Second, modify the Makefile as following:-

all:demo

CFLAGS = `pkg-config --cflags opencv4`
LIBS = `pkg-config --libs opencv4`


SRC:=main.cpp  file2.cpp  file3.cpp  file4.cpp
demo:$(SRC)
    g++ $(CFLAGS) -std=c++11 -Wall -O2  $^  -c -Iffmpeg/include/  -I rtspperf/inc
    g++ $(LIBS) -g *.o -o main -lopencv_core -lopencv_imgproc -lopencv_imgcodecs -ldl -lz -lm  -llzma
    @rm *.o -f

clean:
    rm -f demo


Wednesday, 11 November 2020

PCIe versus NVLink

 For normal PC, we are using PCIe 3.0 for connecting to 2080Ti.


For training, it is better using NVLink and the data throughput is much faster than PCIe.


However, for deployment or model inference, PCIe is more than enough.

How to do empty trash in ubuntu using terminal?

 sudo apt install trash-cli

 trash-empty

Thursday, 5 November 2020

Windows - MobileXterm / Linux - SnowFlake

https://mobaxterm.mobatek.net/

 https://github.com/subhra74/snowflake