{"action":"closed","issue":{"url":"https://api.github.com/repos/Tencent/ncnn/issues/659","repository_url":"https://api.github.com/repos/Tencent/ncnn","labels_url":"https://api.github.com/repos/Tencent/ncnn/issues/659/labels{/name}","comments_url":"https://api.github.com/repos/Tencent/ncnn/issues/659/comments","events_url":"https://api.github.com/repos/Tencent/ncnn/issues/659/events","html_url":"https://github.com/Tencent/ncnn/issues/659","id":381617214,"node_id":"MDU6SXNzdWUzODE2MTcyMTQ=","number":659,"title":"In function `ncnn::get_omp_num_threads()': cpu.cpp:(.text+0x61): undefined reference to `omp_get_num_threads'","user":{"login":"karlTUM","id":15608199,"node_id":"MDQ6VXNlcjE1NjA4MTk5","avatar_url":"https://avatars2.githubusercontent.com/u/15608199?v=4","gravatar_id":"","url":"https://api.github.com/users/karlTUM","html_url":"https://github.com/karlTUM","followers_url":"https://api.github.com/users/karlTUM/followers","following_url":"https://api.github.com/users/karlTUM/following{/other_user}","gists_url":"https://api.github.com/users/karlTUM/gists{/gist_id}","starred_url":"https://api.github.com/users/karlTUM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlTUM/subscriptions","organizations_url":"https://api.github.com/users/karlTUM/orgs","repos_url":"https://api.github.com/users/karlTUM/repos","events_url":"https://api.github.com/users/karlTUM/events{/privacy}","received_events_url":"https://api.github.com/users/karlTUM/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-16T14:17:12Z","updated_at":"2018-11-19T10:38:18Z","closed_at":"2018-11-19T10:38:18Z","author_association":"NONE","body":"Hi,\r\nI would like to build a cpp file for ncnn inference. \r\n`g++ -L/home/karl/opencv_src/opencv_release/lib -L/home/karl/Documents/work_code/py/ncnn/build/install/lib -o \"opencv_ncnn_test\"`\r\n\r\nThere are many errors:\r\n\r\n```\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(cpu.cpp.o): In function `ncnn::get_omp_num_threads()':\r\ncpu.cpp:(.text+0x61): undefined reference to `omp_get_num_threads'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(cpu.cpp.o): In function `ncnn::set_omp_num_threads(int)':\r\ncpu.cpp:(.text+0x71): undefined reference to `omp_set_num_threads'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(cpu.cpp.o): In function `ncnn::get_omp_dynamic()':\r\ncpu.cpp:(.text+0x81): undefined reference to `omp_get_dynamic'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(cpu.cpp.o): In function `ncnn::set_omp_dynamic(int)':\r\ncpu.cpp:(.text+0x91): undefined reference to `omp_set_dynamic'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(cpu.cpp.o): In function `_GLOBAL__sub_I_cpu.cpp':\r\ncpu.cpp:(.text.startup+0x5): undefined reference to `omp_get_max_threads'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(mat.cpp.o): In function `ncnn::Mat::substract_mean_normalize(float const*, float const*) [clone ._omp_fn.1]':\r\nmat.cpp:(.text+0x16): undefined reference to `omp_get_num_threads'\r\nmat.cpp:(.text+0x1e): undefined reference to `omp_get_thread_num'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(mat.cpp.o): In function `ncnn::Mat::substract_mean_normalize(float const*, float const*) [clone ._omp_fn.0]':\r\nmat.cpp:(.text+0x216): undefined reference to `omp_get_num_threads'\r\nmat.cpp:(.text+0x21e): undefined reference to `omp_get_thread_num'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(mat.cpp.o): In function `ncnn::Mat::substract_mean_normalize(float const*, float const*) [clone ._omp_fn.2]':\r\nmat.cpp:(.text+0x416): undefined reference to `omp_get_num_threads'\r\nmat.cpp:(.text+0x41d): undefined reference to `omp_get_thread_num'\r\n/home/karl/Documents/work_code/py/ncnn/build/install/lib/libncnn.a(mat.cpp.o): In function `ncnn::copy_cut_border(ncnn::Mat const&, ncnn::Mat&, int, int, int, int, ncnn::Allocator*, int) [clone ._omp_fn.3]':\r\nmat.cpp:(.text+0x667): undefined reference to `omp_get_num_threads'\r\nmat.cpp:(.text+0x66e): undefined reference to `omp_get_thread_num'\r\n\r\n```\r\n\r\nBut during building ncnn.a, it finds the OpenMP, Here it is\r\n\r\n```\r\n-- CMAKE_INSTALL_PREFIX = /home/karl/Documents/work_code/py/ncnn/build/install\r\n-- The C compiler identification is GNU 7.3.0\r\n-- The CXX compiler identification is GNU 7.3.0\r\n-- Check for working C compiler: /usr/bin/cc\r\n-- Check for working C compiler: /usr/bin/cc -- works\r\n-- Detecting C compiler ABI info\r\n-- Detecting C compiler ABI info - done\r\n-- Detecting C compile features\r\n-- Detecting C compile features - done\r\n-- Check for working CXX compiler: /usr/bin/c++\r\n-- Check for working CXX compiler: /usr/bin/c++ -- works\r\n-- Detecting CXX compiler ABI info\r\n-- Detecting CXX compiler ABI info - done\r\n-- Detecting CXX compile features\r\n-- Detecting CXX compile features - done\r\n-- Found OpenMP_C: -fopenmp (found version \"4.5\") \r\n-- Found OpenMP_CXX: -fopenmp (found version \"4.5\") \r\n-- Found OpenMP: TRUE (found version \"4.5\")  \r\n\r\n```\r\n\r\nWhat is the problem here? \r\n\r\nThank you.\r\n\r\n"}}
{"actor":{"display_login":"nihui"}}