Stay up to dateembedded code automagically updates, each snippet and article has a feed Join Siafoo Now or Learn More

Random Developments Subscribe

Like you care.

Boost and Intel Compiler

over 8 years ago

I recently rediscovered the Intel C++ Compiler's free availability for non-commercial use and decided to try it on my own code and see what performance improvement I can achieve on my simulation code.

Installation was easy enough... unlike what the script tells you, you can disable SELinux enforcement by using:

setenforce 0

Anyway as soon I actually tried to compile my code I was faced with a ton of errors:

/usr/include/boost/type_traits/remove_reference.hpp(39): error: expected a ">"
 struct remove_rvalue_ref<T&&>
/usr/include/boost/type_traits/is_rvalue_reference.hpp(21): error: expected a ">"
 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_rvalue_reference,T&&,true)

/usr/include/boost/type_traits/is_volatile.hpp(60): error: expected a ">"
  struct is_volatile_rval_filter<T&&>
/usr/include/boost/type_traits/remove_cv.hpp(44): error: expected a ">"
  struct rvalue_ref_filter_rem_cv<T&&>
/usr/include/boost/type_traits/is_const.hpp(69): error: expected a ">"
  struct is_const_rvalue_filter<T&&>
/usr/include/boost/type_traits/make_unsigned.hpp(38): error: expected a type specifier
/usr/include/boost/type_traits/make_unsigned.hpp(41): error: expected a type specifier

I tracked down the problem to the following type of statement:

template <class T>
struct remove_rvalue_ref<T&&>
  typedef T type;

And the solution was to add -std=c++0x to the Intel compiler flags.

Also another thing to note is that the to use OpenMP with the Intel Compiler you only need to specify the -openmp flag.

Only free, if your time is.

over 9 years ago

For the past week I have been completely unable to use eclipse due to a horrible horrible nasty nasty hard crash, when I tried to open a project. The crash looked like:

[stou@cipher tools]$ ./eclipse/eclipse
*** glibc detected *** /usr/bin/java: free(): invalid pointer: 0x000000000145cdb0 ***
======= Backtrace: =========
======= Memory map: ========
00400000-00408000 r-xp 00000000 08:03 13107694  /usr/lib/jvm/java-1.6.0-openjdk-
00608000-00609000 rw-p 00008000 08:03 13107694  /usr/lib/jvm/java-1.6.0-openjdk-
00f6d000-0645b000 rw-p 00000000 00:00 0         [heap]
d8000000-db7d0000 rw-p 00000000 00:00 0
db7d0000-e8000000 rw-p 00000000 00:00 0
e8000000-e9ab0000 rw-p 00000000 00:00 0
e9ab0000-f8000000 rw-p 00000000 00:00 0
f8000000-100000000 rw-p 00000000 00:00 0
32c9800000-32c9804000 r-xp 00000000 08:03 3145814                        /lib64/libuuid.so.1.3.0
<a few pages of similar crap>

best of all the Automatic Bug Reporting Tool that comes with Fedora , and I just got used to using, was totally useless in this instance.

I was too busy with grading and other school related activities to try to get to the bottom of this crash... until today. After a 5 minute internet search I found the cause and solution to this problem. It turns out that something in KDE sets MALLOC_CHECK_=3 which catches some bug in eclipse... which somehow crashes the whole JVM. Anyway doing an unset MALLOC_CHECK_ fixed the issue.

Someone, probably an Apple/Microsoft fan boy, said... "open source is only free if your time is"...

Crapps Be Gone

over 10 years ago

Every AT&T mobile phone (except the iPhone) comes with a ton of crappy AT&T branded applications (henceforth known as crapps or crapplets). These crapplets generally don't add any functionality to your phone since they either duplicate exiting [better] solutions (e.g. AT&T Maps ) or are generally useless (Mobile TV). My new Android powered Samsung Captivate came with a bunch of them too:


Since I have always hated the fact that I could not remove these apps from my phone I decided to root it and remove them. This is what you can do to free yourself:


There's probably an easier / better way to do this...


If you brick your phone (which is unlikely)... it's not my fault.

  1. Root your phone. It took me less than 5 minutes to root my (AT&T's Galaxy S variant) using instructions found on the internets.
  2. Launch the super user application (Ninja icon)

There are two ways to continue: With the Android SDK and without.

If you have the Android SDK:

  1. Connect your phone to your computer and open a shell into the phone using the adb shell command.

  2. (optional) Make a backup of the files using the File Explorer feature of the Dalvik Debug Monitor (ddms:

  3. Type su in the shell and you should see the Superuser Request box on your phone.

  4. cd /system/app and delete the application packages you don't want, such as AT&T Maps, AT&T Navigator, YP Mobile, What, IM service, and MobiTV using the usual shell command rm.

If you don't have the SDK:

  1. Get Connectbot the Android SSH client

  2. Connect to a local root session:



Connectbot and Swype have some issues together (i.e. backspace doesn't work) so you should switch your input to another keyboard until this is fixed.

  1. Type su in the shell and you should see the Superuser Request box:

  2. cd /system/app and delete the application packages you don't want, such as AT&T Maps, AT&T Navigator, YP Mobile, What, IM service, and MobiTV using the usual shell command rm.


Some crapps lead to web address but those still live in /system/app you just have to use something like AStro File Manager to figure out what is what:


On my Captivate AT&T Family Map was called androidlauncher2.1-61x612010_06_11t15_49.apk and AT&T Hotspots was called WISPr_v41.apk

Anyway eventually you end up with something like this:


OpenCL screen corruption

over 10 years ago

One of the things I've been working on lately involves smooth particle hydrodynamics (SPH) with OpenCL... anyway last night I tried to simulate 100k particles on my GeForce 9800 (and naive memory management)... it ran out of resources and crashed resulting in total and massive screen corruption:


Everything still worked and I could use the KDE 4.4 with compositing and everything but the whole screen was speckled. The problem only cleared up after I rebooted the machine (i.e. restarting X did nothing).

Python bindings for OpenCL

over 10 years ago

A Google query for "OpenCL python bindings" makes it seem that the only option for using OpenCL from Python is the Python-OpenCL library. However the better option, and the one listed on the Khronos OpenCL resource page, is PyOpenCL.

I tried Python-OpenCL but it didn't actually work and there is no documentation... even the auto-generated docs point to missing pages. PyOpenCL on the other hand seems fairly active, well documented, works, and uses Boost::Python. Anyway save yourself an hour and use PyOpenCL.