Wings for NONMEM Installation
Home | Installation | Control Streams | Bootstrap
| Randomization Test | Visual
Predictive Check | Autocovariate
| Files | References
Last Updated: 16 April 2025
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%.
ICON provide
two methods for installing NONMEM. Either the full installation procedure where
you choose the installation location and the Fortran compiler or the easy
NONMEM install method for Windows may be used with WFN.
If you have installed NONMEM 7.6.0
using the easy NONMEM install method for Windows (described in the
README_NONMEM760_64gfortran11p20.txt provided with NONMEM installation
materials) then %WFNHOME%\bin\wfn.txt may be copied and saved as %WFNHOME%\bin\wfn.bat.
No further modifications to wfn.bat are needed if you have installed
WFN760 in the default location (C:\NM760\wfn7).
If you wish to install NONMEM using
the nm760CD materials you may choose your preferred
Fortran compiler and NONMEM installation location. The WFN SETUP76_f77opt.bat
file may be used as an alternative to SETUP76.bat. Using SETUP76_f77opt.bat
for installation makes some changes to run NONMEM more conveniently with WFN.
You will need to customize %WFNHOME%\bin\wfn.txt and save it as wfn.bat
in the %WFNHOME%\bin folder. Hints on how to customize wfn.bat are
included in wfn.txt.
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:\nm760\wfn7
NONMEM C:\nm760
gfortran
Compiler C:\nm76g64\mingw64
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. 760). 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:\nm760\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.
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.
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:\nm760\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:\nm760\wfn7\bin\wfn.bat
where C:\nm760\wfn7 should be changed to reflect your WFN home directory
Creating WFN.BAT
It is essential that you create a file called wfn.bat
in the %WFNHOME%\bin directory. You may do this by using the wfn.txt
file in the %WFNHOME%\bin directory e.g.
copy C:\nm760\wfn7\bin\wfn.txt C:\nm760\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:\nm760).
Change
WFNHOME to reflect the directory you used when extracting files from wfnxxx.exe
(e.g. C:\nm760\wfn7).
rem ******* Check this ************
set NMHOME=C:\nm760
set WFNHOME=C:\nm760\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:\nm76g64\mingw64
set F77VER=gf
The simplest
way to obtain and install the gfortran compiler recommended for use with NONMEM
is to use the NONMEM easy installer. This installs the compiler accessible
F77HOME in C:\nm76g64\mingw64.
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
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 setup76.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 setup76.bat. They are displayed when wfn.bat
is executed e.g. for the gfortran compiler:
F77OPT =-O3
-finit-integer=0 -ffast-math -m64 -ffpe-summary=none -xf95 -w
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 setup76.bat match the options in wfn.bat.
The standard NONMEM group installation creates an nmfe76.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 nmfe76 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 nmfe76.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:
Use the WFN shortcut to open an MS-DOS window. You
should see a short list showing the variables WFN is using. Here is an example
using the gfortran compiler settings for the NONMEM easy installer:
WFNHOME =C:\nm760\wfn7
NONMEM
=7.6.0
NMHOME
=C:\nm760
NMBINHOME=C:\nm76g64
F77HOME =C:\nm76g64
F77TYP
=gf
F77EXE
=gfortran
F77OPT
=-O3 -finit-integer=0 -ffast-math -m64 -ffpe-summary=none -w
NMCTL
=.ctl
NMOUT
=.lst
NMTBL
=.fit
NMLOG
=.log
NMIGNORE =#
NMDIR
=.reg
NMOBJ
=reg
NMAWK
=gawk
LIBRARY_PATH=C:\nm76g64\lib
LIBEXEC_PATH=C:\nm76g64\libexec\gcc\x86_64-w64-mingw32\11.2.0
Here is an example using the gfortran compiler
settings following installation of NONMEM using %WFNHOME%\setup76_f77opt.bat:
WFNHOME =C:\nm760\wfn7
NONMEM
=7.6.0
NMHOME
=C:\nm760
NMBINHOME=C:\nm760\ver7_64-20250223\gf\reg
F77HOME =C:\Apps\gfortran64_v11
F77TYP
=gf
F77EXE
=gfortran
F77OPT
=-O3 -finit-integer=0 -ffast-math -m64 -ffpe-summary=none -xf95 -w
NMCTL
=.ctl
NMOUT
=.lst
NMTBL
=.fit
NMLOG
=.log
NMIGNORE =#
NMDIR
=.reg
NMOBJ
=reg
NMAWK
=gawk
LIBRARY_PATH=C:\Apps\gfortran64_v11\lib
LIBEXEC_PATH=C:\Apps\gfortran64_v11\libexec\gcc\x86_64-w64-mingw32\11.2.0
Assuming you start in
C:\nm751\wfn7\run you should see the DOS prompt:
C:\nm760\wfn7\run>
If necessary
you should change to the wfn7\run directory. There is no need to do this if you
have started 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.6.0(nm760)
THETA
= 139 191 8.8
ETASD
= 0.099 0.268 1.463
ETAPval = 0.346 0.000 0.605
ETAshrSD% = 81.0 53.9 35.7
EBVshrSD% = 81.8 59.6 29.9
EBVshREL% = 0.6 5.6 8.6
EPSshrSD% = 9.3
EPSSD
= 81.055
THETA:se% = 8.0 12.4 31.7
ETASD:se% = 176.8 21.1 17.4
EPSSD:se% = 5.4
MINIMIZATION SUCCESSFUL
Ttot 0:2.64 Test 0:0.89 Tcov 0:0.36 Ttcl
0:1.38
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:\nm760\wfn7\run
fpi 2
mpi 2
WFN supports parallel processing of NONMEM execution
on Windows machines e.g. Windows Server or Windows 11.
Installation
The NM760 installation document recommends using the
Microsoft MPI system rather than MPICH2. See guides\nm760.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
mpiexec –validate ;
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 .
cd C:\nm760\wfn7
unwfn\unwfn
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.
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