I am using libtorch and pcl for a c++ project. Below is the code I am trying, I am getting segmentation fault.
Versions:
Libtorch :  1.3.0
PCL      : 1.8

#include <pcl/point_cloud.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/common/common.h>
#include <torch/torch.h>
void load_pcd(){
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); 
if (pcl::io::loadPCDFile<pcl::PointXYZ>("pcd_path",*cloud)== -1){
    PCL_ERROR ("Couldn't read file test_pcd.pcd \n");
    return ;
}
else{
    std::cout<<"data loaded"<<std::endl;
}

}
int main(){
load_pcd();
return 0;
}

Cmake file:

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(load)
set(CMAKE_CXX_STANDARD 11)
find_package(PCL 1.2 REQUIRED)
find_package(Torch REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (load get_pcd_lst.cpp)
target_link_libraries (load ${PCL_LIBRARIES})
target_link_libraries(load ${TORCH_LIBRARIES})