Skip to content
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

Can you build this in OSX? I can not #39

Closed
blockcorporation opened this issue Feb 20, 2015 · 36 comments
Closed

Can you build this in OSX? I can not #39

blockcorporation opened this issue Feb 20, 2015 · 36 comments

Comments

@blockcorporation
Copy link

I can build bitcoin, peerunity, and others but for this project I can not build.

I get the following error

ld: symbol(s) not found for architecture x86_64

I would think it is something to do with the code? Maybe we can fix this to make it easier to compile on OSX?

@blockcorporation
Copy link
Author

Perhaps related to this?

Peerunity/Peerunity#148

@bearsylla
Copy link

I don't have a Mac machine to test with, however, I managed to have a community member to compile blackcoind using macports on his mac.

sudo port install boost db48 openssl miniupnpc
git clone https://github.com/rat4/blackcoin/
cd blackcoin/src
make -f makefile.osx

@bearsylla
Copy link

For compiling the QT wallet, appearently there is some bugs that affect bitcoin as well, https://trac.macports.org/ticket/46951

@blockcorporation
Copy link
Author

Yes, I was able to compile the daemon but still unable to compile the -qt. I should have been more specific.

@bearsylla
Copy link

According to the link I gave in privous comment, It seems that compiling the QT require patching of all the boost headers.

@bearsylla
Copy link

Have you tried using homebrew instead of macports?

@blockcorporation
Copy link
Author

Yeah I have tried with both. Fresh installs. I believe it is a misconfigured -qt makefile file for mavericks.

@jprichardson
Copy link

Anymore luck with this? Tried on Yosemite at all? I may give it a shot on Yosemite/homebrew.

@nanocoinorg
Copy link

I had these issues and I made modifications to the *.pro file that has it compiling. Unfortunately now I see a runtime error:

Assertion failed: (!pthread_mutex_lock(&m)), function lock, file /opt/local/include/boost/thread/pthread/recursive_mutex.hpp, line 110.
Abort trap: 6

It seems other projects have ran into this issue, once I solve it I can do a pull request.

@ghost
Copy link

ghost commented Mar 26, 2015 via email

@nanocoinorg
Copy link

I typically use linux so I'm still trying to find the best way to insert a backtrace to get information regarding the error.

@nanocoinorg
Copy link

I went through and commented out each AssertLockHeld and it didn't change anything so it is unrelated. I must say I find it funny that Litecoin and Reddcoin both have simply removed the asserts considering the usefulness in debugging.

@nanocoinorg
Copy link

I have this fixed, it requires two minor changes to the .pro file. If you need me to build your newest OSX binary I can do this for you too.

@ghost
Copy link

ghost commented Apr 4, 2015 via email

@mammix2
Copy link

mammix2 commented Apr 8, 2015

Im having the same issues today, If you could share that fix for this error would be great :)

'Assertion failed: (!pthread_mutex_lock(&m)), function lock, file /opt/local/include/boost/thread/pthread/recursive_mutex.hpp, line 110.'

@mammix2
Copy link

mammix2 commented Apr 8, 2015

probably not ideal but adding NDEBUG to the .pro DEFINES allowed it to compile and run.
More of a workaround than a fix.

@ghost
Copy link

ghost commented Apr 9, 2015 via email

@mammix2
Copy link

mammix2 commented Apr 9, 2015

Can you explain in more detail why it's too dangerous?
Just for my knowledge i would like to understand. Thanks

@xranby
Copy link

xranby commented Apr 9, 2015

mammix2: the assert is a runtime check to make sure that two simultaneously running threads of the program that manipulate a shared piece of information take turns by acquiring a lock before they alter the shared information. The assert has failed this means that data-corruption will occur if the two threads alters the shared piece of information at the same time. By using NDEBUG you basically say its OK to make the program continue to run despite that it has detected an error which is dangerous to your data.

If this kind of assert only triggers on OSX then the root cause of the issue may be in the Boost library’s or in the OSX posix thread handling.

@mammix2
Copy link

mammix2 commented Apr 9, 2015

@xranby, thankyou very much. Very helpful info :)

@xranby
Copy link

