If you using ubuntu 18.04 on desktop, following below link to install ros-melodic
https://velog.io/@korkhg15/ubuntu-18.04-ros-melodic-install
Or using jetson series, following below command
sudo apt update && sudo apt upgrade -y
mkdir ~/roslibrary && cd ~/roslibrary
git clone https://github.com/jetsonhacks/installROSXavier
cd installROSXavier
chmod 777 ./installROS.sh
chmod 777 ./setupCatkinWorkspace.sh
./installROS.sh -p ros-melodic-desktop-full
./setupCatkinWorkspace.sh
sudo apt install ros-melodic-rviz* ros-melodic-rqt*
cd ~/catkin_ws/ && catkin_make
source ~/catkin_ws/devel/setup.bash
Ceres Solver
sudo apt install -y cmake
sudo apt install -y libgoogle-glog-dev libgflags-dev
sudo apt install -y libatlas-base-dev
sudo apt install -y libeigen3-dev
sudo apt install -y libsuitesparse-dev
mkdir ~/ceres && cd ~/ceres
wget -O ceres-solver.tar.gz https://ceres-solver.googlesource.com/ceres-solver/+archive/399cda773035d99eaf1f4a129a666b3c4df9d1b1.tar.gz
tar -zxf ceres-solver.tar.gz
mkdir build && cd build
cmake ../
make -j$(nproc)
sudo make install
GTSAM
sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt update #not necessary
sudo apt install -y libgtsam-dev libgtsam-unstable-dev
PCL
mkdir ~/pcl-latest && cd ~/pcl-latest
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
SRC_DIR='pwd'
BUILD_DIR=${SRC_DIR}/build
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake ../
make -j$(nproc)
sudo make install