Skip to content

Instantly share code, notes, and snippets.

@Chengcheng-Xiao
Last active December 30, 2020 10:16
Show Gist options
  • Save Chengcheng-Xiao/4fe747ade553108c76b4b39ba48739c7 to your computer and use it in GitHub Desktop.
Save Chengcheng-Xiao/4fe747ade553108c76b4b39ba48739c7 to your computer and use it in GitHub Desktop.
p4vasp compile with macports

Use macports to install:

sudo port install python27
sudo port install py27-pip
sudo port install py27-gobject
sudo port install gettext
sudo port install py-pygtk +x11

(NOTE) we don't need mp-gcc for this:

sudo port select --set gcc none

select out newly install python and pip as default:

sudo port select --set pip pip27
sudo port select --set python2 python27

using pip to install:

pip install pyopengl numpy

install fltk from source (need to install from source because of some SDK error in OSX 11 big sur):

sudo port -v -s install fltk

compile p4vasp with default gcc(clang):

cd ~/install
git clone https://github.com/orest-d/p4vasp.git
cd p4vasp
patch -p0 -i MacOS.patch

modify all g++-7 to clang++:

vi odpdom/Makefile.MacOS
vi src/Makefile.MacOS

modify src/Makefile.MacOS - line 68:

        $(LD) $(LDFLAGS) -o _cp4vasp.so cp4vasp_wrap.o -lp4vasp $(LIBS) -L/opt/local/lib `python-config --ldflags`

and copy modified makefiles.macos to makefiles:

cp odpdom/Makefile.MacOS odpdom/Makefile
cp src/Makefile.MacOS src/Makefile

(NOTE) we do not need to patch the main Makefile because we have linked python2 to python-mp-27.

compile p4vasp:

make local
make
make install

Optionally, change install directory:

vi install/Configuration.mk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment