You are viewing owyn

Comfortably Numb [entries|archive|friends|userinfo]
Comfortably Numb

[ website | My Website ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Yet more mac package hijinx [May. 21st, 2010|06:46 pm]
This is the latest in a series of posts I seem to be making about fun issues with OSX and various programming languages. The nice thing about the mac is that it ships with just about every language you'd want to use, like python, ruby, perl, php and java... The down side of that is that if you run across a bug in the shipped version of one of these packages, you're going to wait a LONG time for an update from Apple. That's what happened here with PHP. The particular version of php that ships with OSX is pretty recent (5.3.1), but it has a bug that was triggered by the software I'm going to be working on (which was reported, and fixed). So I have to re-compile PHP, but I'd prefer to get it as close as possible to the system build, which I thought would just involve scrounging around in the PHP ./configure options, but opened up a bigger can of worms pretty quick.

It turns out there's a bug in the latest PHP 5.3.2 that prevents it from compiling on OSX. Oops.

The linker blows up with undefined symbols: "_iconv_close", "_iconv_open", "_iconv"

After digging through some bug threads, I found a possible resolution involving an apple supplied patch for the stock version of PHP (I didn't even know they had a repository of such patches until today).

So I applied the patch and ... no dice. After doing some MORE digging, it turns out that the system version of libiconv (an internationalization thing) was conflicting with the macports version of libiconv that I had installed. The macports version exports the symbols _libiconv_open _libiconv_close and _libiconv, and the linker will only include the first lib that it finds, and it was picking up the wrong one first. That might have solved it, but when I fiddled with the build script to just use the /opt/lib version, it just blew up looking for the OTHER symbol. Yay.

So as far as the build errors go, it seems like it's your basic "half the code wants lib A and half the code wants lib B" #ifdef problem that was only half way fixed by this patch.

This conflict was only happening when the GD library was included, because that's what was pulling in the macports /opt/local/lib path, but since mediawiki needs it, I wanted to work this out.

[edit] In trouble shooting this, at one point I renamed the macports libiconv to libeffyou and changed the makefile to link that as well. It turns out that after doing this rename trick, it's managed to find both libraries it needs and link them in correctly. I edited this paragraph since yesterday because I originally thought it was linking the renamed library in statically, which is why it was working. That was wrong, it links dynamically. So that rename trick could have been dangerous and left a ticking time bomb after renaming the library back, but I never got an error from an unresolved library but I didn't really think about WHY until this morning. I accidentally didn't rename the libiconv.2.dylib library, so it follows the renamed libeffyou.dylib softlink to the correct library, of course!

[owen@Silver php-5.3.2]$ otool -L /usr/bin/php | grep iconv
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0)

Amusingly enough, the resulting binary is also 1/3 the size of the system binary because for some reason the stock PHP binary is a 3 arch universal binary (weighing in at a towering 30MB), and it works!

For future reference (in case I have to do this again), here's the PHP configure I ended up using. The only difference from the stock PHP is that I disabled sqlite and odbc, because I've never ever used them. If this looks nasty, it is... PHP has a really convoluted configure system I've ever seen because it's a kitchen sink so it comes with WAY too many extensions by default.

./configure --with-curl --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-mbstring --with-openssl=/usr --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-snmp=/usr --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xmlrpc --with-xsl --with-zlib=/usr --with-zlib-dir=/usr --enable-zip --with-ldap --with-bz2 --with-gd --with-jpeg-dir=/opt/local --with-png-dir=/opt/local --enable-gd-native-ttf --without-sqlite3 --without-pdo-sqlite --with-iconv-dir=/usr --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --prefix=/usr

Rename /opt/local/lib/libiconv* to libeffyou* (but NOT libiconv.2.dylib) and edit Makefile and add -leffyou to EXTRA_LIBS

And don't forget to rename the /opt/local/lib/ stuff back after you're done...

And now you've got a new PHP binary the plays nicely with the stock locations for php.ini and extension_dir.
link2 comments|post comment

apartment pics [Dec. 12th, 2009|12:05 am]
[mood |tiredtired]

Some random pics of the new place for those who are interested... It looks empty until you put stuff in it...

Read more...Collapse )
link3 comments|post comment

Design Issues [Aug. 24th, 2009|06:43 pm]
[mood |crankycranky]

I'm not a designer, but I just wanted to point out this train wreck of a web site. Sometimes it's nice to take a break from self criticism and laugh at the failures of others. Let's take a look at this Microsoft Windows 7 marketing page here:

Windows 7 what's new page

There are 8 levels of nested menus going on here, and nothing lines up. It's probably a bunch of includes within includes within includes, because all the various groups involved in this disaster just shoved their content inside of somebody else's wrapper and doesn't worry much about the end result. Yeargh.

I've marked up the resulting awfulness, just for fun:

Compare it to the Snow Leopard page here.

The Apple page is just as busy (especially that "link farm" at the bottom of both pages), but it looks a lot better, because the design is integrated with the content. I don't know much about design, but I can look at these examples and be pretty sure that I can pick out which is better...
link1 comment|post comment

iPhone app store thoughts [Aug. 4th, 2009|04:13 pm]
[mood |workingworking]
[music |Agalloch - The Mantle]

Today I read an article about a couple of developers who are publishing thousands of apps, most of which are just bundled web articles and content (pictures of hot chicks downloaded from the internet for $5, etc). They're raking in the cash because of accidental (or maybe even on purpose) downloads, but the apps are crap. Apple just suspended one of these guys, who was only the THIRD most prolific developer. In 9 months, this company published over 900 apps. Over 5 new apps per DAY. That's just stupid. And he's not even the most prolific, and it's kind of unclear but it seems they shut him down over copyright concerns, not because of the quality of the apps.

So, I have a simple solution to this. There should be TWO app stores. There should be an A level store and the rest can fall into the anything goes store. Searches could be restricted to one or both via a simple toggle like the Google "Safe Search" flag. New apps would automatically start in the B level store and there could be an additional manual review process, which would take into account user feedback and popularity and quality and all that kind of stuff before an app got promoted. I think you could set the bar fairly low and still eliminate 90% of the "crap apps".

Hi Apple, I'm available for hire. I need a job. :)
linkpost comment

more mac package fail [Jul. 23rd, 2009|04:10 pm]
[mood |annoyedannoyed]

I posted a while ago about the messed up Python situation on the mac. There's a similar problem with Ruby. At some point between March and September 2008, a ruby update changed the local gem directory to a new location (gems are ruby plugins). If you look at the manual for how to upgrade ruby it says run "ruby update --system". But after that completes, it's now impossible to uninstall any old gem, and if you proceed with the recommended "ruby update" to update plugins, all the plugins are now duplicated in both places (unless the version numbers didn't increment, in which case the old one is still active), and you also get really bad errors from doing a 'gem cleanup', which is supposed to remove old versions of plugins after an update.

You get awesome side effects like 'gem uninstall' will just remove the most recent one, but leave the old one because it can't find it. If you specify the version, it will just fail with an exception.

Silver:~ owen$ gem list net-ssh
net-ssh (2.0.11, 1.1.2)

Silver:~ owen$ gem uninstall net-ssh

You have requested to uninstall the gem:

No, no I didn't request to uninstall that one...
Silver:~ owen$ gem uninstall net-ssh -v 1.1.2
ERROR:  While executing gem ... (Gem::InstallError)

Awesome! It's relatively easy to fix by just blowing away the gem directories and starting all over. But once again, the built in development packages on the Mac just utterly fail to correctly upgrade/update correctly.

Even more fun is that in some cases it seems doing a gem update or uninstall will update or remove the gem "spec" file but leaves all the old directories (like source and documentation) in the Gems folder.
Silver:doc owen$ gem list facets
facets (2.6.0)
Silver:doc owen$ ls -l | grep facets
drwxr-xr-x  4 root  admin  136 Apr 20 22:54 facets-2.5.2
drwxr-xr-x  4 root  admin  136 Jul 23 13:46 facets-2.6.0

It looks like I have to update rubygems, do an upgrade, manually check on and re-install all the old plugins that didn't change versions, and then I can safely remove the old plugins manually. Srsly.

I think they changed the gem install location to avoid conflicts with the built in system framework from apple, but if it doesn't handle upgrades properly, what's the point?
linkpost comment

metal + jazz = funny [Jul. 17th, 2009|06:06 pm]
[mood |amusedamused]

The last Lamb of God record had a bonus CD of audio stems for the entire album. There were separate tracks of vocals, drums, guitars (unfortunately both guitars were blended together) and bass. The mastering job on the record is so over the top that I actually mixed them together myself without any additional processing and I think it sounds better like that. But I lack imagination. It's nice to see these being put to better use though. Case in point: this remix of the Set To Fail video with an alternate audio track. Set to Funky Jazz, I say.

Read more...Collapse )
link4 comments|post comment

safari 4 [Jun. 18th, 2009|11:57 pm]
[mood |annoyedannoyed]

The verdict... it kinda sucks. It seems zippy enough, but it's been crashy. I just updated to the 4.01 version and it hasn't crashed yet. We'll see if it's more stable in the long run. I get a recurring bug where the scroll bar doesn't appear on large pages. That's pretty annoying. Moving the reload/stop loading button annoys me. The top sites thing is stupid. The graphical / coverflow bookmarks view is stupid. You can minimize it but you can't remove it. Yay UI fail. Also, in order to show you these thumbnails it caches TWO images of every site that you visit (a jpeg and a png, awesome). After 2 weeks, I have 500mb of these things. That's pretty awesome. By default it deletes these according to the rules in the General->Delete history items after X setting. You can erase them via the Safari->Reset Safari menu. You can also prevent it from creating them in the first place by doing this in terminal and then restarting:

defaults write DebugSnapshotsUpdatePolicy -int 2

And to restore the behavior:

defaults delete DebugSnapshotsUpdatePolicy
link2 comments|post comment

Faith No More! [Jun. 14th, 2009|01:30 pm]
[mood |nostalgicnostalgic]

Someone posted every song from the Faith No More reunion concert this weekend. You had to watch the playlist in reverse order instead of doing a "play all" (start at song 21 and go backwards), and some of the video is out of sync, but I think they crushed. I created a new playlist that just links those original vids in correct order and you can find it here:
linkpost comment

everyone loves a trilogy [Jun. 12th, 2009|10:32 am]
[mood |mischievousmischievous]

This cartoon, which has been around forever, succinctly represents my feelings on this whole Kurzweil crusade. I'm usually the guy pointing out the work that needs to be done and how difficult it actually is. Maybe that's partly because I'm not very motivated, and getting anything done at all is kind of a miracle. But in the area of AI, people seem to have no idea what the practical difficulties are. It's not just a matter of faster hardware.

I believe his first mistake is in claiming that Moore's law applies to all information technology, and not just circuit design, which I already mentioned. I'd be willing to argue that point further, but that's not the only mistake he makes.

If you watched his little talk, there was a point where he claims that after integrated circuits peter out "around 2020", the next paradigm of development is going to be "three dimensional self organizing molecular circuits". And then he carries on talking about the singularity as if this was already done. Hey wait there a second and back up and explain to me that middle part again? I can find scientific papers on google from 1989 on this topic. I think that part is a LOT harder than you might think. Here's a cool project from 1998: Hardware evolution with a massively parallel dynamicaly reconfigurable computer: POLYP. I think that's interesting work, and those guys are still plugging away in various research labs. I would argue that when you really look at it... if you ACTUALLY did a careful survey of the scientific work in this area, most of the advancement there is a lot more linear and less exponential, and they won't be that much further along given 20 more years. The playstation 3 folding@home screen saver has done more scientific number crunching than most super computer projects. It's not the same thing.
linkpost comment

more kurzweil garbage [Jun. 10th, 2009|04:00 pm]
[mood |amusedamused]

Okay, check this out.

Fun facts from the article...

He makes 2m / year speaking. He's written 4 best sellers (the next one is called Transcend: 9 steps to living well forever). He believes 2045 is "the year it's gonna happen". The singularity.

That's when Moore's law finally goes through its last couple of doublings and computers get so super-fast that we'll be able to simulate a human brain, that will somehow qualify as artificial intelligence (or not, I'm not sure if that part is essential or just a byproduct) and then we can use that computational power to design nanotechnological robots that will go into your bloodstream and keep you alive forever. And we all live happily ever after forever. I'm serious, that's really what he's talking about. I'm not the only person that thinks he's completely deluded, the article includes lots of quotes about how he's obsessed by this.

Now he's launched a "University" with the help of Larry Page from Google and a bunch of other high profile techy types to bloviate about all this. It's gonna cost $25 grand for a 9 week "program". Maybe you'll get a nice little certificate at the end or something?

I wonder if I could make a career just tearing apart his arguments? Maybe I will make up some signs and go down to the opening day of this "University" and protest. Unless I have a job by then.

Anyway, I believe his fundamental error is in applying Moore's law of exponential doubling in circuit complexity over time to ALL technology. He just assumes that this is true at the beginning of his talk (that I linked to last time) and THEN all the other stuff follows. There's a lot of hand waving just in that initial premise. He also relies on the convenience of "paradigm shifts" that will occur whenever this exponential growth slows down.

So basically his argument reduces to:

1) Moore's Law
2) ???? (paradigm shifts->AI->nanotechnology)
3) Immortality

You can draw a nice exponential graph on a power point slide but that doesn't mean shit. Maybe my giant sign will just have a ???? and some underpants on it. Hmmm.
link12 comments|post comment

[ viewing | most recent entries ]
[ go | earlier ]