chemistry, crystallography, platon, programs

Platon on Mac OS X Yosemite (10.10)

UPDATE (16 March, 2017): This also works on macOS Sierra (10.12.3).
UPDATE: This also works on Mac OS X El Capitan (10.11.5).

One of the most popular pages here (well, there is little else) is the page about Platon for Mac OS X.

I mainly use a computer running Ubuntu for crystallography at work so I haven’t had to compile Platon, the essential crystallographic program, for my Mac. I have seen that some people have had problems compiling the program (remember you do need Xquartz, and a compiler for Fortran and C). I compiled platon, but I also had some difficulty doing so, although I have compiled previous versions without a problem. So, if you have a problem compiling using the standard instructions on the platon website, try this, and you should be able to compile it, without sudo, using:

gfortran -o platon platon.f xdrvr.c -I/opt/X11/include -L/opt/X11/lib -lX11

If you don’t use -I/opt/X11/include then it won’t find the X11 libraries that are above /opt/X11/lib.

Afterwards, copy it into somewhere like sudo cp platon /opt/platon2015 (check that it has run privileges (i.e., ls -g) and, if not, run chmod u+x platon). You can then add the folder that contains the executable to your path and add an alias if in you profile script (.bashrc/.bash_profile etc.) e.g., alias platon="/opt/platon2015/platon“.

You can then run it with, for example, on a shelx res file:

platon file.res

References: A.L.Spek, Acta Cryst. 2009, D65, 148-155.