I know that installing Boost C++ libraries has nothing to do with GPGPU and multi-cores. Nevertheless, I have posted my procedure for installing Boost C++ libraries on a Mac.
I use Macports on my Mac and I find that it is the easiest way to install any open-source software on Mac OSX.
1. Search for boost packages
bash-3.2$ sudo port search boost
boost @1.40.0 (devel)
Collection of portable C++ source libraries
boost-build @2.0-m12 (devel)
Build system for large project software construction
boost-gil-numeric @1.0 (devel)
An algorithm extension to boost-gil.
boost-jam @3.1.17 (devel)
Boost.Jam (BJam) is a build tool based on FTJam
py26-pyplusplus @1.0.0 (python, devel)
Py++ is an framework for creating a code generator for Boost.Python library and ctypes package
Found 5 ports.
2. Install
---> Fetching boost-jam
---> Verifying checksum for boost-jam
---> Extracting boost-jam
---> Configuring boost-jam
---> Building boost-jam with target all
---> Staging boost-jam into destroot
---> Installing boost-jam
---> Fetching boost
---> Verifying checksum for boost
---> Extracting boost
---> Configuring boost
---> Building boost with target all
---> Staging boost into destroot
---> Installing boost
---> Fetching boost-build
---> Verifying checksum for boost-build
---> Extracting boost-build
---> Configuring boost-build
---> Building boost-build with target all
---> Staging boost-build into destroot
---> Installing boost-build
3. Here's my example program:
#include <boost/any.hpp>
{
a(5);
a = 7.67;
std:cout<<boost::any_cast<double>(a)<<std::endl;
}
Now when I tried compiling my example program, I got a lot of errors such as:
example3.cpp:11:25: error: boost/any.hpp: No such file or directory
example3.cpp: In function ‘int main()’:
example3.cpp:18: error: ‘boost’ has not been declared
example3.cpp:18: error: ‘any’ was not declared in this scope
example3.cpp:18: error: expected `;' before ‘a’
example3.cpp:19: error: ‘a’ was not declared in this scope
example3.cpp:20: error: ‘boost’ has not been declared
example3.cpp:20: error: ‘any_cast’ was not declared in this scope
example3.cpp:20: error: expected primary-expression before ‘double’
example3.cpp:20: error: expected `;' before ‘double’
So I googled around and came to this link and tried compiling using the full path:
and that worked...!!!!
I also did this as a shortcut for compiling my programs that need the Boost libraries:
/opt/local/var/macports/software/boost/1.40.0_1/opt/local/include/
7.67
Hope this helps :)
i was new to MAC you have made my life easier, by your post on installing s/w on MAC.
ReplyDeleteThanks a lot.
Glad to know that the post is of some help
ReplyDelete