Plugins: Difference between revisions
Line 15: | Line 15: | ||
CXX_FLAGS = -Wall -Wextra $(shell python3 -m pybind11 --includes) -std=c++11 | CXX_FLAGS = -Wall -Wextra $(shell python3 -m pybind11 --includes) -std=c++11 | ||
Compile VASP using the [[Installing_VASP.5.X.X|guide to installing VASP.6.X.X]] | Compile VASP using the [[Installing_VASP.5.X.X|guide to installing VASP.6.X.X]] | ||
{{NB|mind|Make sure to be within the conda environment when you compile VASP.}} |
Revision as of 08:35, 11 June 2024
Implementing features over VASP carries a somewhat significant overhead, both in term of code development and maintenance. An alternative approach is to use our Plugin infrastructure. Simply write Python functions in a pre-defined format and VASP will recognize and execute your code while it is running. This page describes the steps that you will need to write your first Python script and link it with VASP.
Installation
Create a new conda environment.
conda create -n vasp_plugin python=3.10
Enter the create vasp_plugin
conda environment
conda activate vasp_plugin
Navigate to the plugins
directory within VASP source code,
cd </path/to/vasp/source/code>/src/plugins
Install the VASP Python package through pip
pip install .
Add the following lines to your makefile.include
CPP_OPTIONS+= -DPLUGINS LLIBS += $(shell python3-config --ldflags --embed) -lstdc++ CXX_FLAGS = -Wall -Wextra $(shell python3 -m pybind11 --includes) -std=c++11
Compile VASP using the guide to installing VASP.6.X.X
Mind: Make sure to be within the conda environment when you compile VASP. |