Title: Compilation flags to ensure small binary size? · Issue #1 · pybind/python_example · GitHub
Open Graph Title: Compilation flags to ensure small binary size? · Issue #1 · pybind/python_example
X Title: Compilation flags to ensure small binary size? · Issue #1 · pybind/python_example
Description: There are a few compilation flags that make a huge difference with respect to unnecessary bloat in the resulting binaries when compiling stuff using pybind11. In particular, that is -fvisibility=hidden on GCC/Clang (>50% difference). It'...
Open Graph Description: There are a few compilation flags that make a huge difference with respect to unnecessary bloat in the resulting binaries when compiling stuff using pybind11. In particular, that is -fvisibility=hi...
X Description: There are a few compilation flags that make a huge difference with respect to unnecessary bloat in the resulting binaries when compiling stuff using pybind11. In particular, that is -fvisibility=hi...
Opengraph URL: https://github.com/pybind/python_example/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compilation flags to ensure small binary size?","articleBody":"There are a few compilation flags that make a huge difference with respect to unnecessary bloat in the resulting binaries when compiling stuff using pybind11. In particular, that is `-fvisibility=hidden` on GCC/Clang (\u003e50% difference).\n\nIt's also good to turn on C++14 support if possible, since that pushes some precomputation to the compile phase. In CMake, I would just do:\n\n```\n if (HAS_CPP14_FLAG)\n set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++14\")\n elseif (HAS_CPP11_FLAG)\n set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++11\")\n else()\n message(FATAL_ERROR \"Unsupported compiler -- at least C++11 support is needed!\")\n endif()\n```\n\nIs it possible to enable these flags here as well?\n","author":{"url":"https://github.com/wjakob","@type":"Person","name":"wjakob"},"datePublished":"2016-03-09T20:19:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/1/python_example/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:058de5cd-2db4-0677-3d30-03ec67b99913 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB1A:2F9F8B:CD41E2:10E9D80:69741BA5 |
| html-safe-nonce | f3cfa7376d7c1ecfb92d27e3c5c6f8ec8acfe7e888d5a5bd02b59586366ea6cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjFBOjJGOUY4QjpDRDQxRTI6MTBFOUQ4MDo2OTc0MUJBNSIsInZpc2l0b3JfaWQiOiI1NDQ1Mzg4NTUxNTg5MjA2OTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4fc53cb5c987031460adf3b2f51f418f1ca0da1cb29870e7e4049b8c0e22e839 |
| hovercard-subject-tag | issue:139690215 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pybind/python_example/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/72e6aeb52a423df0aa098adba9b9556df22df09dcf8de704c3784ca639b365d9/pybind/python_example/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/72e6aeb52a423df0aa098adba9b9556df22df09dcf8de704c3784ca639b365d9/pybind/python_example/issues/1 |
| og:image:alt | There are a few compilation flags that make a huge difference with respect to unnecessary bloat in the resulting binaries when compiling stuff using pybind11. In particular, that is -fvisibility=hi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wjakob |
| hostname | github.com |
| expected-hostname | github.com |
| None | 447dc9917c3d68d647a01abfdefe55ec7ee1785922136c1d8395dbb3ab6d57b9 |
| turbo-cache-control | no-preview |
| go-import | github.com/pybind/python_example git https://github.com/pybind/python_example.git |
| octolytics-dimension-user_id | 17565521 |
| octolytics-dimension-user_login | pybind |
| octolytics-dimension-repository_id | 50649061 |
| octolytics-dimension-repository_nwo | pybind/python_example |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 50649061 |
| octolytics-dimension-repository_network_root_nwo | pybind/python_example |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8dad7bdfecbe3eaa97ac4e632d6b47e2b23e81d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width