IT Adventures
Sun Studio 12 Update 1 Compiler and IDE
by admin on Aug.11, 2009, under IT Adventures, Linux, Sago Labs
Cool News: This post was a blogging contest winner!
Thank you Sun!
Update: What a pleasant surprise to find that my entry for the Sun Studio blogging contest was selected as one of the winners, and announced on the Sun Studio Developers Site. As promised, Sun sent along $500, marking the first money I’ve made with this blog, and while my purpose in blogging is not focused on making money, it nonetheless was a nice side effect. I certainly enjoyed writing about my initial experience with using Sun Studio 12, and to have been selected as one of the contest winners was certainly a bonus. Thank you Sun Microsystems for holding the contest, and of course for making Sun Studio available to the community.
Every now and again I get emails from Sun Microsystems for guides or other promotions for this or that product: ZFS, Solaris containers, DTrace, etc. Some of them are actually quite interesting and it is a list I like being on.
The other day I received an announcement for the release of Sun Studio 12 Update 1. Well, this was perfect as I have been wanting to test drive Sun Studio for a while, and have been meaning to get to it – but it gets even better: they are having a blogging contest and will actually be paying 10 lucky winners who blog about their experience with it!
Well, let’s see: try out and write about a product which I had intended to do anyway, and perhaps win some cash too – how can one possibly go wrong?
Why Try It?
I’m neither a developer nor programmer. If that fits you as well, you might be thinking “So why bother?” Well, like a lot of folks out there who are Linux guys, sysadmin types, etc. I think it is always good to be familiar with available tools. The IDE I’ve used most is vim, and I’ve rarely even used Eclipse. But I, being an adventure loving soul, of course love checking out new things and was particularly interested in the Sun compiler as I wanted to compare its optimizations and the performance of binaries it compiles against the Intel (icc) and GNU (gcc) compilers. I previously wrote on comparing Intel Linux C complier and gcc binaries using the Crafty chess engine and was quite surprised at the benchmark differences, and have since then wanted to see how a Sun compiled binary would compare. So what a perfect opportunity to try it and find out.
Isn’t that a bit nebulous? One could even dare say Geeky?
While benching chess engine binaries might seem somewhat esoteric, it really gives a good idea of the possibilities. Translate this over to compiling your MySQL server or other performance critical app and it starts to get more interesting. In fact you can get MySQL binaries compiled with the Intel compiler for just this reason directly on the MySQL download page. One can’t help but wonder one MySQL binaries compiled with the Sun compiler might perform.
Install Experience
I tested out Sun Studio 12 on both Solaris 10 (2009.06 Nevada) and Linux (Suse 11.1) platforms. In both cases the install was seamless. On Solaris 10 it was simply a matter of using the new IPS packaging system and by running
$ pfexec pkg install sunstudio12u1
it was up and running in minutes.
On the Linux side I downloaded the SunStudio12u1-Linux-x86-rpms.tar.gz package and simply run the install wrapper script, which by default places everything in /opt/sun and the full path to the binary is then /opt/sun/sunstudio12.1/bin/sunstudio (you will need to add that to you PATH environmental.)
The GUI installer which ran in Linux went smoothly and gave basic options for which components to select, etc. You can also install install in non-interactively. The displayed warning was simply saying there was no guarantee it would work on this system (Suse 11.1) – but there were in fact no issues.
The full install (C and Fortran compilers, performance libs and IDE) comes to about 755MB on Linux and about 830Mb on Solaris – a bit larger than I expected.
Sun Studio IDE
Launching Sun Studio presents a clean and easy to navigate environment. Though never having used it before, it was pretty obvious where to find things. Several sample projects are available so you can test drive it right away, and there are links to guides presented on the main page. (There is also a comprehensive quick start guide here.)
I did have to play about a bit with adding existing directories of source code into a new project. It is easy enough once you do it. Once you import your source, you can click the build button and you are more or less off.
Of course, you will need to define the full path to the compiler you want to use in the CC= variable in the make file, or have this environmental defined and exported already. If you want to compile with gcc instead, it is no problem – just set cc=gcc In the Crafty make file you can simply set the $(MAKE) linux or $(MAKE) linux-icc to use gcc or icc compilers. I had no difficulty compiling Crafty with gcc this way.
Using the Sun Compiler
As I am utterly unfamiliar with CFlags for the Sun compiler I found it nice that just running the compiler with no arguments immediately tells you how to discover them easily enough with /opt/sun/sunstudio12.1/bin/suncc -flags
I had to figure out the CFLAGS still though, and found this site to be helpful for that.
One I had the correct options set in the Crafty Makefile, the Sun compiler launched into action for me. I used a basic set of CFLAGS:
solaris:
$(MAKE) target=SUN \
CC=/opt/sun/sunstudio12.1/bin/cc CXX='$(CC)' \
CFLAGS='$(CFLAGS) -fast -xO5 -xunroll=20' \
CXFLAGS=$(CFLAGS) \
LDFLAGS='$(LDFLAGS) -lpthread' \
opt='$(opt)' \
crafty-make
Compile Benchmark Results
So how did it go? How did the Sun compiler perform? Well come back in a day or so and see the benchmarks. Meanwhile, you might enjoy reading about how the previous comparison between Intel icc and gcc tests went, which you can find here.
Lint Mint 6 XFCE on OLPC
by admin on Jul.14, 2009, under IT Adventures, Linux, Netbooks
A while back when Linux Mint 6 XFCE (based on Ubunut Intrepid) was released and reviewed on The Linux Action Show I thought of what a good platform it could be for the OLPC. (The Linux Action show is a great pod cast by the way!) I had previously installed Ubuntu Hardy on the OLPC, but the extras the Linux Mint guys added to XFCE sounded pretty cool. Especially considering I am thinking of giving the OLPC away to someone who is a newer Linux user, having Mint as the OS was pretty appealing. And oh, my old Hardy install was utterly nuked on the SD card anyway – who knows. I might have tried to recover the partition tables with TestDisk, etc. but really – who cares. Time for a new OLPC adventure anyway!
In fact I had hardly touched my OLPC in nearly a year, since buying my Acer Aspire One – which I really love. And although the Aspire One is obviously far better performance wise, there are certain characteristics of the OLPC that I really like, such as:
Monochrome Screen Mode: This is absolutely awesome. The screen back light turns completely off saving big time power. Sunlight goes through the LCD and is reflected off a panel, making the screen extremely readable in direct sunlight. It is really fantastic and I wish ALL netbooks had this feature. It is hard to describe how legible it is, even in harsh direct light.
Battery Life: Especially when running in monochrome mode, battery life is quite good.
Mesh Networking: Interesting stuff – and oh, the wireless net supports injection. Hacking opportunities for kids the world round.
Case Design: Everything folds up to protect ports. Integrated carrying handle.
Open Firmware: Yea, it’s kind of different and fun to play with. Similar to the Open Firmware in the pre-Intel Macs, but far more fun than that was. Since we will be seeing a lot more systems using Open Firmware in the future it is good to play with it now. By by BIOS – you served us well.
Philosophy: Providing technology that would otherwise be unavailable to kids in remote places does not at all seem like a bad idea to me.
HAM Radio: I am thinking the OLPC, with the above features, seems a perfect candidate to use with packet radio. Communicate with friends after the coming apocalypse. Run it for years, and never worry about the back light burning out – you don’t need it.
(As a note: It was great seeing a few people recently at Toorcamp with their OLPCs – I saw two or three there, as well as two OLPC billboards on the trip to Seattle.)
Okay – enough extolling the OLPC virtues. How to install Linux Mint on it.
How to Install Linux Mint 6 XFCE on the OLPC
0) Pre-install Steps
0) First off, you do not need to go through exotic hoops to get this to work. Some guys have had success installing Mint onto an SD card first and then installing Hardy over the top of it and ended up with a working Mint install. Using the following method you can simply install Mint and it should work fine. (If you do want to install a vanilla Hardy, I would highly recommend using this method using compressed files instead.)
00) I suggest you update the OLPC firmware and Fedora base OS before installing Mint. Simply connecting to a wireless network and running #olpc-update as root will download all updates and update the firmware as well. (Have it pluged into AC or the firmware upgrade will be skipped.) BE PATIENT – the upgrade rsyncs several hundred megs over your wireless connection. It takes a very long time.
Toorcamp: Taking the Hack Underground
by admin on Jul.04, 2009, under IT Adventures, Linux, My Life
(You can find the first post here with a bit more info.)
After the Toorcamp officials negotiated it out, the owner (collectively known as Mr. Ass-Wee-Pay) finally allowed access to the missile silo today. This made a huge difference in the whole experience at Toorcamp. Otherwise, as my brother so perfectly put it, the event was a bit like:
“Come to a hacker fest at an abandoned nuclear silo!*”
(*Silo not included)
Fortunately all this changed today, and the site was fully opened to workshops, talks and tours. Way to go Toorcamp guys!
It was utterly awesome. While camping on the surface was pretty un-enjoyable with the extreme dust and heat, the silo was completely different. The temperature was easily 25-30 degrees F less in the silo. In fact you could only stay about 2 hours before you would become uncomfortably cold and want to return to the surface. Good thing I thought ahead enough to bring a fleece pull over to the desert!
I took many, many pictures of the silo and will cull a few of the best for this blog post, and others can be found on my gallery.
The Titan Missile Silo:
The entrance was a steel and concrete hatch easily a foot think. It was propped up (literally) on supports, themselves not bolted down. The ingress / egress safety briefing included strict instructions not to touch the hatch in any way. Think of a rabbit trap made out of a box and you get the idea.
You then proceeded down a very narrow passage and flight of stairs, forcing a single person to enter. This was engineered to allow a guard to be able to hold back any number of people attempting to infiltrate the entrance. A 10 year old with a slingshot could defend this entrance.
After this, at about 20 feet down you entered the main lift tower. The elevator of course was long since removed, so you descended the five flights of stairs – sturdy and steel plated until you arrived at the bottom of the lift and the main entrance. Here tunnels ran off in four directions. Two lead immediately into the control and power domes.
The power dome (above) was massive, originally housing the generators. A section of the ceiling of this dome had been opened (after being excavated) to allow access to the facility and removal of the generators and other equipment. All other parts of the facility are still completely buried. The moss growing is due to the ceiling being open to the sky.
(Just click below to read more.)
Live From Toorcamp
by admin on Jul.03, 2009, under IT Adventures, Linux, My Life, Netbooks, Sago Labs
[Want to see the pictures? They are here!]
Kyle and I arrived to Seattle late Wednesday and my brother Robert picked us up. After staying the night at his place we got up Thursday morning and road tripped across the cascades toward Moses Lake. The trip through the mountains was very nice, with beautiful scenery. I’ve not been in the cascades in over 20 years, and it was a plesent change of scenery from my current Tampa bay scenery.
We navigated easily to the site, about :35 outside of town. The environment is farmland, with crops (hey and alfalfa it seems) stretching into the horizons. It is semi-arid and pretty hot, in the low 90′s, and extremely dusty.
First thing on arrival: Assemble and solder your camp pass – a few resisters and two LEDs on a PCB with an inducer – then test by swipping in front of a credit card reader. Blink blink, you are a go.
Presentations yesterday and the Ignite! Toorcamp talks last night were very good – ranging from OSX & Linux stack protection and memory randomization in compiled apps, a Spacepunk talk showing low earth photos taken with a home constructed satellite made with a Sony cybershot camera and deployed via balloon by Hackerbot Labs – they are on site and I’ll be seeing them for more info on this! Also a very interesting talk by Psychesonics on binomial sound waves to sync brain wave activity – hack your mind.
We went to town this morning for supplies, returning for the first talks. I’m sitting in an iptables firewall class now, to be followed by muti-channel bluetooth hacking and then SQL injection.
Bad news: Apparently camp coordinators did not have a contract with explicit access rights to the Missile Silo itself, leaving all authority up to the discretion of the owner. This is bad. As a result, before the conference even started some guys went into the silo unauthorised, the owner paniced and decided to revoke ALL access to the Silo yesterday – so all the talks yesterday that were to be given underground were given on the surface instead. Now, the owner has so graciously allowed one group of people so far to tour the underground silo. It is unknown yet if there will be more tours offered.
Moral of the story: When hosting an event at speciality locations, get a contract to ensure your access rights, etc. Otherwise – just use the national forest which costs nothing and has full public access rights. And it’s a hell of a lot more comfortable environmentally in the mountians!
But the conference itself, the data and the attendees are all very interesting and entertaining and there is a lot more goodness yet to come.
Will update more later.
Attending Toorcamp – Hacking Fest in Abandoned Titan-1 Silo
by admin on Jun.21, 2009, under IT Adventures, Linux, My Life
I am just over a week away from attending Toor Camp ! W 0 0 T ! ! !
Mission Info
What: ToorCamp 2009
When: July 2nd-5th, 2009
Why: Titan-1 Missile Silo
Where: Moses Lake, WA
I’ll be attending the full camp along with my brother and friend Kyle. Kyle and I will fly to Seattle and from there travel with my Bro to the site were we will camp for four days of hacking goodness. This is the first such camp in the United States, and is an offshoot of the popular ToorCon. It is looking like it will be quite the event.
There are two days of talks, followed by two days of hands on workshops and labs intersperse with loads of general geekness and fun.
The line up is looking quite good. My brother is delivering a talk on Thursday entitled Geeks and Guns: The Poorman’s Improvised Guide to ammo reloading for the coming Apocalypse the outline of which is here.
The workshops are looking quite good as well and I am interested in attending:
Sat.
Intro to C++
Crypto Bootcamp
Software Radio (Day1)
Intro to Electroluminescent Wire
Sun.
The Art of Pivot and Persistence {System Infiltration}
The Middler Outdoor Experience {Using The Middler for MitM}
Blacksmithing
There will be some other interesting things at night as well – including and Ignite! Toorcamp presentation, an art display and of course – the 4th of July Nuclear Winter party . . oh yea. . .
Can’t wait! Check back as I will be posting daily from Toorcamp and doing regular twitter updates.











