-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix openmp unwork issue in cmake version below 3.9.0 #679
Conversation
…penmp bad behavior in ubuntu 16.04 or linux likely system
definitely not all the homework. |
what is the bad openmp behavior ? |
liekkas, qq 458083152, reported this issue in 637093648 qq group@2018/11/29, as these listed below: liekkas(458083152) 18:52:56 ubuntu 16.04, NDK 16C, arm64-v8a, XiaoMi series mobile phone. |
老铁们,那么我们应该用cmake3.9.0还是cmake2.9.0?看到提交的代码中minimum version是2.9.0? |
PR 还没完成,今晚不通宵的话,有时间改一下。或者 up 主可以改。 |
Hello, |
CMakeLists.txt
Outdated
@@ -11,7 +11,7 @@ set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation | |||
endif() | |||
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") | |||
|
|||
cmake_minimum_required(VERSION 2.8.10) | |||
cmake_minimum_required(VERSION 2.9.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall me 3.1.0 after #a2611f47206ef0fe
(16.04 comes with 3.5.1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for this pr, i make a mistake, version should be above 3.9.0.
but i post a second commit, it's no need to update cmake to version 3.9.0. pls check this commit, thanks.
after second commit, it's no need to update cmake version to 3.9.0 or above, thanks to @CorentinB |
Hi, @kalcohol
Thus I only successully compiled ncnn and run ncnn benchmark on my rooted android phone. CMake3.6+lastest official ncnn
CMake3.6+latest kalcohol ncnn
From the above result, the speed is actually faster, which I think openmp works correctly. |
But I tested my model and it became unstable, Sometimes fast and sometimes slow |
pls check over heat issue, if openmp work, cpu will over heat very easily. if your device is a dev-board, not a cell phone, it's a easy way to conform the issue - use a fan direct to the main chip to cooling down cpu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check #689, this should fix your issues.
CMakeLists.txt
Outdated
@@ -11,7 +11,7 @@ set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation | |||
endif() | |||
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") | |||
|
|||
cmake_minimum_required(VERSION 2.9.0) | |||
cmake_minimum_required(VERSION 2.8.10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in your other PR, current master needs 3.1 so no need to go back, a PR must be created to actually bump it to 3.1
@@ -32,6 +32,7 @@ option(NCNN_CMAKE_VERBOSE "print verbose cmake messages" OFF) | |||
|
|||
if(NCNN_OPENMP) | |||
find_package(OpenMP) | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With cmake >= 3.1 this should not be necessary (and is not recommended by "modern cmake" anyway).
close as #689 merged. |
change cmake minimum required version from 2.8.10 to 2.9.0 to avoid openmp bad behavior in ubuntu 16.04 or linux likely system(need more test).