Conversation
cmake/OpenCVUtils.cmake
Outdated
| # - 'TEST_FILE <c1> <c2>' - test file | ||
| # - 'TURN_OFF_COMPILER_FLAG <d1> <d2>' - incompatible options that shall be turned off | ||
| # - 'TURN_OFF_LINKER_FLAG <e1> <e2>' - incompatible options that shall be turned off | ||
| # - 'LINKER_FLAG <f1> <f2>' - linker flag that shall be used with the compiler flag |
There was a problem hiding this comment.
I'd suggest rewriting help string in more traditional cmake format:
ocv_check_compiler_flag(<LANG> <FLAG> <RESULT> [UPDATED_COMPILER_FLAGS <var>] [UPDATED_LINKER_FLAGS <var>] [TEST_FILE <file>] [TURN_OFF_COMPILER_FLAG <flag> [<flag> ...]] [TURN_OFF_LINKER_FLAG <flag> [<flag> ...]] [LINKER_FLAG <flag> [<flag> ...]])
There was a problem hiding this comment.
I don't think it is a good idea to mix variable update functionality to this macro. It adds unnecessary complexity and does not correlate with macro name: ocv_check_compiler_flag. "check" usually means that nothing will be changed and macro will just return some value.
There was a problem hiding this comment.
I agree but i had to deal with its usage: this macro is not always used the same variable containing the compiler/linker flags. Would you find better to pass these variables in read only and modifying them, if necessary, outside of the macro?
There was a problem hiding this comment.
Why not add these options to add_extra_compiler_option macro? Or a new higher level macro/function which will be used in one or two places?
There was a problem hiding this comment.
Why haven't you make a patch that you proposed in the issue? It was much simpler.
972af2c to
acb4025
Compare
* Ampere has CC 8.0 * Arm64 server support has been added in CUDA 11 (only V100 for now)
* use only supported CC in the list * workaround of opencv#17526
origibal commit: 63e92cc
acb4025 to
760e509
Compare
|
Can the build be relaunch once more? The problem (usage of "list(join ...)" not supported if CMake is not up to date) should be solved. |
760e509 to
caa5cfe
Compare
…ions, add dependant linker flags, etc.)
caa5cfe to
b0a0b68
Compare
|
My new version is much better but the builds fail because the |
|
@philippefoubert @mshabunin friendly reminder. |
I was off work for a few days... 😏 |
|
@mshabunin Friendly reminder. |
|
@asmorkalov @mshabunin Did you have time to perform the code review? |
|
@philippefoubert , looks like compile options has changed: I can see duplicated I thought the issue with ENABLE_PROFILING have been fixed in #17744, haven't it? |
cmake/OpenCVCompilerOptions.cmake
Outdated
|
|
||
| # add_extra_compiler_option(<option> [...] | ||
| # [TURN_OFF_COMPILER_FLAG <flag> [<flag> ...]] | ||
| # [TURN_OFF_LINKER_FLAG <flag> [<flag> ...]] |
There was a problem hiding this comment.
TURN_OFF
Perhaps naming is not accurate. Suggested variants:
- REMOVE
- or EXCLUDE
Also it would be nice to allow patterns here.
There was a problem hiding this comment.
I have made the renaming. Could explain what you think about when you are talking about patterns ?
There was a problem hiding this comment.
I mean to replace checks if(... STREQUAL ...) => if(... MATHES "${regex_pattern}")
In this case use string(REGEX REPLACE ...) instead of string(REPLACE ...) (but need to add argument boundary checks)
Mostly needed for handling of non-boolean options with "values", like -march= or -O2 / -O1 / -O0 / -O3 / Os.
| add_extra_compiler_option("-Wformat") | ||
| add_extra_compiler_option("-Werror=format-security -Wformat") | ||
| add_extra_compiler_option("-Wmissing-declarations") | ||
| add_extra_compiler_option("-Wmissing-prototypes") |
There was a problem hiding this comment.
Do we really need such massive changes?
BTW, good PR should not break existed code and doesn't require massive changes.
There was a problem hiding this comment.
I have only added the double quotes to ease the parsing in the macro and increase homogeneity: some of the calls to add_extra_compiler_option were done with double quotes and some were done without double quotes.
cmake/OpenCVUtils.cmake
Outdated
| message(STATUS "Performing Test ${RESULT} - Success") | ||
| else(${RESULT}) | ||
| message(STATUS "Performing Test ${RESULT} - Failed") | ||
| # message("${OUTPUT}") |
There was a problem hiding this comment.
remove unnecessary debug code (it is already added to CMakeError.log)
There was a problem hiding this comment.
@mshabunin > I thought the issue with ENABLE_PROFILING have been fixed in #17744, haven't it?
The #17744 is a quick fix to the ENABLE_PROFILING while the #17678 is more generic: the incompatibility between compiler options is not only related to profiling.
There was a problem hiding this comment.
Please keep original message(STATUS "Performing Test ${RESULT} - Failed") messages.
| set(_varname "HAVE_CPU_${OPT}_SUPPORT") | ||
| ocv_check_compiler_flag(CXX "${CPU_BASELINE_FLAGS}" "${_varname}" "${CPU_${OPT}_TEST_FILE}") | ||
| ocv_check_compiler_flag(CXX "${CPU_BASELINE_FLAGS}" "${_varname}" | ||
| LINKER_FLAGS "${OPENCV_EXTRA_EXE_LINKER_FLAGS}" |
There was a problem hiding this comment.
OPENCV_EXTRA_EXE_LINKER_FLAGS
IMHO, this should be assumed in "ocv_" check function.
…ated to "-fvisibility=hidden", integration
|
📌 (not directly related to this PR): |
|
@philippefoubert Related issue is here: #16990 |
|
@mshabunin @philippefoubert Friendly reminder. The PR still does not pass CI checks. |
1 similar comment
|
@mshabunin @philippefoubert Friendly reminder. The PR still does not pass CI checks. |
|
jenkins cn please retry a build |
|
This PR has been superseded by #17744. |
resolves #17657