chemistry, crystallography, platon, programs, Uncategorized

Platon on macOS Sierra

A while ago, I wrote a post on installing Platon on a Mac. I have just reinstalled Platon on my MacBook Pro, running macOS Sierra, and it works just fine. Check out my earlier post for a more in-depth run down of how to install Platon, but, in brief, the process is this:

  1. Download a copy of XQuartz. (I did this using Homebrew, using ‘brew install Caskroom/cask/xquartz’).
  2. Install gfortran, which is included in gcc. (Again, using Homebrew this is ‘brew install gcc’).
  3. Download the platon.f.gz and xvrdr.c.gz files and (g)unzip them if Safari hasn’t already done so.
  4. In the terminal, go to the folder containing the two previously mentioned files (probably ~/Downloads).
  5. Then, type ‘gfortran -o platon platon.f xdrvr.c -I/opt/X11/include -L/opt/X11/lib -lX11’. Hopefully, this should do its thing and produce an executable file named ‘Platon’.
  6. Move the file somewhere useful, such as /opt.
  7. To make Platon run from anywhere, you have two options: add the folder you have just placed the Platon executable in to the path or make an alias to the executable. To do the first, open up your shell profile or create (i.e., vi .bash_profile or you can open a copy in Textedit, making sure that its in plain text mode, the filename is preceded by a point (.), and the file is saved to your home (i.e., /Users/[your_username])) a profile file (I am using bash) and add ‘PATH=’$PATH:/opt’. To do the second, open up your shell profile and write alias platon=”~/Users/[your_username]/[location_of_platon]”.
  8. Then, quit and reopen terminal and type ‘Platon’ and the program should run.
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.