Configuration :
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/local/miniconda3/bin/python (found version "3.7.3")
-- Running gen_cmake_skeleton.py
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found BLAS: /home/rakesh/rishabh_workspace/Garbage/kaldi/tools/OpenBLAS/libopenblas.so
-- A library with LAPACK API found.
-- Found CUDA: /usr/local/cuda (found version "10.1")
-- Found NvToolExt: /usr/local/cuda/include
-- Found CUB: /home/rakesh/rishabh_workspace/Garbage/kaldi/tools/cub
-- Found CUDA: /usr/local/cuda (found version "10.1")
-- Caffe2: CUDA detected: 10.1
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.1
-- Found CUDNN: /usr/lib/x86_64-linux-gnu/libcudnn.so
-- Found cuDNN: v7.6.1 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1 6.1 6.1 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found Torch: /home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/lib/libtorch.so

Error Message
lattice-lmrescore-py-rnnlm.cc:(.text._ZN3c1019UndefinedTensorImpl9singletonEv[_ZN3c1019UndefinedTensorImpl9singletonEv]+0x7): undefined reference to `c10::UndefinedTensorImpl::_singleton'
CMakeFiles/lattice-lmrescore-py-rnnlm.dir/lattice-lmrescore-py-rnnlm.cc.o: In function `c10::IValue::toDouble() const':
lattice-lmrescore-py-rnnlm.cc:(.text._ZNK3c106IValue8toDoubleEv[_ZNK3c106IValue8toDoubleEv]+0xa0): undefined reference to `c10::Error::Error(c10::SourceLocation, std::string const&)'
CMakeFiles/lattice-lmrescore-py-rnnlm.dir/lattice-lmrescore-py-rnnlm.cc.o: In function `c10::IValue::toInt() const':
lattice-lmrescore-py-rnnlm.cc:(.text._ZNK3c106IValue5toIntEv[_ZNK3c106IValue5toIntEv]+0xa0): undefined reference to `c10::Error::Error(c10::SourceLocation, std::string const&)'
CMakeFiles/lattice-lmrescore-py-rnnlm.dir/lattice-lmrescore-py-rnnlm.cc.o: In function `c10::IValue::toTensor() const &':
...
...
_ZTIN5torch8autograd12AutogradMetaE]+0x10): undefined reference to `typeinfo for c10::AutogradMetaInterface'
collect2: error: ld returned 1 exit status
src/pyrnnlmbin/CMakeFiles/lattice-lmrescore-py-rnnlm.dir/build.make:122: recipe for target 'src/pyrnnlmbin/lattice-lmrescore-py-rnnlm' failed

kaldi -> CMakLists.txt
Even I added add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) also
all the pyrnnlm->CMakeLists.txt and pyrnnlmbin->CMakeLists.txt
pyrnnlm -> CMakeLists.txt
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(PUBLIC_HEADERS
    pytorch-rnnlm.h
)

add_library(kaldi-pyrnnlm
    pytorch-rnnlm.cc
)

target_include_directories(kaldi-pyrnnlm PUBLIC $<BUILD_INTERFACE:/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/include/torch/csrc/api/include>
PUBLIC $<BUILD_INTERFACE:/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/include>
PUBLIC $<BUILD_INTERFACE:/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/include/caffe2>
PUBLIC $<BUILD_INTERFACE:/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/include/ATen/core>
PUBLIC $<BUILD_INTERFACE:/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/include/c10>
PUBLIC $<BUILD_INTERFACE:/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/lib>)

#link_directories(/home/rakesh/rishabh_workspace/ASR/kaldi_old/tools/libtorch)

#target_include_directories(kaldi-pyrnnlm PUBLIC 
#    ${PYTORCH_DIR}
#    ${PYTORCH_DIR}/bin
#    ${PYTORCH_DIR}/include
#    ${PYTORCH_DIR}/share
#
#)

set(CMAKE_CXX_STANDARD 14)

target_include_directories(kaldi-pyrnnlm PUBLIC 
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
     $<INSTALL_INTERFACE:include/kaldi>
     #/home/rakesh/rishabh_workspace/ASR/kaldi_old/tools/libtorch/include
   #/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/include/torch/csrc/api/include
)

target_link_libraries(kaldi-pyrnnlm PUBLIC
    kaldi-lm
    kaldi-util
    kaldi-matrix
    kaldi-base
    -lz
    -ldl
    -fPIC
    -L/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch
    -L/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch/lib
    -L/home/rakesh/rishabh_workspace/Garbage/kaldi/tools/cuda/lib64

)

find_package(Torch REQUIRED PATHS /home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch)

#target_link_libraries(kaldi-pyrnnlm "${TORCH_LIBRARIES}")
#set_property(TARGET kaldi-pyrnnlm PROPERTY CXX_STANDARD 14)

install(TARGETS kaldi-pyrnnlm
    EXPORT kaldi-targets
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(FILES ${PUBLIC_HEADERS} DESTINATION include/kaldi/pyrnnlm)



pyrnnlmbin -> CMakeLists.txt (Calling the above CMakeLists.txt)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
set(CMAKE_VERBOSE_MAKEFILE ON)
#find_package(Torch REQUIRED)
#find_package(Torch REQUIRED PATHS /home/rakesh/rishabh_workspace/Garbage/kaldi/tools/libtorch)

set(CMAKE_CXX_STANDARD 14)

add_kaldi_executable(NAME lattice-lmrescore-py-rnnlm SOURCES lattice-lmrescore-py-rnnlm.cc DEPENDS kaldi-pyrnnlm kaldi-lat)

#target_link_libraries(lattice-lmrescore-py-rnnlm "${PYTORCH_DIR}")
#set_property(TARGET lattice-lmrescore-py-rnnlm PROPERTY CXX_STANDARD 14)


Tried all similar issues solution mention in the forum.