Skip to content

Add debug build option to macOS and iOS build scripts#15350

Merged
alalek merged 3 commits intoopencv:3.4from
komakai:apple-debug-build
Aug 23, 2019
Merged

Add debug build option to macOS and iOS build scripts#15350
alalek merged 3 commits intoopencv:3.4from
komakai:apple-debug-build

Conversation

@komakai
Copy link
Copy Markdown
Contributor

@komakai komakai commented Aug 20, 2019

Add command line option --debug to both the macOS and iOS build scripts to enable building OpenCV on these platforms with debug info.
Additionally add executable privilege to the macOS build script

force_builders=Custom Mac
build_image:Custom Mac=osx_framework

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution!

Did you take a look on BUILD_WITH_DEBUG_INFO CMake flag? (release builds with debug information)

buildcmd = [
"xcodebuild",
"MACOSX_DEPLOYMENT_TARGET=10.9",
"MACOSX_DEPLOYMENT_TARGET=10.12",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you port patch #12921 for OSX framework in a separate PR instead ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is #12921 the proper fix for #13759 ? Looking at the patch its not immediately obvious that this is the case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you mean to add MACOS_DEPLOYMENT_TARGET to the macOS build to work in the same way as IPHONEOS_DEPLOYMENT_TARGET in the iOS build. Correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the real fix would be to pass a -mmacosx-version-min flag to the cpu_sse41.cpp check to prevent the build from incorrectly setting CV_SSE4_1 when the target is less than 10.12

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you could share some link with MACOS_DEPLOYMENT_TARGET values difference short description (some guide how to select this value)

Yes, same way as IPHONEOS_DEPLOYMENT_TARGET:

  • some default value
  • command line parameter to change this value

BTW, Currently I'm trying to establish OSX framework on our Mac machines.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like MACOSX_DEPLOYMENT_TARGET=10.10 works too ('build' step).
10.9 doesn't (sse4.1 related messages).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you could share some link with MACOS_DEPLOYMENT_TARGET values difference short description (some guide how to select this value)

There is a simple list of macOS versions here:
https://simple.wikipedia.org/wiki/MacOS
Most Mac users upgrade to the latest OS promptly - when choosing a macOS target it would be usual to support the latest OS version plus 2 or 3 previous versions - so right now 10.12 or 10.11 would be good values

Copy link
Copy Markdown
Contributor Author

@komakai komakai Aug 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like MACOSX_DEPLOYMENT_TARGET=10.10 works too ('build' step).
10.9 doesn't (sse4.1 related messages).

For me even 10.9 is working - looks like the check for SSE4.1 support picks up the deployment target value, fails and then undefines HAVE_CPU_SSE4_1_SUPPORT

@komakai
Copy link
Copy Markdown
Contributor Author

komakai commented Aug 20, 2019

Did you take a look on BUILD_WITH_DEBUG_INFO CMake flag? (release builds with debug information)

I have seen this flag but not sure when this would be useful.
Is this so that crash dump stack-traces will have function names included with them?

@komakai
Copy link
Copy Markdown
Contributor Author

komakai commented Aug 22, 2019

I added support for the BUILD_WITH_DEBUG_INFO CMake flag (basically just copied from the Android build)

@alalek alalek merged commit 96d5cbd into opencv:3.4 Aug 23, 2019
@alalek alalek mentioned this pull request Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants