question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] boost/*: ios variant misses two define exports

See original GitHub issue

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost/1.74.0
  • Operating System+version: iOS
  • Compiler+version: clang 12
  • Conan version: conan 1.31.0
  • Python version: Python 3.8.5

Conan profiles

build.profile

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

host.profile (ios Simulator)

[settings]
os=iOS
os.version=12.0
arch=x86_64
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libc++
build_type=Debug
[options]
[build_requires]
[env]

Steps to reproduce

I’m cross compiling boost from MacOS to iOS Simulator (x86_64). Which works quite well. Awesome job! However when consuming the library weird runtime crashes occur due to invalid memory access. Two days of debugging and address sanitizer showed that the consuming product has two defines missing. -DBOOST_SP_USE_PTHREADS and -DBOOST_AC_USE_PTHREADS.

https://github.com/conan-io/conan-center-index/blob/d956a467dab31503f0054face5c09f83b7a05f68/recipes/boost/all/conanfile.py#L764-L767

May I suggest that you add the flags -DBOOST_SP_USE_PTHREADS and -DBOOST_AC_USE_PTHREADS to the package_info method? https://github.com/conan-io/conan-center-index/blob/d956a467dab31503f0054face5c09f83b7a05f68/recipes/boost/all/conanfile.py#L1014

Thanks for your time!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
madebrcommented, Dec 13, 2020

I’m just saying that the upstream project needs to be made aware of the problem. They know their code the best.

1reaction
madebrcommented, Dec 13, 2020

Sounds good, I will add

def package_info(self):
--- a/recipes/boost/all/conanfile.py
+++ b/recipes/boost/all/conanfile.py
@@ -1245,3 +1245,10 @@
                         self.cpp_info.components["_libboost"].cxxflags.append("-pthread")
                         self.cpp_info.components["_libboost"].sharedlinkflags.extend(["-pthread","--shared-memory"])
                         self.cpp_info.components["_libboost"].exelinkflags.extend(["-pthread","--shared-memory"])
+            elif self.settings.os == "iOS":
+                if self.options.multithreading:
+                    # https://github.com/conan-io/conan-center-index/issues/3867
+                    # runtime crashes occur when using the default platform-specific reference counter/atomic
+                    self.cpp_info.components["headers"].extend(["BOOST_AC_USE_PTHREADS", "BOOST_SP_USE_PTHREADS"])
+                else:
+                    self.cpp_info.components["headers"].extend(["BOOST_AC_DISABLE_THREADS", "BOOST_SP_DISABLE_THREADS"])

to the pr at #3872

Read more comments on GitHub >

github_iconTop Results From Across the Web

B2 User Manual - 1.81.0 - Boost C++ Libraries
Note that the debug and release variants are created in different directories, so you can switch between variants or even build multiple variants...
Read more >
Difference ios ipa export with development or ad hoc profile
I would like to know what is the "real" difference between an IPA exported with a development or an ad hoc profile, in...
Read more >
iOS Player settings - Unity - Manual
If an icon Texture is missing, Unity scales the icon Texture with the nearest size, with a preference towards using larger Textures.
Read more >
export - JavaScript - MDN Web Docs
Every module can have two different types of export, named export and default export. You can have multiple named exports per module but ......
Read more >
Problem exporting boost.variant from dll - C++ Forum
Problem exporting boost.variant from dll ... boost::variant<bool,unsigned char,double,float,short,int,struct boost::detail::variant::void_ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found