Back to Installation

MCNP — Windows Installation

Building and configuring MCNP on Windows with Visual Studio and Intel Fortran

System Requirements

Hardware

CPU: 2+ cores, 2.0 GHz minimum

RAM: 4 GB minimum, 16 GB recommended

Storage: 20 GB free space

Network: Internet access for downloads

Software

OS: Windows 10 / 11 (64-bit)

Visual Studio: 2019 or newer (Community edition sufficient)

Intel Fortran: Intel oneAPI HPC Toolkit

Microsoft MPI: For parallel execution

Windows SDK: Latest version

Required Software

Install the following tools before building MCNP. Links are to official Microsoft and Intel download pages.

Visual Studio 2019+ (Community)

During installation select the "Desktop development with C++" workload. The Community edition is free for academic and personal use.

Intel oneAPI HPC Toolkit (Intel Fortran)

Provides ifort, required for compiling MCNP's Fortran source. The free oneAPI edition is sufficient.

Microsoft MPI

Required for parallel execution. Install both the runtime and the SDK package.

Build Process

Open the Intel oneAPI Command Prompt (or the Visual Studio Developer Command Prompt with the Intel Fortran environment sourced), then navigate to the MCNP source directory and run nmake.

Compile and install

batch
REM Navigate to the MCNP source directory
cd C:\MCNP6.2\Source

REM Set compiler environment variables
set FC=ifort
set CC=cl
set CXX=cl

REM Build using nmake
nmake -f Makefile.win

REM Install to Program Files (or any directory)
nmake -f Makefile.win install

Add to PATH

After installation, add the MCNP bin directory to your system PATH so mcnp6 can be called from any command prompt. Open System Properties → Environment Variables → edit the Path variable and add the path to your MCNP binary (e.g., C:\MCNP6.2\bin).

Cross-Section Data

Nuclear data libraries are distributed separately by RSICC. The most common libraries are:

Essential Libraries

ENDF/B-VIII.0: Latest US evaluation — library suffix .80c

ENDF/B-VII.1: Well-validated library — library suffix .71c

Thermal Data: S(α,β) scattering libraries for bound moderators

Photon Data: Atomic relaxation data for photon transport

Setup data path

Extract the cross-section archive to a directory (e.g., C:\MCNP6.2\data), then set the DATAPATH environment variable to that directory so MCNP can find the xsdir file.

batch
REM Set via command prompt (session only)
set DATAPATH=C:\MCNP6.2\data

REM Or set permanently via System Properties → Environment Variables
REM Variable name:  DATAPATH
REM Variable value: C:\MCNP6.2\data

REM Verify the xsdir file is present
dir C:\MCNP6.2\data\xsdir

Verify the Installation

Create a simple test input file and run it to confirm MCNP and the cross-section data are both working correctly.

Test input (test.i)

mcnp
Simple sphere test
1 1 -1.0 -1 imp:n=1
2 0      1  imp:n=0

1 so 10

m1 1001.70c 1
sdef
nps 1000

Run the test

batch
REM Run MCNP with the test input
mcnp6 i=test.i o=test.o

REM Search the output for the completion message
findstr "run terminated normally" test.o

A successful run prints run terminated normally in the output file.

Test parallel execution

batch
mpiexec -n 4 mcnp6 i=test.i o=test_parallel.o tasks 4

Common Issues

Intel Fortran not found

Open the Intel oneAPI Command Prompt rather than a standard command prompt — it sets all compiler environment variables automatically.

nmake errors

Verify that FC, CC, and CXX are set correctly and that the Visual Studio C++ tools are installed alongside Intel Fortran.

MPI problems

Install both the Microsoft MPI runtime and SDK. Ensure mpiexec is in your PATH before running parallel jobs.

Cross-section errors

Check that DATAPATH is set as a system environment variable (not just for the current session) and that it points to the directory containing xsdir.

Permission errors

Run the command prompt as Administrator when installing to C:\Program Files or other protected directories.

For additional troubleshooting, see the MCNP Troubleshooting guide. Keep your RSICC account credentials secure — MCNP licenses typically require annual renewal.