Wings for NONMEM Installation

 

Home | Installation | Control Streams | Bootstrap | Randomization Test | Visual Predictive Check | Autocovariate | Files | References

 

Last Updated: 12 March 2022

 

These instructions assume you have already installed NONMEM and a Fortran compiler and wish to install WFN to change the way you use an existing NONMEM installation.

 

IMPORTANT
WFN will only work after NONMEM and a Fortran compiler have already been installed. You must be able to identify the file directory paths ('home directory') for NONMEM and the compiler in order to complete the installation of WFN.

 

There are 3 'home' directories that need to be identified. A home directory contains files and sub-directories used by each main component i.e. WFN, NONMEM and the F77 compiler. Typical values for these home directories are:

 

Wings for NONMEM                         C:\nm751\wfn7

NONMEM                                          C:\nm751

gfortran Compiler                               C:\Program Files\gfortran

 

Note the home directory is not the same as the directory containing executable files such as the compiler program. These executable files are found in sub-directories of the home directory e.g. in gfortran\bin for the gfortran compiler.

 

Installing WFN depends on how NONMEM has been installed and the compiler that is used. The NONMEM distribution from Icon Development Systems has a suggested installation for use with the Intel Visual Fortran, gfortran and g95 compilers. These compilers are also supported by WFN.

Installing WFN

WFN is distributed as wfn***.exe (where *** is the version number e.g. 751). Open the wfn***.exe file. You will be presented with options for extracting the contents. You should extract into the WFN home directory. It can be any directory you choose. The suggested default for extracting files when you run wfn***.exe is C:\nm751\wfn7. Check the “Unzip to folder” option and then click on Unzip. After the files have been extracted you may close the WinZip Self-Extractor window.

The WFN home directory will be referred to as WFNHOME in the following description. Note that when environment variables such as WFNHOME are used as part of a Windows command expression they are written as %WFNHOME%. When environment variables are set the surrounding % is not used to define the variable name.

Extracting files from wfn***.exe creates a %WFNHOME%\bin directory which contains the WFN command files, a %WFNHOME%\web directory which contains this documentation and a %WFNHOME%\run directory which contains some examples which you can use to run nmgo and qualify your installation.

Creating a WFN Shortcut

You will need to use a Windows shortcut to open an MS-DOS prompt window and invoke a special startup batch file (wfn.bat). You will need to know the full path to wfn.bat. It is in %WFNHOME%\bin e.g. C:\nm751\wfn7\bin.

·        On the Windows desktop make a right click and select New Shortcut. When prompted to "Type the location of the item" enter %SystemRoot%\system32\cmd.exe /k followed by the full path for wfn.bat e.g.

%SystemRoot%\system32\cmd.exe /k  C:\nm751\wfn7\bin\wfn.bat

 

where C:\nm751\wfn7 should be changed to reflect your WFN home directory


Creating WFN.BAT

It is essential that you create a file called wfn.bat. You may do this by using the wfn.txt file in the %WFNHOME% directory e.g.

copy C:\nm751\wfn7\bin\wfn.txt  C:\nm751\wfn7\bin\wfn.bat

or

open wfn.txt in a text editor and save as wfn.bat.

wfn.bat is used to set up environment variables when you open a Command Prompt window. These variables are used to individualize your WFN installation.
Open wfn.bat in a text editor and look for the sections marked:

rem ******* Check this ************.

Be prepared to make changes to wfn.bat that reflect the setup of WFN, NONMEM and the Fortran compiler you use. The changes you make are to the Command Prompt environment variables.

·  Location of WFN and NONMEM

Change the NMHOME value to the directory which has your installation of NONMEM files in it (e.g. C:\nm751).
Change WFNHOME to reflect the directory you used when extracting files from wfnxxx.exe (e.g. C:\nm751\wfn7).

rem ******* Check this ************
set NMHOME=C:\nm751
set WFNHOME=C:\nm751\wfn7

·  Location of Fortran Compiler and Compiler type

Change the F77HOME to the directory your compiler uses as its home. Usually it has a bin subdirectory in it that contains the compiler executable files. Do not include the \bin as part of F77HOME. Specific examples are shown below.

Change F77VER to one of the following compiler types:

 

ivf        - Intel Fortran Version 10

ivf11     - Intel Fortran Version 11

gf         - gfortran

g95      – g95

 

Note these compiler types are not necessarily the same as the compiler executable name.

Change F77HOME to the home directory for the gfortran compiler and set the compiler version F77VER to gf e.g.

 

set F77HOME=C:\Program Files\gfortran

set F77VER=gf

 

Change F77HOME to the home directory for the ivf compiler. Set the compiler version F77VER to ivf

 

set F77HOME=C:\Program Files\Intel\Compiler\Fortran\10.1.024
set F77VER=ivf

 

Change F77HOME to the home directory for the ivf11 compiler. Set the compiler version F77VER to ivf11

 

set F77HOME=C:\Program Files\Intel\Compiler\11.0\061\fortran

set F77VER=iv11

 

The ivf11 compiler may also to know about Microsoft Visual Studio tools. If you get error messages during compilation suggesting an installation problem then you should go to the :ivf11 section of wfn.bat (search for the text ":ivf11") and enable the setting of VS80COMNTOOLS by removing the ‘rem’ at the start of the line.

Check the VS80COMNTOOLS directory by comparing it with the actual directory path e.g.

set VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools 

Change F77HOME to the home directory for the g95 compiler and set the compiler version F77VER to g95 e.g.

 

set F77HOME=C:\MingW

set F77VER=g95

·         

·        Paths to Other Software

rem ******* Other Software ******
rem If you use Crossgraphs then set CGHOME
set CGHOME=C:\Program Files\PPD Informatics\CrossGraphs
rem If you use nmvpc or R or Rstudio then set RPATH

set RPATH=C:\Program Files\R\R-4.0.3\bin\x64;C:\Program Files\R\RStudio_1.3.1093\bin

rem If you use Monolix then set MLXVER and MONOLIXDATA rem set MLXVER=

rem if '%MLXVER%=='432  echo export MONOLIX=/share/apps/monolix/noarch/Monolix432s>>%nmgridsh%

if '%MLXVER%=='432 set MONOLIX=C:\Apps\Monolix\Monolix432_32bit\Monolix\Monolix432s

rem set MONOLIXDATA="C:\Documents and Settings\nhol004\monolixData"

rem If you use the NeSI grid then set NESI_HOME

rem set NESI_HOME=C:\Program Files\NeSI tools

 

Options

Compiler Options

You need to be aware that there are 2 steps in compilation of NONMEM. The first step is performed at installation of NONMEM and creates a set of obj files and a nonmem.lib library. This compilation step is only repeated if you make changes to NONMEM source code and rerun the NONMEM setup72.bat. The second is when the user supplied sub-routine FSUBS created by NM-TRAN is compiled and linked with the pre-compiled object files. This happens every time that nmgo is used.


The compiler options used by WFN are set in wfn.bat. The default values are the same as those used by setup74.bat. They are displayed when wfn.bat is executed e.g. for the Intel Fortran compiler:
F77OPT =/Gs /nologo /nbs /w /Ob1gyti /Qprec_div /4Yportlib
and can also be found in the *.log file created in the run sub-directory e.g.
ifort /Gs /nologo /nbs /w /Ob1gyti /Qprec_div /4Yportlib /Fetheopd FSUBS.for @link.txt

The compiler options in wfn.bat may be changed by modifying the compiler specific section of wfn.bat where F77OPT is set. You should take care that the compiler options used for both of these compilation steps are identical by ensuring that the options for the compiler in setup74.bat match the options in wfn.bat.

The standard NONMEM group installation creates an nmfe74.bat file with the compiler options set in the environment variable op. It includes a run time /traceback option that slows down execution by about 10% and has little value for users. The WFN Fortran compiler options do not include this option by default. It can be activated by setting the environment variable F77TRACE=y in wfn.bat.

 

If you compare the results of NONMEM runs using both nmfe74 and nmgo and discover small differences in the output of NONMEM then this is most likely due to using different compiler options. Be sure to check the compiler options that are set in nmfe74.bat and wfn.bat.

 

It has been suggested that using other options with the Intel Visual Fortran compiler may give more consistent results across different versions of NONMEM.

On 24/05/2011 8:59 a.m., Rik Schoemaker wrote to nmusers:

Dear all,

 

In contrast to Dieter's findings, I can assure you it is very well possible to set up MPI on a Windows 7 64 bit installation if you use Intel Visual Fortran.

 

If you use the following compiler settings:

 

set op=/Gs /nologo /nbs /w /fp:strict

(win7)

-fp-model strict -Gs -nologo -nbs -w -static

(linux/MacOSX)

 

you will get identical results for NONMEM 7.1, NONMEM 7.2, with and without MPI on Windows 7 64 bit, Linux and Mac OSX providing you have the same Fortran compiler version (we use 11.1). I can assure you that this is definitely not the case when you use the default settings.

 


WFN Options

There are five WFN options in wfn.bat that you may wish to change:

Qualifying Your Installation

Use the WFN shortcut to open an MS-DOS window. You should see a short list showing the variables WFN is using (OS will be blank if you are not using Windows NT). Here is an example using the gfortran compiler settings:

 

OS       =Windows_NT

WFNHOME  =C:\nm751\wfn7

NMHOME   =C:\nm751

NMBINHOME=C:\nm751

F77HOME  =C:\Program Files\Apps\gfortran

F77TYP   =gf

F77EXE   =gfortran

F77OPT   =-O3 -ffast-math -w

NMCTL    =.ctl

NMOUT    =.lst

NMTBL    =.fit

NMLOG    =.log

NMIGNORE =#

NMDIR    =.nm7

NMOBJ    =.

NMAWK    =gawk

LIBRARY_PATH=C:\Program Files\Apps\gfortran\lib 

 

Assuming you start in C:\nm751\wfn7\run you should see the DOS prompt:

 

C:\nm751\wfn7\run>

 

If necessary you should change to the wfn7\run directory. There is no need to do this if you start in the C:\nm751\wfn7\run directory.

 

cd C:\nm751\wfn7\run 

 

Then run NONMEM using the nmgo command. The run directory contains theopd.ctl and an associated data file, theopd.dat. If you have changed the NMCTL value from .ctl then you will need to rename theopd.ctl to your preferred extension e.g. if you change NMCTL to .mod then rename theopd.ctl to theopd.mod before trying to use the nmgo command.


nmgo theopd

 

If nmgo runs correctly you should see this when it finishes (results and the timing information in the last line will depend on the computer and compiler you use):


THETA:      POP_E0      POP_EMAX    POP_EC50

ETA:        PPV_E0      PPV_EMAX    PPV_EC50

ERR:        RUV_SD

theopd.lst      5801.321        FOCE    eval=295 sig=+4.2 sub=153 obs=574 NM7.5.1

THETA     = 139         191         8.8

 

ETASD     = 0.099       0.268       1.463

 

ETAPval   = 0.346       0.000       0.605

ETAshrSD% = 81.1        55.9        35.8

EBVshrSD% = 81.8        59.6        29.9

EBVshREL% = 0.6         5.6         8.6

EPSshrSD% = 9.3

 

EPSSD     = 81.055

 

THETA:se% = 7.3         13.2        35.2

ETASD:se% = 172.7       21.8        17.5

EPSSD:se% = 5.4

 

MINIMIZATION SUCCESSFUL

 

 Ttot 0:6.96 Test 0:1.99 Tcov 0:0.75 Ttcl 0:4.2


Once you have qualified the installation you can go ahead and use nmgo on your own data.  You can execute nmgo from any directory you wish but the NMTRAN control stream file (e.g. theopd.ctl) must be in the current directory. Do not attempt to use a path to point to a control stream in another directory.

 