xranby commented Apr 9, 2015

FYI: blackcoin internally uses pthread_cond_wait and this function has been broken on Mac OS X
it is fixed in boost 1.57
http://www.boost.org/users/history/version_1_57_0.html

I would recommend you to try building blackcoin on OSX using at least boost 1.57

The boost 1.58 beta also fixes some more thread issues:
http://www.boost.org/users/history/version_1_58_0.html

@mammix2
Copy link

mammix2 commented Apr 9, 2015

@xranby, perfect, i'll give that a go

@mammix2
Copy link

mammix2 commented Apr 9, 2015

unfortunately still getting the same error after updating boost. Updated ports and confirmed i'm now running version boost @1.57.0_1

Any ideas?
do i need to change any boost suffix in the .pro file to specify 1.57 ?

@xranby
Copy link

xranby commented Apr 9, 2015

can you attach a debugger like gdb or lldb and print a backtrace
(bt using gdb)
https://sourceware.org/gdb/onlinedocs/gdb/Backtrace.html
(thread backtrace when using lldb)
http://lldb.llvm.org/tutorial.html
when you hit the assert?

@mammix2
Copy link

mammix2 commented Apr 9, 2015

Using LLDB within my Qt IDE, i think the first assert causing the error is in sync.h line 66
I'm far from being an expert at this stuff, could you confirm if this is correct?
Here is the full backtrace.
https://gist.github.com/mammix2/a8096aa3001bca71f42a

@ghost
Copy link

ghost commented Apr 10, 2015

That looks like the static initialization order fiasco, and should be fixed by commit 7d766db

@mammix2
Copy link

mammix2 commented Apr 10, 2015

@rat4, well done buddy. that has sorted the problem :)
@xranby thanks for your help too.

@mammix2
Copy link

mammix2 commented Apr 10, 2015

If you guys want an BC Mac wallet compiled let me know. I'll be glad to help :)

@bearsylla
Copy link

From IRC: < nscrypto> hey, when compiling on osx I get this error http://pastebin.com/j2uKgT6s

It was boost 1.58

Edit: Update

< nscrypto> ok, i just tried compiling bitcoin and I get the same error
< nscrypto> must be boost/macports

@xranby
Copy link

xranby commented Apr 23, 2015

The boost/static_assert.hpp is broken when boost has defined BOOST_NO_CXX11_STATIC_ASSERT

#ifndef BOOST_NO_CXX11_STATIC_ASSERT
#else
            // code here is in clearly wrong order when using boost 1.58
#endif

I will explain:

/opt/local/include/boost/static_assert.hpp:87:26: note: template is declared here
template <bool x> struct STATIC_ASSERTION_FAILURE;
                         ^

this line at 87 with the template definition has to be above the line 36 where the template is used:

/opt/local/include/boost/static_assert.hpp:36:48: note: expanded from macro 'BOOST_STATIC_ASSERT_MSG'
#     define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
                                               ^
/opt/local/include/boost/static_assert.hpp:169:13: note: expanded from macro 'BOOST_STATIC_ASSERT'
            sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( __VA_ARGS__ ) >)>\
            ^

Reorder the two blocks and you have fixed boost.

@barnumbirr
Copy link

@xranby Could you be more specific please? I didn't understand what I needed to modify in /opt/local/include/boost/static_assert.hpp so that this would work with boost 1.58.

Thank you.

@ghost
Copy link

ghost commented Jun 15, 2015

@Mrsmn current git master should work with boost 1.58

@MystPhysX
Copy link

Thank you @rat4

Other coins are experiencing this issue as well. I just wish this was higher up on the Google search results.

@barnumbirr
Copy link

I actually found an easier fix that worked for me on OSX 10.9.5:

brew install boost --c++11

Cheers.

@mammix2
Copy link

mammix2 commented Jun 30, 2015

@MystPhysX i forgot about this thread fixing that assert issue. Hope you get it sorted :)

@MystPhysX
Copy link

@Mrsmn Thank you. I was not aware that Boost built without c++11 support by default, I'll have to keep that in mind in the future.

@mammix2 Cheers.

@ghost ghost closed this as completed Oct 31, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants