Paloş::Code.Blog()

Thoughts about high architecture and sheer speed.

Archive for the ‘C/C++’


Detect CPU count from Shell

Recently I upgraded my CPU to a Dual Core 2 Duo and am now running the x86_64 version of Arch Linux in which the makepkg tool can take advantage of the multiple core CPU and run make using multiple threads (great stuff). This is accomplished through the -jX option of the make utility (where X is the CPU count: 2 in my case). One can see the tremendous benefits of this when, for example, compiling the kernel (for me the compilation time dropped by almost 45%; I checked!). (more…)

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Walter Bright @ NWCPP

Advanced D Programming Language Features

Here’s quite a lenghty video showing the creator of the D programming language, Walter Bright, talking about some of the cool things that D offers.

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

D environment installer (reloaded)

I decided (after writing the last post on this subject) that it is much more feasible to simply continue working on my install scripts rather than on the tutorial itself. With your help (I hope) I will be able to improve them and make run correctly on systems other than Ubuntu 7.04 (Feisty). So here they are:

D based on DMD under Linux Ubuntu 7.04 (Feisty)
Download script

D based on GDC under Linux Ubuntu 7.04 (Feisty)
Download script

Make sure you have the following requirements installed before running any of the scripts (other packages may be required):

  • curl
  • wget
  • svn
  • for the GDC script: gcc build tools (build-essential under Ubuntu)

Enjoy!

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Setting up a proper D working environment

We all know that D is not yet a very mature platform (although it is making steps quickly into the right direction). Because of that, it is not that easy to setup a working (or development) environment. Here are my efforts to clarify the situation. The difficulty in reaching this goal lies mainly in the incompatibilities between libraries and compiler versions (or implemented features).

I will try to show how I managed to install a (more or less) complete working environment for D under Linux using either DMD or GDC. These two compilers each have their pros and cons: DMD is more stable and has the latest features integrated, while GDC is completely open source. By “complete” I mean the following packages were installed and running smoothly (I won’t loose time to justify why I wanted each one - they simply make sense to have, pretty much all the time - in no particular order):

1. DSSS 0.71 (D Shared Software System) - link.
2. DMD 1.018 - link / GDC 0.24 / rev.146 (GCC 4.1.2) - link.
3. Tango rev.2500 (The modern standard library for D) - link.
4. Tangobos rev.15 (Phobos and Tango compatibility layer) - link.
5. Mango rev.1037 (Network programming library) - link.
6. DDL rev.285 (Dynamic run-time linking of executables) - link.
7. DDBI rev.59 (D DataBase Interface) - link.

(more…)

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!

Infinite “make” loop when modification time is in the future

The Problem:

I’m sure that this problem is pretty common, since it already happened to me a few times:

When I tried to compile some source package under Linux (like the GDC compiler for the D language), the whole make process started to go into an infinite loop at a certain point. It ran ./configure for a subdirectory and then the make tool said something like:

make[1]: Warning: File `...' has modification time
         9.4e+02 s in the future

and then started with the ./configure right back again. I didn’t understand, I had done this a few hours earlier on an identical operating system (Ubuntu 7 Feisty) at work, now I go home and it doesn’t work! (more…)

Add to Technorati FavoritesEnjoyed this post?, why not subscribe to the RSS feed!