Ooh a sparking new OS. Here are the steps I used to setup on Big Sur, adapted from Aron's blog for Catalina.
In it's cleanest state my home looks something like this:
~/bin/
(symlinks to binary exectuables), ~/Dropbox/
(for documents I don't need version controlled), ~/Repos/
(my Git repos for research projects and websites), ~/Code
(Downloaded code and Git repos for code bases I'm working on), ~/Code/Scripts
(a Git repo with various scripts that don't count as code in their own right), ~/Zotero
(zotero data), ~/miniconda3
, ~/.ssh
(ssh config files and keys), ~/.zshrc
(zsh profile settings), ~/Data
(raw DFT data, scp'd from the rdf)
- Backup with TimeMachine
- Clean up Desktop and Downloads
- Transfer notes from the Firefox TabNotes extension to their long term home
- Move .ssh, .bash_profile, ~/Zotero, and any other settings or data files that are not backed up to a Dropbox folder
- Push all local Git Repos to their remote repositories
- Make sure Dropbox and Firefox are sync'd
- Turn off two-factor authentication (e.g. on Archer Safe)
Note:
- I don't need to worry about syncing pycharm project separately as each corresponds to GitHub repo.
- Shut down computer, do Command+R whilst plugged into internet.
- Go to disk utility and delete the drive.
- Install Big Sur
Open Terminal and type make
to install the command line tools module (basic UNIX commands and a gcc compiler).
The command lines tools are installed in a non-standard location so you need to i) add the C/Fortran library paths to the relevant environment variable in .zshrc
:
export LIBRARY_PATH=$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
and ii) link the C headers:
sudo mkdir /usr/local/include
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
I tried export CPATH==...
as an alternative to the above but this didn't work - more PATH
s are probably need to be set using this method.
Hold up! Whats this .zschsrzhcc
(or whatever it is) file about? There's a nice set of blogposts about it here - it's a startup script similar to .bashrc
. We're not forced to use zsh instead of bash on Big Sur or Catalina, but it looks like the wind might be blowing that way.
Install open source compilers: gcc and gfortran here (on the website it says that Xcode is also needed - but we don't need to do this as the same tools were installed in the previous step).
Check install with: gcc --version
, fortran --version
Install Intel MKL and C++ compilers via intel oneAPI Base Toolkit here and Intel Fortran with the HPC add-on toolkit here.
Source the environment variables in your .zshrc
, as outlined in the documentation here:
source /opt/intel/oneapi/setvars.sh
Note that I comment the above line out once I'm finished compiling the necessary code. Check install with ifort --version
, icc --version
, icpc --version
.
UPDATE: see https://www.scivision.dev/intel-oneapi-macos-mpi/
Downloaded the latest source code of openmpi.
Configure for compilation with the intel compilers:
./configure -prefix=/usr/local/openmpi-4.1.0 CC=icc CXX=icpc FC=ifort F77=ifort FCFLAGS='-O1' CFLAGS='-O1' CXXFLAGS='-O1'
Note that I have not used the flag --disable-dlopen
. Now edit the libtool
file lines 11837 to 11841:
# Additional compiler flags for building library objects.
pic_flag=" -fno-common -fPIC"
# How to pass a linker flag through the compiler.
wl="-Wl,"
Without this edit there is a problem with mpifort (see here, here and here for details).
Finally,
sudo make
sudo make install
make
takes a suriprising amount of time...go and make a lasagne or something...
Add the paths to your .zshrc
:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/openmpi-x.x.x/lib/
export PATH=./:/usr/local/openmpi-x.x.x/bin:$PATH
export OMP_NUM_THREADS=1
Check install with mpif90 --version
Note:
- Don't do what I did and think you'll be ok installing both gnu and intel versions of openmpi alongside each other - they do not play nicely.
make
needs to come beforemake install
- if you mess up then
make uninstall
and delete the openmpi folder from/usr/local/
cp ./arch/makefile.include.linux_intel ./makefile.include
Three steps before make:
- Modify to point to the correct compilers (icc, icpc, and mpifort)
- Remove DscaLAPACK from the pre-compiler options
- Set
SCALAPACK =
- in
./src/lib/getshmem.c
add#define SHM_NORESERVE 010000
to the end of the include statements.
Then:
make
Check with mpirun -np 4 vasp_std
Download Miniconda - the default options will add code to your .zshrc
so that a base Conda environment is activated each time you are in the terminal (if you don't do this you'll default to the intel python installed as part of oneAPI toolkit).
Consider using conda auto activate if, like me, you keep forgetting to switch environments when moving between projects.
conda create -n phonopy -c conda-forge python=3
conda activate phonopy
conda install -c conda-forge phonopy
Test with
phonopy
Git can be installed via Conda (I install it on my base Conda environment as it is general purpose):
conda install -c anaconda git
MacTeX is over 2GB and I don't use the TexShop gui that comes with it, or many of the packages. Instead I download the Basic Tex and Ghostscript (each installed seperately) and LaTeXit for inserting into posters. It all worked for me without having manually having to mess with $PATHS.
Install iTerm2 and Oh my zsh. Install the nice materialsdesign colour theme in iTerm2 following this. TODO: figlet and quotes.
Install hugo (for building static websites) from a tar ball (with binary in /usr/local/bin
): https://gohugo.io/getting-started/installing.
In the website repo remove the cached theme submodule (which is empty but remains on the index) and then add it as a submodule. Check it runs ok locally.
git rm --cached ./themes/code-editor
git submodule add https://github.com/aubm/hugo-code-editor-theme.git themes/code-editor
hugo server
Do the same for the public folder where the website is hosted
git rm --cached public
git submodule add -b master [email protected]:lucydot/lucydot.github.io.git public
Zotero (replace the ~/Zotero folder with the one you have saved), pycharm, simplenote, iTerm, MacDown, Sublime, Omnigraffle, Firefox (with sci-hub and tabnotes extensions), Dropbox, Office365 (TODO: setup OneDrive), Vesta
Woo hoo! Spring clean complete. Time to make it messy again.