Skip to content

Instantly share code, notes, and snippets.

@sjml
Last active May 27, 2020 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjml/e64b836fbc87730cc2ffa01a192160c5 to your computer and use it in GitHub Desktop.
Save sjml/e64b836fbc87730cc2ffa01a192160c5 to your computer and use it in GitHub Desktop.
Install Platon

UNMAINTAINED

This script probably still works, but might not. Check the version in my GitHub repository.

Installing Platon

This is a script that can be used to easily install platon on macOS. If it doesn't work for you for some reason, leave a comment explaning what went wrong.

You can run this automatically by opening the Terminal app (in /Applications/Utilities) and pasting the following line:

/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/sjml/e64b836fbc87730cc2ffa01a192160c5/raw/install-platon.sh)"

Note that it will ask for your password, so stick around. It may look like it's frozen at a few points, but that's just because installing Xquartz and compiling stuff takes a bit of time. After it's done, open up an Xquartz terminal and run this command to test it:

platon ~/Desktop/platon/sucrose.spf

Once you've confirmed that works, you can delete the "platon" folder on your desktop, unless you think you might want the sample sucrose.spf file.

Olex²

If you need platon to work with Olex², select the Home panel and then click on Settings. In that list, there should be an entry for Path. Enter /usr/local/bin/, click out of the settings box, and restart Olex².

Updating Platon

To update to the latest version, run the following line in the terminal:

/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/sjml/e64b836fbc87730cc2ffa01a192160c5/raw/update-platon.sh)"
#!/bin/bash
# This is a script that can be used to easily install platon on macOS. If it doesn't work for
# you for some reason, leave a comment explaning what went wrong.
#
# You can run this automatically by opening the terminal and pasting the following line:
# /bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/sjml/e64b836fbc87730cc2ffa01a192160c5/raw/install-platon.sh)"
#
# If you don't want to pipe the internet right into your terminal, you can download this file,
# then in your terminal run "chmod +x <path to this file>" and thereafter just run it.
#
# Note that it will ask for your password, so stick around. It may look like it's frozen at a
# few points, but that's just because installing Xquartz and compiling stuff takes a bit of
# time. After it's done, open up an Xquartz terminal and run this command to test it:
#
# platon ~/Desktop/platon/sucrose.spf
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew cask install xquartz
brew install gcc
mkdir -p $HOME/Desktop/platon
cd $HOME/Desktop/platon
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/platon.f.gz
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/xdrvr.c.gz
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/check.def
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/sucrose.spf
gunzip platon.f.gz
gunzip xdrvr.c.gz
gfortran -o platon platon.f xdrvr.c -I/opt/X11/include -L/opt/X11/lib -lX11
cp ./platon /usr/local/bin
mkdir -p $HOME/platon
cp ./check.def $HOME/platon/check.def
export CHECKDEF=$HOME/platon/check.def
echo "export CHECKDEF=$HOME/platon/check.def" >> $HOME/.bashrc
echo "export CHECKDEF=$HOME/platon/check.def" >> $HOME/.zshrc
#!/bin/bash
# If you've already run the installation script, this will update your platon to the latest
# version from the website.
#
# You can run this automatically by opening the terminal and pasting the following line:
# /bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/sjml/e64b836fbc87730cc2ffa01a192160c5/raw/update-platon.sh)"
cd $HOME/platon
mkdir -p tmp
cd tmp
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/platon.f.gz
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/xdrvr.c.gz
curl --remote-name https://www.platonsoft.nl/xraysoft/unix/platon/check.def
gunzip platon.f.gz
gunzip xdrvr.c.gz
gfortran -o platon platon.f xdrvr.c -I/opt/X11/include -L/opt/X11/lib -lX11
cp ./platon /usr/local/bin
cp ./check.def $HOME/platon/check.def
cd ..
rm -rf ./tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment