Installation

Required Software

NONMEM

PsN supports standard installations of NONMEM.
Verify that all NONMEM installations you intend to use can be run directly via the nmfe script and that they produce complete output files.
If running NONMEM with nmfe does not work then PsN will not work either.
If you plan to use the parallelization features of NONMEM you must also verify that you can run NONMEM in parallel directly with the nmfe script.

Windows

PsN comes bundled with all its dependencies to make it easier to install. Included is PsN itself, perl, R, python, perl packages, R packages, python packages and Pharmpy. Everything is tested together and nothing should interfere with any other installations of the same software that you might have on your computer.
  1. Unpack the file you downloaded from the PsN Download Page. The unpacked directory can be put at any location on your computer.
  2. Update your PATH environment variable to include the path to PsN-5.3.1\strawberry\perl\bin
  3. Add your NONMEM version by editing the PsN configuration file at PsN-5.3.1\strawberry\perl\site\lib\PsN_5_3_1\psn.conf. Under [nm_versions] add for example default=C:\nm751,7.5.1 if your NONMEM version is 7.5.1 and can be found under C:\nm751

Linux

Before installing PsN on Linux, you should make sure that the required programs are installed on your computer.
Ubuntu/Debian
apt install python3 python3-venv python3-dev
apt install make

Installing system dependencies for plotting and reporting

To be able to use the automatic rplotting functionality (via the -rplots option) and/or the qa tool the following needs to be installed:
Ubuntu/Debian
apt install r-base
apt install pandoc
apt install libpq-dev
apt install libcairo2-dev
apt install libssl-dev
apt install libcurl4-openssl-dev
apt install libmariadb-dev
apt install libgmp-dev
apt install libmpfr-dev
apt install libxml2-dev
apt install libudunits2-dev
apt install libblas-dev
apt install liblapack-dev
apt install libmagick++-dev
CentOS/Fedora
yum install R
yum install pandoc
yum install openssl-devel
yum install libcurl-devel
yum install cairo-devel
yum install mariadb-devel
yum install libxml2-devel
yum install ImageMagick-c++-devel

Installing Perl modules

You might need to answer some questions interactively when using the cpan command.
  1. Open a terminal.
  2. Run the following commands (hit ↵ after each command), prepend sudo if necessary:
    cpan Math::Random
    cpan Math::MatrixReal
    cpan Mouse
    cpan MouseX::Params::Validate
    cpan Archive::Zip
    cpan YAML
    cpan Capture::Tiny
    cpan File::Copy::Recursive
    cpan File::HomeDir
    cpan Math::SigFigs
    cpan Statistics::Distributions

Installing PsN

  1. Unpack the file you downloaded from the PsN Download Page. It will create a directory called PsN-Source.

  2. Open a terminal, cd to the PsN-Source directory and type: sudo perl setup.pl and ↵.

    sudo can be skipped if you already have write permissions in the installation directories you intend to use.

  3. Read all messages carefully and answer the questions on screen. The default settings are probably the best for most users. It is highly recommended to let the installation script create psn.conf. automatically unless you are experienced in installing and configuring PsN.

macOS

Required software on macOS

Before you install PsN on Linux or MacOS, you should make sure that the required programs and modules are installed on your computer. To be able to use the automatic rplotting functionality (via the -rplots option) and/or the qa tool the following needs to be installed:

Installing system dependencies for plotting and reporting

The dependencies of PsNR need some system packages to be installed. One option is to install them via via brew:
openssl@1.1
cairo
and
mariadb-connector-c.


Installing Perl modules

You might need to answer some questions interactively when using the cpan command.
  1. Open a terminal.
  2. Run the following commands (hit ↵ after each command), prepend sudo if necessary:
    cpan Math::Random
    cpan Math::MatrixReal
    cpan Mouse
    cpan MouseX::Params::Validate
    cpan Archive::Zip
    cpan YAML
    cpan Capture::Tiny
    cpan File::Copy::Recursive
    cpan File::HomeDir
    cpan Math::SigFigs
    cpan Statistics::Distributions
In some cases it might be necessary to install a newer version of Perl via brew:
  1. Install homebrew
  2. Install Perl via homebrew: brew install perl
  3. Tell the system which perl to use (the following could be put into your ~/.bash_profile:
    1. alias perl=/usr/local/Cellar/perl/5.30.0/bin/perl
    2. alias cpan=/usr/local/Cellar/perl/5.30.0/bin/cpan
  4. Now install the Perl packages
  5. When installing PsN remember to set the path to the brew version of Perl as the perl binary to use. (use which perl)

Installing PsN

  1. Unpack the file you downloaded from the PsN Download Page. It will create a directory called PsN-Source.

  2. Open a terminal, cd to the PsN-Source directory and type: sudo perl setup.pl and ↵.

    sudo can be skipped if you already have write permissions in the installation directories you intend to use.

  3. Read all messages carefully and answer the questions on screen.
Mac users with the latest version(s) of Mac Os cannot accept the default installation folder for PsN utilities, even when installing as root.1
Do the following:
Run setup.pl as root.

When setup.pl prompts for the PsN Utilities directory like this:
PsN Utilities installation directory [/usr/bin]:
type /usr/local/bin and ↵.

The other default settings can be accepted.
If there is a message about PsN already being installed this message is misleading, what it should say is that PsN is already *partially* installed. This is not an error, just say yes to continue.


Configuring PsN

  • If you did not let the installation script create the configuration file psn.conf for you, or if you are running NONMEM via NMQual or on a cluster, you need to edit psn.conf in the PsN installation directory.
    The document PsN Configuration.pdf describes how to make the correct settings in the psn.conf file.


  • Portable PsN installations

    This functionality is intended for advanced users only. The setup.pl script takes an optional argument 'relative':
    setup.pl relative
    If this argument is given, the bin scripts (PsN Utilities) will use a relative path when including the lib modules (PsN Core and Toolkit). This makes the PsN installation directory movable, as long as the relative position between the bin scripts and lib modules remains the same.
    In addition the [nm_versions] section in psn.conf can list the name of the nmfe executables instead of the full path to the NONMEM installation directories if at runtime the nmfe executable, chosen by default or with option -nm_version, is in the user $PATH, see documentation in PsN Configuration.pdf.
    The test package, if installed, will not be portable even if setup.pl is run with argument relative. If the test package is moved, the file test/includes.pm must be edited manually before any tests are run.

    Multiple PsN installations

    On Windows

    Since each version of PsN comes in its own bundle, multiple versions can be installed at the same time, but only one can be active in PATH at a time.

    On Linux and macOS

    It is possible to have several installations of PsN and use them in parallel. The default version of PsN may be changed every time a new installation is made. To check which PsN version is the default use the command
    psn -version
    A specific version may be called with its version number, for example
    execute-5.3.1 -help