Parallel Execution

You may test the use of the file passing interface (fpi) and the message passing interface (mpi) with the fpi.bat and mpi.bat commands in the %wfnhome%\run directory e.g. the following commands will run fpi then mpi with the theopd problem assuming two nodes are available on your computer. 

cd C:\nm751\wfn7\run

fpi 2

mpi 2

 

WFN supports parallel processing of NONMEM execution on Windows machines e.g. Windows Server or Windows 10.

Installation

The NM751 installation document recommends using the Microsoft MPI system rather than MPICH2. See guides\nm751.pdf p 290

Instructions and materials for Microsoft MPI installation are located at https://nonmem.iconplc.com/msmpi

Using MSMPI involves installation using msmpisetup.exe. MSMPI has to be installed on a local hard disk for every computer using MPI. By default it is installed in C:\Program Files\Microsoft MPI\Bin\

Follow the instructions in msmpi_read.pdf to copy the files in msmpi\mpi_wing to the NONMEM installation mpi\mpi_wing folder (accept any overwrites). Then open a WFN shortcut and run msmpi_buildg.bat. This creates the gfortran specific files needed to run MPI. It may take a while to complete.

The nmloc.bat file located in the top folder of then NONMEM installation must be updated in all parts with the appropriate information. Ignore the misleading comments in nmloc.bat which suggests assignment to environment variables can be left blank.

MPI on Windows Server may ask for smpd passphrase. If your Windows password is not accepted then try this:

mpiexec –remove     ; remove your account and password (if it already exists)

mpiexec –register   ; enter your account name and Windows password

mpiexecvalidate  ; should show SUCCESS

 

Starting Parallel Execution of NONMEM

Parallel execution of mpi runs with WFN is controlled by the cpus environment variable. By setting this variable before running nmgo you will be able to use MPI with nmgo, nmbs and nmbsgosim.

set cpus=2

nmgo theopd

 

The commands above are equivalent to using mpi.bat with an argument of 2.

It is simple to use MPI with any NONMEM run just by setting the cpus environment variable.

 

Stopping Parallel Execution of NONMEM

To stop using MPI then unset cpus:

set cpus=

When cpus is not set parallel execution of NONMEM is not used.

Using the NESI Grid

If you have access to the NESI grid you can use WFN to submit jobs and use multiple CPUs on the grid. See the NESI Grid installation instructions.

 

Problems

It is normal to see a message from NM-TRAN giving warnings like this:

 WARNINGS AND ERRORS (IF ANY) FOR PROBLEM 1

(WARNING 2) NM-TRAN INFERS THAT THE DATA ARE POPULATION.

(WARNING 13) WITH USER-WRITTEN PRED OR $PRED, NM-TRAN CANNOT APPEND THE
MDV DATA ITEM.

It is also normal to find this at the end of the log file created in the run directory:

[status]
Error=None

If you have problems running WFN please let me know and I will try to help. It is helpful if you make a copy of the WFN window that appears immediately after opening the WFN shortcut and send this to me. If you right click on the WFN window title bar you will see an Edit option. Use this to Mark and Copy the WFN window contents and paste it into an email. Please also send a copy of the screen showing error messages and the command you typed that led to the error. Please do not use PrtSc to create bit map screen dumps!

Uninstall

If you wish to remove all wfn files please use the unwfn\unwfn.bat DOS batch command file. Open a DOS window, change to the %WFNHOME% directory and execute unwfn.bat . This will leave the directory structure, any files not installed by wfn and the unwfn\unwfn.bat file. You may delete the unwfn and unwfn.bat file.

cd C:\nm751\wfn7
unwfn\unwfn

NONMEM Versions

See the NONMEM Versions page for instructions on using more than one version of NONMEM with WFN. Installation of NONMEM using the %WFNHOME%\nminstall.bat is the simplest way to do this.

Home | Installation | Control Streams | Bootstrap | Randomization Test | Visual Predictive Check | Autocovariate | Files | References