Installing the software
Getting a computer set up for molecular docking research, from a clean install to a working AutoDock-Vina-GPU binary.
This is the boring-but-necessary first step before any of the actual science happens: getting a computer set up to run molecular docking software. It isn't a simple, one-size-fits-all process — the exact steps depend on your operating system, your GPU, and what's already installed. If you're following along on a different setup, I'd recommend finding someone familiar with your OS before you start, since a lot of what trips people up here is environment-specific. For reference, here's the machine I used to write this guide:
OS: Linux Mint 22.2 Cinnamon
Linux Kernel: 6.14.0-37-generic
Processor: 13th Gen Intel© Core™ i9-13900K × 24
Memory: 64 GiB
GPU: GeForce RTX 3090 Ti
Display Server: x11
Docking needs four separate tools working together, and each one does a different job in the pipeline:
- fPocket — finds candidate cavities on a protein's surface where a small molecule might bind.
- PyMOL — visualizes the 3D structure of proteins and ligands.
- AutoDock Vina-GPU — the docking engine itself; it's what actually calculates binding strength.
- Open Babel — converts between the various chemical file formats the other tools expect.
Step 1: Protect your PATH
Some of the installs below (especially the Miniconda installer) like to modify your shell's PATH variable, and that can quietly break other things if you're not careful. I start every session by resetting it to a known-good state:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Step 2: Update your system
sudo apt update sudo apt upgrade
Step 3: Install build prerequisites
fPocket and AutoDock Vina-GPU both get compiled from source later, so I install the compiler toolchain and libraries they depend on up front — this saves a lot of confusing "missing header" errors down the line:
sudo apt install -y build-essential git cmake libboost-all-dev libnetcdf-dev nvidia-cuda-toolkit
Step 4: Build and install fPocket
mkdir software cd software git clone https://github.com/Discngine/fpocket.git cd fpocket make sudo make install
Step 5: Install Miniconda, then PyMOL and Open Babel
PyMOL and Open Babel are easiest to manage through a dedicated conda environment, so this step installs Miniconda first:
cd .. wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh
The installer will ask a few questions along the way — here's how I answered them:
Do you accept the license terms? -> yes - Press ENTER to confirm the location - ENTER Do you wish to update your shell profile to automatically initialize conda? This will activate conda on startup and change the command prompt when activated. If you'd prefer that conda's base environment not be activated on startup, run the following command when conda is activated: conda config --set auto_activate_base false Note: You can undo this later by running `conda init --reverse $SHELL` Proceed with initialization? yes
source ~/.bashrc
With conda available, create the environment and install PyMOL and Open Babel into it in one shot:
cd software/ conda create -n biolab -c conda-forge pymol-open-source openbabel -y
Recent conda versions will also ask you to accept the Anaconda Terms of Service before it'll pull packages from the default channels:
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
Step 6: Build AutoDock Vina-GPU from source
This is the most involved step. Vina-GPU doesn't ship prebuilt binaries, so it has to be compiled against your own CUDA/OpenCL setup. You'll need a GitHub account for this part. Start by cloning the repo:
cd ~/software git clone https://github.com/DeltaGroupNJUPT/Vina-GPU-2.1.git cd Vina-GPU-2.1/AutoDock-Vina-GPU-2.1
Point the build at your system's OpenCL install:
export OPENCL_LIB_PATH=/usr/lib/x86_64-linux-gnu export OPENCL_INC_PATH=/usr/include
Then compile. This first build compiles the OpenCL kernels from source, which is slower but more portable than using the precompiled kernel binaries that ship with the repo:
g++ -o AutoDock-Vina-GPU-2-1 \ -I./lib -I./OpenCL/inc -I./main \ -I/usr/include \ ./main/main.cpp ./lib/*.cpp ./OpenCL/src/wrapcl.cpp \ -O3 \ -lboost_program_options -lboost_system -lboost_filesystem -lboost_thread -lOpenCL -lpthread -lstdc++fs \ -DOPENCL_2_0 -DNVIDIA_PLATFORM -DSMALL_BOX -DNDEBUG -DBUILD_KERNEL_FROM_SOURCE \ -DBOOST_TIMER_ENABLE_DEPRECATED
The default Makefile that ships with the repo didn't work cleanly on my setup, so I replaced it with one that uses relative paths instead. Clone the plain (non-GPU) Vina-GPU repo alongside it first:
git clone https://github.com/DeltaGroupNJUPT/Vina-GPU.git cd Vina-GPU-2.1/AutoDock-Vina_GPU2.1 rm Makefile
Then create a new Makefile (nano Makefile) with the following contents:
# 1. Path setup - using relative paths to avoid build errors BOOST_LIB_PATH = /usr/lib/x86_64-linux-gnu OPENCL_LIB_PATH = /usr/local/cuda # 2. Include paths (The -I flags) BOOST_INC_PATH = -I/usr/include VINA_GPU_INC_PATH = -I./lib -I./OpenCL/inc OPENCL_INC_PATH = -I$(OPENCL_LIB_PATH)/include # 3. Library paths and flags (The -L and -l flags) LIB_PATH = -L$(BOOST_LIB_PATH) -L$(OPENCL_LIB_PATH)/lib64 LIB_FLAGS = -lboost_program_options -lboost_thread -lboost_system -lboost_filesystem -lboost_timer -lOpenCL -lstdc++ -lstdc++fs -lm -lpthread # 4. Source files # Removed the problematic /libs/thread/src/pthread/ paths SRC = ./lib/*.cpp ./OpenCL/src/wrapcl.cpp # 5. Compiler settings GPU_PLATFORM = -DNVIDIA_PLATFORM OPENCL_VERSION = -DOPENCL_3_0 DOCKING_BOX_SIZE = -DSMALL_BOX MACRO = $(OPENCL_VERSION) $(GPU_PLATFORM) $(DOCKING_BOX_SIZE) -DBOOST_TIMER_ENABLE_DEPRECATED all: out out: ./main/main.cpp gcc -o AutoDock-Vina-GPU-2-1 $(BOOST_INC_PATH) $(VINA_GPU_INC_PATH) $(OPENCL_INC_PATH) ./main/main.cpp -O3 $(SRC) $(LIB_FLAGS) $(LIB_PATH) $(MACRO) -DNDEBUG source: ./main/main.cpp gcc -o AutoDock-Vina-GPU-2-1 $(BOOST_INC_PATH) $(VINA_GPU_INC_PATH) $(OPENCL_INC_PATH) ./main/main.cpp -O3 $(SRC) $(LIB_FLAGS) $(LIB_PATH) $(MACRO) -DNDEBUG -DBUILD_KERNEL_FROM_SOURCE clean: rm -f AutoDock-Vina-GPU-2-1
Save the file (in nano, that's Ctrl-O then Ctrl-X). There's one more small fix
needed before it'll build cleanly — open OpenCL/src/wrapcl.cpp (nano OpenCL/src/wrapcl.cpp)
and change:
#include <wrapcl.h>
to:
#include "wrapcl.h"
Then build it:
make clean make source
If that finishes without errors, you should have a working AutoDock-Vina-GPU-2-1 binary — and
honestly, getting this far feels like a win on its own. The next page walks through actually using it on a
real protein and ligand.