Archive for March, 2006

Java on Gentoo

2

The simplest way to get started with Java development in Gentoo is to install the Blackdown JDK-1.4.2 along with the Eclipse IDE:

sh# emerge blackdown-jdk eclipse-sdk

If you want to install the sun’s version of the jdk instead of the blackdown jdk, you can get the 1.4.2 version of it using:

sh# emerge sun-jdk java-sdk-docs

To install the 1.5 version of the jdk, you need to unmask it first. Add the following two lines to your /etc/portage/package.keywords file:

>=dev-java/sun-jdk-1.5.0 ~x86
>=dev-java/java-sdk-docs-1.5.0 ~x86

Now do the emerge:

sh# emerge sun-jdk java-sdk-docs

You can also install both of these versions at the same time, and then make one of them as the default jdk. If you need java support in other applications too(like web browser etc), then make sure to add the relevant keywords in the /etc/portage/package.use file:

=dev-java/sun-jdk-1.4.2.10-r2 X alsa browserplugin doc examples jce mozilla nsplugin

This also installs the documentation and the examples – remove these words if you don’t to install them. Also change the version number if you are installing the 1.5 version of the jdk.

If you want to use Eclipse IDE to create C++ programs, you need the eclipse-cdt plugin. First unmask it by placing the following line in /etc/portage/package.keywords file:

>=dev-util/eclipse-cdt-2.0 ~x86

Now do the emerge:

sh# emerge eclipse-cdt

More information on installing java 1.5 and eclipse 3.x on Gentoo OS.

Installing C++ Boost on Slackware/Zenwalk

9

C++ Boost 1.33.1 on Slackware/Zenwalk:

Download bjam slackware package(tgz) and boost-1_33_1 source package(tar.gz) from the sourceforge.net website:
bjam for slackware
c++ boost source package
(or Google for the latest versions of these two packages)
Save these two files in the home directory and then cd into it:
sh# cd $HOME
Install bjam(as root):
sh# installpkg boost-jam-3.1.11-1-linuxx86.tgz
sh# export PATH=$PATH:/boost-jam-3.1.11-1-linuxx86/
Compile and install boost(as root):
sh# tar xjvf boost_1_33_1.tar.bz2
sh# cd boost_1_33_1
sh# bjam “-sTOOLS=gcc” install

C++ Boost is now installed. This procedure doesn’t install the files in the default library paths, so compilation commands are slightly longer than they are for Gentoo and Debian/Ubuntu:

sh# g++ -o first first.cpp -I/usr/local/include/boost-1_33_1
sh# g++ -o second second.cpp -I/usr/local/include/boost-1_33_1 -L/usr/local/lib -lboost_filesystem-gcc

You can simplify this by adding the paths of boost folders to gcc library environment variables:

sh# export CPLUS_INCLUDE_PATH=/usr/local/include/boost-1_33_1
sh# export LIBRARY_PATH=/usr/local/lib

The compilation can now be performed using the following simple commands:

sh# g++ -o first first.cpp
sh# g++ -o second second.cpp -lboost_filesystem-gcc

The two ‘export’ commands can be added at the end of the profile file(/etc/profile or $HOME/.bash_profile) to avoid having to type them every time a new shell is opened. Other way to simplify the process would be to create symbolic links to boost library paths in the Slackware standard include paths so that gcc can find them directly.

How to Test C++ Boost Installation

4

Once C++ Boost is installed on a machine, the fastest way to test the installation is to use some of the libraries from it in test C++ programs and try to build them. The following two programs can be used for this purpose:
first.cpp
[cpp]#include
#include
int main()
{
boost::any a(5);
a = 7.67;
std::cout<<boost::any_cast(a)<<std::endl;
}[/cpp]
Build this program using:

sh# g++ -o first first.cpp

The second example needs to be linked to a library file.
second.cpp
[cpp]#include
#include
namespace bfs=boost::filesystem;
int main()
{
bfs::path p(“second.cpp”);
if(bfs::exists(p))
std::cout< <<std::endl;
}[/cpp]

sh# g++ -o second second.cpp -lboost_filesystem

If the above two programs build and run with out any problems, then boost is installed and working properly on your system.

Installing C++ Boost on Gentoo and Debian/Ubuntu

11

Note: Updated the post to note the availability of C++ Boost 1.34.1 libraries for Gentoo and (especially) for Ubuntu 7.10(Gutsy Gibbon).

1. C++ Boost on Gentoo:

On the shell prompt, type:

sh# emerge boost

This should install the latest version of boost available for Gentoo. Currently 1.33.1 version of Boost Libraries is available for Gentoo. Synchronise(‘emerge –sync’) with the Gentoo portage if your ‘emerge -p boost’ shows an earlier version. You can install the latest version Boost 1.34.1 by adding the line “dev-libs/boost ~x86″ to “/etc/portage/package.keywords” file.

2. C++ Boost on Debian/Ubuntu:

Update2:
Boost 1.34.1 version is now available. To install the latest version, run the following command(or select these packages from Synaptic Package Manager):
sh# apt-get   install   libboost-date-time-dev libboost-date-time1.34.1   libboost-dev   libboost-doc   libboost-filesystem-dev   libboost-filesystem1.34.1   libboost-graph-dev   libboost-graph1.34.1   libboost-iostreams-dev   libboost-iostreams1.34.1 libboost-program-options-dev   libboost-program-options1.34.1   libboost-python-dev   libboost-python1.34.1   libboost-regex-dev   libboost-regex1.34.1   libboost-signals-dev   libboost-signals1.34.1   libboost-test-dev   libboost-test1.34.1   libboost-thread-dev   libboost-thread1.34.1  

Or,

sh# apt-get install libboost.*-dev libboost-doc libboost.*1.34.1
Update1: See the new update above
Boost 1.33.1 version is now available. To install this version, run the following command(or select these packages from Synaptic Package Manager):
sh# apt-get   install   libboost-date-time-dev libboost-date-time1.33.1   libboost-dev   libboost-doc   libboost-filesystem-dev   libboost-filesystem1.33.1   libboost-graph-dev   libboost-graph1.33.1   libboost-iostreams-dev   libboost-iostreams1.33.1 libboost-program-options-dev   libboost-program-options1.33.1   libboost-python-dev   libboost-python1.33.1   libboost-regex-dev   libboost-regex1.33.1   libboost-signals-dev   libboost-signals1.33.1   libboost-test-dev   libboost-test1.33.1   libboost-thread-dev   libboost-thread1.33.1  

Or,

sh# apt-get install libboost.*-dev libboost-doc libboost.*1.33.1
Run the following command(or select these packages from Synaptic Package Manager): See the update above
sh# apt-get   install   libboost-date-time-dev libboost-date-time1.33.0   libboost-dev   libboost-doc   libboost-filesystem-dev   libboost-filesystem1.33.0   libboost-graph-dev   libboost-graph1.33.0   libboost-iostreams-dev   libboost-iostreams1.33.0 libboost-program-options-dev   libboost-program-options1.33.0   libboost-python-dev   libboost-python1.33.0   libboost-regex-dev   libboost-regex1.33.0   libboost-signals-dev   libboost-signals1.33.0   libboost-test-dev   libboost-test1.33.0   libboost-thread-dev   libboost-thread1.33.0  

You can use the following simple command to install every library present in Boost that matches the pattern, if you don’t want to be selective about which libraries to install:

sh# apt-get install libboost.*-dev libboost-doc libboost.*1.33.0

All this mess could be avoided if only Debian/Ubuntu packages could build a meta-package to include all the C++ Boost libraries. One could use the pattern libboost.* but it includes the Boost debug files(libboost-dbg) too.

3. Build C++ Programs Using Boost Libraries

Once the boost package is installed, the C++ programs that make use of boost libraries can be built simply like this:

sh# g++ -o first first.cpp

If the program needs to be linked to a library(for eg: filesystem library), then specify the name of the library using the -l switch:

sh# g++ -o second second.cpp -lboost-filesystem

I will follow this up with the installation procedure for Slackware and RPM based distributions(Done).


Update:Thanks to Jun Zhang for pointing out the missing packages in the Boost installation command for Ubuntu; the command is now updated.

Setting the Stage for C++ Boost

1

C++ is a modern language. There is a difference between calling a programming language to be “still applicable” and calling it to be “modern”. “still applicable” languages exist because they are efficient enough to solve the problems for which they were originally created and that such problems still exist. Modern languages, on the contrary, solve the problems of today, and solve them efficiently. For a language that was created in 1970s, when today’s problems were unimaginable, C++ grew with the time, gone through constant modifications so that it can better reflect the requirements of every age. One excellent proof of the constant improvements that C++ language has undergone to remain competent enough to meet the new challenges is the C++ Standard Library.

To see the tremendous improvement in the productivity levels obtained by using the higher-level utilities of C++ standard library, consider the following examples: the first one reads a set of names from the standard input, sorts them in the alphabetical order, and then prints them out to the standard output:

[cpp]vector names;
string name;
while(cin<<name)
names.push_back(name);
sort(names.begin(), names.end());
copy(names.begin(), names.end(), ostream_insterter(cout, "\n"));[/cpp]

Lines 2, 3, and 4 can be further simplified, but I wanted them to be that way. Consider another example, which checks whether a string is a palendrome or not:

[cpp]
compare(pal.begin(), pal.end(), pal.rbegin());
[/cpp]

The C++ Standard Library : A Tutorial and ReferenceNo, there isn’t anything missing out there. That’s all the code that you need to check for a palendrome. Try writing these two samples without using the C++ standard library, and you will see the difference. Its not just a time-consuming effort to write them in C-style of programming but it also needs more investments in terms of testing and the maintenance jobs. Still a large number of C++ programmers do not make sufficient use of it. But those who do, look at C++ language from a completely different perspective – as a modern and a highly productive software development tool. Like, there hardly would be any memory management chores to do by the programmer, except when creating the low-level libraries.

C++ Templates: The Complete GuideWhen one gets used to this style of software development with C++ – making use of its standard library – one starts to wish for more such utilities that could solve their everyday problems equally effectively. Changes to the C++ language/standard library are not made very frequently in order to provide a level of stability to the it. The void thus created has been partially addressed by another excellent collection of quality libraries, called C++ Boost Libraries. Its not an official part of the C++ language, but its portable, efficient, rich in functionality and is very close to the philosphy of standard C++ library. Infact, many of the new additions proposed for the next version of C++ standard library are picked from the Boost libraries. A large number of C++ programmers have already started to make use of these libraries, making it unofficially official part of the C++ language ;)

Some example libraries present in Boost are: filesystem access library, thread libarary, network socket library, regular expression library, lambda template library etc. There is a large set of collections, algorithms and iterators too. Look at the complete list of libraries if you are interested: there is a list according to the categories of the libraries and an alphabetical list.I will soon follow this up with a few examples using some of these C++ Boost libraries.


buy genuine Zovirax online purchase prednisone prescription online prednisone no prior script prednisone no rx needed order prednisone usa cod ordering Paxil over the counter order Paxil without rx needed order rx free Paxil cheapest Paxil available online purchase Paxil without purchase Paxil without prescription prednisone cheap overnight fedex Zovirax canadian pharmacy Zovirax cheap overnight fedex purchase Strattera usa cod Cytotec online buy saturday delivery where to buy accutane buy Cytotec online overseas buy frontpage software cheap mortgage application software iphone software download plagiarism software to buy for parents Crestor side effects buy masterwriter software discount bmi sesac microsoft software downloads wm5 software download treo software download best antivirus software download cheap microsoft word software buy software for mac software discounts for educators microsoft office buy windows xp oem software buy flash cs3 software photoshop cs 5 full fashion conference italy buy Orlistat with amex windows 7 product key purchase online cheapest xenical available online prescription xenical online Zithromax uk sales where to purchase generic valtrex online without a prescription quality generic valtrex cheap valtrex usa (no prescriptions needed for Buspar|buy Buspar with no prescription|online pharmacies Buspar|Buspar cheap|buy Buspar without rx|purchase rx Buspar without|Buspar purchase online|purchase Buspar online without rx|purchase Buspar free consultation|buy Buspar Online|buy Buspar american express|buy Buspar Online|buy cheap Buspar with dr. prescription|Buspar side effects|fedex Buspar without priscription|overnight Buspar without a rx|order cheap overnight Buspar|Buspar toronto|uk order Buspar|Buspar no doctors prescription|Buspar mexico|Buspar order|no prescription Buspar with fedex|order generic Buspar|buy Buspar without rx from us pharmacy|prezzo Buspar|Buspar 10mg|Buspar from canada|purchasing Buspar without a script|buy Buspar australia|purchase Buspar visa without prescription|online purchase Buspar|buy Buspar no perscription cod|buy Buspar drugs|buy Buspar with visa|buy Buspar without rx needed|buy Buspar without prescription|buy Buspar no prescription low cost|purchase purchase Buspar no prescription cheap buy generic Valtrex buy cheap Nolvadex cod buy Nolvadex infertility in internet visa at Wisconsin Ontario omicrosoft office 2003 megaupload buy pharmacy Strattera waterview Buy genuine accutane online buy Cytotec online no rx Cytotec online where to buy synthroid in germany buy Nolvadex without rx from us pharmacy buy Nolvadex without a prescription overnight delivery Valtrex without doctor prescription order zithromax 250mg mastercard buy mail order Orlistat buy Valtrex online now Orlistat tablets Strattera best buy free fedex delivery Buspar buy cheap Finpecia under without rx purchase online finpecia without rx finpecia fedex no prescription buy line finpecia want to buy Maxalt in malaysia generic Crestor uk Buspar u.p.s shipping cod free fedex delivery prednisone prednisone no script fedex buy valtrex cheap without prescription purchase Zithromax without purchase Zithromax no scams Arimidex delivered overnight order cheap overnight Arimidex want to buy Flomax in malaysia buy cheap Flomax without prescription purchase Cytotec over the counter fedex buy cheap Cytotec online free consult buy Cytotec online overnight adobe financial results microsoft office professional 2007 upgrade cheap Buspar by money order cheap valtrex uk purchase Proscar usa cod adobe lm service adobe after effects simple creativity buy Crestor amex Photoshop For Sale buy discount Tamsulosin line Autocad 2010 Review where can i buy herbal Crestor where to buy Crestor buy Crestor online cod Buy Fincar online 5 mg mastercard purchase Orlistat amex online without prescription flash catalyst sql ms office 2010 enterprise windows 7 upgrade oem Windows Server 2003 Standard Edition Downloads For Windows 7 Ultimate Buy cheap Valtrex without a perscription buy Crestor drugs Valtrex no prescription purchase Valtrex amex online without prescription Xenical Orlistat Flomax buy on line boilsoft viseo create new instrument logic studio 9 cheap purchase finpecia buy Strattera no prescription low cost Flomax best buy formica countertop buy Prednisone no prescriptions cheap indesign cs android acdsee buy Flomax australia generic Valtrex online download de driver para corel windvd buy microsoft office online cheap generic Valtrex online buy Flomax online no prescription buy pharmacy Flomax waterview price of valtrex buy valtrex doctor prescription buy generic Crestor purchasing prednisone without a script order generic Tamsulosin buy Buspar without a rx cheap digital video want to buy Buspar in malaysia buy Crestor now buy Valtrex without a rx purchase rx Valacyclovir without Bupropion buy Bupropion buy no perscription Amitriptyline buy discount Zithromax cheapest Zithromax available online how to order Buspar online without a rx purchase prednisone cod next day delivery where can i purchase prednisone online prednisone online cash on delivery microsoft office 2010 3 user license cheap mac desktops no prescription Orlistat cod delivery buy Valtrex where order Orlistat no rx Microsoft Windows Xp Purchase buy Valtrex legally buy cheap Proscar without prescription buy cheap online pharmacy Buspar generic Zithromax usa accutane 40 mg delivered overnight buy accutane 40 mg with no prescription media 8 oline cheap cs software buy Flomax online us pharmacy cheapest Buspar available online where can i purchase Buspar without a prescription sony oem software Valtrex from india Maxalt pharmacy Prednisone prescription order buy Crestor overnight Buspar shipped by cash on delivery purchase Proscar online with overnight delivery prezzo Valtrex buy Valtrex shipped cod Proscar no prescription overnight Proscar overnight no consult where to purchase cheap Cytotec no rx Cytotec to buy canadian prescriptions prednisone where to buy Prednisone online Prednisone buy Prednisone Proscar online no rx overnight where can i buy Valtrex online without a prescription buy valtrex legally order Valtrex without a rx overnight shipping c.o.d prednisone purchase Prednisone money purchase where to buy generic Crestor online without a rx buy Cytotec cheapest Cytotec without rx medications buy Zithromax on line buy rx Maxalt without how to buy prednisone online without rx Buy Finpecia 1 mg online finpecia overdose excel new window windows for loop microsoft office 2008 for mac home student cheap collection software virtual dj software web design software mac cheap or discount photoshop software load windows xp buy Orlistat legally Rosuvastatin generic order buspar pharmacy dreamweaver cs4 windows mobile opera Maxalt online adobe photoshop price epson creativity suite
Go to Top


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser