packmol

repository·master·Indexed 18 days ago

https://github.com/m3g/packmol

A tool for generating initial configurations for molecular dynamics simulations by packing molecules into specific spatial constraints. It ensures short-range repulsive interactions do not disrupt simulations and supports PDB, TINKER, and XYZ input formats. Version 21.2.3.

Tokens
794
Snippets
5
Records
7
Agent score
13%

What's inside packmol

  1. What is Packmol

    master

    Packmol is a tool used to create initial configurations for molecular dynamics simulations. It packs molecules into defined regions of space while ensuring that short-range repulsive interactions do not disrupt the simulations.

    To use Packmol, you must provide:

    1. The coordinates of one molecule for each type.
    2. The number of molecules for each type.
    3. The spatial constraints that each molecule type must satisfy.

    Packmol supports input files in PDB, TINKER, and XYZ formats.

  2. Manually compile Packmol using Fortran Package Manager (fpm)

    master

    You can use fpm to compile and install Packmol. This method automatically handles the executable installation into your PATH (typically ~/.local/bin on Linux).

    1. Install fpm from the official installation guide.
    2. Navigate to the packmol directory and run:
      fpm install --profile release
    
    **Customizing the compiler:**
    `fpm` uses `gfortran` by default. To use a different compiler (e.g., `ifort`), set the `FPM_FC` environment variable:
    ```bash
    export FPM_FC=ifort
  3. Manually compile Packmol using make

    master

    To compile Packmol from source using make:

    1. Download the .tar.gz or .zip release from the GitHub releases page.
    2. Unpack the archive:
      tar -xzvf packmol-VERSION.tar.gz

    or

    unzip -xzvf packmol-VERSION.zip

    3. Navigate to the `packmol` directory, configure, and build (requires `gfortran` or another Fortran compiler):
       ```bash
       cd packmol
       ./configure [optional: path to fortran compiler]
       make
    1. The packmol executable will be created in the main directory. Add this directory to your PATH to use it globally.
    cd packmol
    ./configure
    make
  4. Install Packmol via Julia (Packmol.jl)

    master
    If you prefer a Julia-based interface, you can use the Packmol.jl package. This provides executables for all common platforms and is recommended if you want to avoid manual compilation. This requires installing the Julia programming language and the Packmol package.
  5. Run Packmol via the CLI

    master

    The packmol Python package provides a command-line interface that acts as a wrapper around the compiled Packmol binary. When you call the packmol command in your terminal, it locates the appropriate platform-specific binary (e.g., packmol on Unix/Linux/macOS or packmol.exe on Windows) and executes it with the arguments you provide.

    All arguments passed to the Python CLI are forwarded directly to the underlying Packmol executable.

    # Example: Running packmol with an input configuration file
    # (Note: The specific arguments depend on your Packmol input file content)
    packmol input_file.inp