#38239 closed defect (invalid)
boost builds but does not run
Reported by: | steenparl@… | Owned by: | adfernandes (Andrew Fernandes) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.3 |
Keywords: | Cc: | ||
Port: | boost |
Description (last modified by mf2k (Frank Schima))
I am trying to get boost on my mac. I have had it before, but it is not working. The Macports almost works, though. I have executed the following:
sudo port self update sudo port upgrade outdated sudo port install boost
It builds, but running the simple attached program using boost threads hangs with what looks like an invalid address (0).
Attachments (2)
Change History (9)
Changed 12 years ago by steenparl@…
Attachment: | main copy.cpp added |
---|
comment:1 Changed 12 years ago by cooljeanius (Eric Gallager)
No log file
Even if it doesn't create one automatically, if you're compiling it from the command line, you can always redirect the output to your own log file, or pipe it through tee
, or something else like that
Changed 12 years ago by steenparl@…
The log file from the install boost
comment:2 Changed 12 years ago by steenparl@…
Hi, I attached the log file by redirecting as you suggested.
comment:3 Changed 12 years ago by mf2k (Frank Schima)
Description: | modified (diff) |
---|---|
Owner: | changed from macports-tickets@… to adfernandes@… |
In the future, please use WikiFormatting and Cc the port maintainer(s).
comment:4 follow-up: 5 Changed 12 years ago by adfernandes (Andrew Fernandes)
Works just fine for me with both
/usr/bin/clang++ -I /opt/local/include -L /opt/local/lib main.cpp -lboost_thread-mt -lboost_system-mt -o main
and
g++-mp-4.7 -I /opt/local/include -L /opt/local/lib main.cpp -lboost_thread-mt -lboost_system-mt -o main
or
/usr/bin/clang++ -I /opt/local/include main.cpp /opt/local/lib/libboost_thread-mt.a /opt/local/lib/libboost_system-mt.a -o main
and
g++-mp-4.7 -I /opt/local/include main.cpp /opt/local/lib/libboost_thread-mt.a /opt/local/lib/libboost_system-mt.a -o main
Can you run your test program under the debugger (either gdb
or lldb
)?
You might want to add the -g
debugging flags to the compilation of main.cpp
for that. You should not need to install the debug
variant of boost
!
comment:5 Changed 12 years ago by steenparl@…
Replying to adfernandes@…:
Works just fine for me with both
/usr/bin/clang++ -I /opt/local/include -L /opt/local/lib main.cpp -lboost_thread-mt -lboost_system-mt -o mainand
g++-mp-4.7 -I /opt/local/include -L /opt/local/lib main.cpp -lboost_thread-mt -lboost_system-mt -o mainor
/usr/bin/clang++ -I /opt/local/include main.cpp /opt/local/lib/libboost_thread-mt.a /opt/local/lib/libboost_system-mt.a -o mainand
g++-mp-4.7 -I /opt/local/include main.cpp /opt/local/lib/libboost_thread-mt.a /opt/local/lib/libboost_system-mt.a -o mainCan you run your test program under the debugger (either
gdb
orlldb
)?You might want to add the
-g
debugging flags to the compilation ofmain.cpp
for that. You should not need to install thedebug
variant ofboost
!
Thank you for that. I copied your lines and they both work for me, except for the "-mp-4.7" which my system doesn't seem to recognize. This shows, I assume, that the macport is fine and the problem I am having must be in xCode, where I still have the problem. Thanks again for your help.
comment:6 follow-up: 7 Changed 12 years ago by adfernandes (Andrew Fernandes)
Resolution: | → invalid |
---|---|
Status: | new → closed |
The "-mp-4.7" denotes the MacPorts gcc
compiler.
Thanks for letting me know!
comment:7 Changed 12 years ago by adfernandes (Andrew Fernandes)
One thought - boost has problems with 32-bit builds due to the atomic operations. So if you have universal builds or are running a 32-bit executable, that might be the problem.
Simple C++ test on xCode 4.6, OS-X 10.8.2. No log file