Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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)

main copy.cpp (700 bytes) - added by steenparl@… 11 years ago.
Simple C++ test on xCode 4.6, OS-X 10.8.2. No log file
boost_log (610 bytes) - added by steenparl@… 11 years ago.
The log file from the install boost

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by steenparl@…

Attachment: main copy.cpp added

Simple C++ test on xCode 4.6, OS-X 10.8.2. No log file

comment:1 Changed 11 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 11 years ago by steenparl@…

Attachment: boost_log added

The log file from the install boost

comment:2 Changed 11 years ago by steenparl@…

Hi, I attached the log file by redirecting as you suggested.

comment:3 Changed 11 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 Changed 11 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!

Last edited 11 years ago by adfernandes (Andrew Fernandes) (previous) (diff)

comment:5 in reply to:  4 Changed 11 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 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!

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 Changed 11 years ago by adfernandes (Andrew Fernandes)

Resolution: invalid
Status: newclosed

The "-mp-4.7" denotes the MacPorts gcc compiler.

Thanks for letting me know!

comment:7 in reply to:  6 Changed 11 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.

Note: See TracTickets for help on using tickets.