benz725 opened a new issue #19731:
URL: https://github.com/apache/incubator-mxnet/issues/19731


   ## Description
   **I want to use tensorrt with my mxnet, i compile the mxnet with the source 
code. when I add the flag cmake -D USE_TENSORRT=1, i report compile error like 
this:**
   CMake Error at 
/home/yfzx/.local/lib/python3.7/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165
 (message):
     Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)
   Call Stack (most recent call first):
     
/home/yfzx/.local/lib/python3.7/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458
 (_FPHSA_FAILURE_MESSAGE)
     
/home/yfzx/.local/lib/python3.7/site-packages/cmake/data/share/cmake-3.18/Modules/FindProtobuf.cmake:626
 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
     CMakeLists.txt:240 (find_package)
   
   
   ### Error Message
   ###reported CMakeError.log content is here:
   Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the 
following output:
   Change Dir: 
/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp
   
   Run Build Command(s):/usr/bin/make cmTC_e1cfd/fast && /usr/bin/make  -f 
CMakeFiles/cmTC_e1cfd.dir/build.make CMakeFiles/cmTC_e1cfd.dir/build
   make[1]: 
进入目录“/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp”
   Building C object CMakeFiles/cmTC_e1cfd.dir/src.c.o
   /usr/bin/cc   -Wall -Wno-unknown-pragmas -Wno-sign-compare -O3 
-DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_e1cfd.dir/src.c.o -c 
/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp/src.c
   Linking C executable cmTC_e1cfd
   /home/yfzx/.local/lib/python3.7/site-packages/cmake/data/bin/cmake -E 
cmake_link_script CMakeFiles/cmTC_e1cfd.dir/link.txt --verbose=1
   /usr/bin/cc  -Wall -Wno-unknown-pragmas -Wno-sign-compare -O3 
-DCMAKE_HAVE_LIBC_PTHREAD CMakeFiles/cmTC_e1cfd.dir/src.c.o -o cmTC_e1cfd 
   CMakeFiles/cmTC_e1cfd.dir/src.c.o:在函数‘main’中:
   src.c:(.text.startup+0x23):对‘pthread_create’未定义的引用
   src.c:(.text.startup+0x2c):对‘pthread_detach’未定义的引用
   src.c:(.text.startup+0x35):对‘pthread_cancel’未定义的引用
   src.c:(.text.startup+0x40):对‘pthread_join’未定义的引用
   src.c:(.text.startup+0x4b):对‘pthread_atfork’未定义的引用
   collect2: error: ld returned 1 exit status
   CMakeFiles/cmTC_e1cfd.dir/build.make:105: recipe for target 'cmTC_e1cfd' 
failed
   make[1]: *** [cmTC_e1cfd] Error 1
   make[1]: 
离开目录“/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp”
   Makefile:140: recipe for target 'cmTC_e1cfd/fast' failed
   make: *** [cmTC_e1cfd/fast] Error 2
   
   
   Source file was:
   #include <pthread.h>
   
   void* test_func(void* data)
   {
     return data;
   }
   
   int main(void)
   {
     pthread_t thread;
     pthread_create(&thread, NULL, test_func, NULL);
     pthread_detach(thread);
     pthread_cancel(thread);
     pthread_join(thread, NULL);
     pthread_atfork(NULL, NULL, NULL);
     pthread_exit(NULL);
   
     return 0;
   }
   
   Determining if the function pthread_create exists in the pthreads failed 
with the following output:
   Change Dir: 
/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp
   
   Run Build Command(s):/usr/bin/make cmTC_9390f/fast && /usr/bin/make  -f 
CMakeFiles/cmTC_9390f.dir/build.make CMakeFiles/cmTC_9390f.dir/build
   make[1]: 
进入目录“/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp”
   Building C object CMakeFiles/cmTC_9390f.dir/CheckFunctionExists.c.o
   /usr/bin/cc   -Wall -Wno-unknown-pragmas -Wno-sign-compare -O3 
-DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o 
CMakeFiles/cmTC_9390f.dir/CheckFunctionExists.c.o -c 
/home/yfzx/.local/lib/python3.7/site-packages/cmake/data/share/cmake-3.18/Modules/CheckFunctionExists.c
   Linking C executable cmTC_9390f
   /home/yfzx/.local/lib/python3.7/site-packages/cmake/data/bin/cmake -E 
cmake_link_script CMakeFiles/cmTC_9390f.dir/link.txt --verbose=1
   /usr/bin/cc  -Wall -Wno-unknown-pragmas -Wno-sign-compare -O3 
-DCHECK_FUNCTION_EXISTS=pthread_create 
CMakeFiles/cmTC_9390f.dir/CheckFunctionExists.c.o -o cmTC_9390f  -lpthreads 
   /usr/bin/ld: 找不到 -lpthreads
   collect2: error: ld returned 1 exit status
   CMakeFiles/cmTC_9390f.dir/build.make:105: recipe for target 'cmTC_9390f' 
failed
   make[1]: *** [cmTC_9390f] Error 1
   make[1]: 
离开目录“/home/yfzx/mxnet-src/apache-mxnet-src-1.7.0-incubating/build/CMakeFiles/CMakeTmp”
   Makefile:140: recipe for target 'cmTC_9390f/fast' failed
   make: *** [cmTC_9390f/fast] Error 2
   
   ## To Reproduce
   (If you developed your own code, please provide a short script that 
reproduces the error. For existing examples, please provide link.)
   I use cuda 10.2, cudnn8.0.4, mxnet-src1.7.0, i have install tensorrt 7.2.1 
with the offical tutorial, have pass the helloworld test
   
   ### Steps to reproduce
   (Paste the commands you ran that produced the error.)
   
   1.i copy the $mxnet-src-path$/config/linux_gpu.cmake to 
$mxnet-src-path$/config.cmake, make some change like add one line "set(USE_NCCL 
1)"
   2.cd $mxnet-src-path$, then mkdir build,  cd build, cmake -D USE_TENSORRT=1 
.. 
   
   ## What have you tried to solve it?
   
   1. When i remove the -D USE_TENSORRT=1 flag, it can compile correctly, whe i 
add this flag, it will report like this issue;
   2.
   
   ## Environment
   
   ***We recommend using our script for collecting the diagnostic information 
with the following command***
   `curl --retry 10 -s 
https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py
 | python3`
   
   <details>
   cuda 10.2, cudnn8.0.4, mxnet-src1.7.0, python 3.7.4(anaconda), nvidia driver 
version:440.44
   <summary>Environment Information</summary>
   
   ```
   # Paste the diagnose.py command output here
   ```
   
   </details>
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@mxnet.apache.org
For additional commands, e-mail: issues-h...@mxnet.apache.org

Reply via email to