If I add torch libaries: target_link_libraries(pointcloud "${catkin_LIBRARIES}" "${TORCH_LIBRARIES}") then I get the following error:
catkin_make
Base path: /home/wai043/catkin_ws
Source space: /home/wai043/catkin_ws/src
Build space: /home/wai043/catkin_ws/build
Devel space: /home/wai043/catkin_ws/devel
Install space: /home/wai043/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/wai043/catkin_ws/build"
####
####
#### Running command: "make -j12 -l12" in "/home/wai043/catkin_ws/build"
####
[  7%] Built target laserscan_to_pointcloud
[ 14%] Built target matching
[ 21%] Built target pointcloud_to_laserscan
Scanning dependencies of target pointcloud
[ 25%] Linking CXX executable /home/wai043/catkin_ws/devel/lib/extraction/pos_imu
[ 35%] Built target write
[ 42%] Built target laserscan_to_pointcloud_node
[ 57%] Built target read
[ 64%] Built target pointcloud_to_laserscan_node
[ 67%] Building CXX object data_extraction/CMakeFiles/pointcloud.dir/src/pointcloud.cpp.o
CMakeFiles/pos_imu.dir/src/pos_imu.cpp.o: In function `main':
pos_imu.cpp:(.text+0xfb): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
pos_imu.cpp:(.text+0x18d): undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
CMakeFiles/pos_imu.dir/src/imu_extraction/imu.cpp.o: In function `ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)':
imu.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0xaf): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pos_imu.dir/src/pos_extraction/position.cpp.o: In function `ros::SubscriptionCallbackHelperT<boost::shared_ptr<geometry_msgs::PoseStamped_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)':
position.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN13geometry_msgs12PoseStamped_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN13geometry_msgs12PoseStamped_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0xaf): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
collect2: error: ld returned 1 exit status
data_extraction/CMakeFiles/pos_imu.dir/build.make:366: recipe for target '/home/wai043/catkin_ws/devel/lib/extraction/pos_imu' failed
make[2]: *** [/home/wai043/catkin_ws/devel/lib/extraction/pos_imu] Error 1
CMakeFiles/Makefile2:1221: recipe for target 'data_extraction/CMakeFiles/pos_imu.dir/all' failed
make[1]: *** [data_extraction/CMakeFiles/pos_imu.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/wai043/catkin_ws/src/data_extraction/src/pointcloud.cpp: In function ‘int main(int, char**)’:
/home/wai043/catkin_ws/src/data_extraction/src/pointcloud.cpp:30:5: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
     while (std::getline(filenumberoflines, line))
     ^~~~~
/home/wai043/catkin_ws/src/data_extraction/src/pointcloud.cpp:33:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
  if (parameter_line_configuration > number_of_lines-1){
  ^~
[ 71%] Linking CXX executable /home/wai043/catkin_ws/devel/lib/extraction/pointcloud
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
collect2: error: ld returned 1 exit status
data_extraction/CMakeFiles/pointcloud.dir/build.make:678: recipe for target '/home/wai043/catkin_ws/devel/lib/extraction/pointcloud' failed
make[2]: *** [/home/wai043/catkin_ws/devel/lib/extraction/pointcloud] Error 1
CMakeFiles/Makefile2:3215: recipe for target 'data_extraction/CMakeFiles/pointcloud.dir/all' failed
make[1]: *** [data_extraction/CMakeFiles/pointcloud.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed