Software Adventures:Building XCrySDen

There is nothing worse then obscure software with even more obscure dependencies. It just leads you down deep and dark holes, so its good to have a flashlight.

A user requested XCrySDen for their class, along with a few other visualization tools, but this one was the most difficult. It nicely has a prebuild binary, but its dynamically linked, thus it requires a few libraries to exist. I like stand alone statically linked binaries, just so much easier. Anyways this program depends on something called meschach(how do you pronouce that?).

Again a great example of when a scientist makes software vs when a software developer makes software. The package isn’t even tar’ed correctly, it extracts out into the current directory(Its convention for a tar file to extract into a new directory, keeping things clean). Then the configure script doesn’t work, can’t find gcc, and a header file is missing an include statement for stdio.h. Wow, a mess.

Luckily as with most things I wasn’t the only one who had to deal with this. Using this page as a starting point, I was able to get XCrySDen working.

The page details how to fix those problems, though use CC=”gcc -fPIC”, the rest of that line isnt needed as it doesn’t work. Run configure, then edit the make file to have the following added/modified:

basic: part1 part2 libpart

libpart: $(LIST1) $(LIST2)
       gcc -shared -o *.o

Then run “make basic”

Considering I put most stuff in /opt, i created /opt/lib and put the new library there. Though XCrySDen still isn’t done. Install tcl-devel and tk-devel, but even that isn’t enough. Using ln, make links to and to and respectivily in /opt/lib. I then create a file,, in /etc/profile.d and include the following:


Then XCrySDen should work.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s