Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 1.84 KB

build-csmith-on-windows.md

File metadata and controls

62 lines (47 loc) · 1.84 KB

Build Csmith on Windows

With Visual Studio

Prerequisites

We need Visual studio, cmake, and m4 to build Csmith on Windows with Visual Studio.

  • Visual Studio: Download Visual Studio community edition here
  • cmake: Download cmake binary for Windows here
  • m4: Download m4 for Windows here. We need the zip files from both "Binaries" and "Dependencies", and extract m4.exe and regex2.dll to C:\windows\system32.

Build

Suppose you have cloned the csmith project from github to c:\csmith. We have to run cmake to generate Visual Studio solution/projects files, and build them with Visual Studio.

  • generate solution/project files with cmake. The first output from cmake should indicate the target is Visual Studio.
    cd c:\csmith
    cmake -DCMAKE_INSTALL_PREFIX=<install-prefix> .
    
  • Build the solution with Visual Studio by opening the generated csmith.sln and hit build solution.

Install

You can Install the build outputs with Visual Studio by building the INSTALL project. The necessary bits for deployment is gathered under the folder designated by <install-prefix>.

With WSL

Prerequisites

We need WSL, gcc/g++, cmake, and m4 to build csmith with WSL.

  • Follow this instruction to install WSL (choose Ubuntu as the distro) on Windows.
  • Open WSL/Ubuntu terminal window, and run:
    sudo apt install g++ cmake m4

Build csmith and optionally install it

This is standard and the same as building/installing csmith on Linux:

cmake -DCMAKE_INSTALL_PREFIX=<install-prefix> .
make
make install