1. 14:17 28th Oct 2011

    notes: 8

    tags: tip

    Fixing Erlang checksum problem

    There is an installation problem on Erlang (R14B04) with Macport. When it tests its checksum, it produces ‘checksum error’ for opt_doc_html_R14B04.tar.gz. I googled on this and found some others reports. Weirdly, the file’s checksum was not updated in the Portfile of the package.

    It can be resolved with updating the checksum of the following into the Portfile:

    bash-3.2# openssl rmd160 < ./otp_doc_html_R14B04.tar.gz
    (stdin)= 0e44a933ae35fe95d1ecd9958c9e86ce398e259f
    bash-3.2# openssl sha1 < ./otp_doc_html_R14B04.tar.gz
    (stdin)= 86f76adee9bf953e5578d7998fda9e7dfc0d43f5

    And, then

    $ sudo port install elrang

    Plus: When a compilation fails, please add the following snippet into the ‘darwin 11’ section of the Profile.

    if {${configure.compiler} == “clang”}
    {   
       configure.compiler llvm-gcc-4.2 
    }
    configure.cflags-delete “-std=c99”

     


  2. 18:40 20th Oct 2011

    notes: 10

    tags: tip

    Speeding up Xcode using Ramdisk

    This is my 1 cent tip for speeding up building projects using Ramdisk.

    Steps

    1. Add more RAM modules to your MacBook (up to 8GB)
    2. Make a temporary ramdisk(1GB in size) using the following command:

    diskutil erasevolume HFS+ “ramdisk” `hdiutil attach -nomount ram://2097152`

    3. Now, the ramdisk is setup in /Volumes/ramdisk. Check it with ‘mount’ command.

    /dev/disk1 on /Volumes/ramdisk (hfs, local, nodev, nosuid, noowners, mounted by USER)

    4. Change the build path in Xcode: File -> Project Settings. Set ‘/Volumes/ramdisk’.

    5. All done.

    Benchmark Test: You can compare the speed of both ramdisk and HDD with a write test.

    dd if=/dev/zero of=/tmp/xxx bs=8k count=100000 (this took 1.8secs in Macbook 2.26GHz)

    dd if=/dev/zero of=/Volumes/ramdisk/xxx bs=8k count=100000 (this took 18secs in Macbook 2.26GHz)

    Notice: Unmount the ramdisk.

    hdiutil detach /dev/disk1