These instructions should get you up and running with a minimal environment for compiling 64-bit C++ projects with OpenMP (e.g., BioFVM and PhysiCell) using a 64-bit Windows port of gcc. These instructions should work for any modern Windows installation, say Windows 7 or above. This tutorial assumes you have a 64-bit CPU running on a 64-bit operating system.
In the end result, you'll have a compiler, key makefile capabilities, and a decent text editor. The entire toolchain is free and open source.
Of course, you can use other compilers and more sophisticated integrated desktop environments, but these instructions will get you a good baseline system with support for 64-bit binaries and OpenMP parallelization.
What you'll need:
- MinGW-w64 compiler: This is a native port of the venerable gcc compiler for windows, with support for 64-bit executables. Download the latest installer (mingw-w64-install.exe) here. As of January 8, 2016, this installer will download gcc 5.3.0.
- MSYS tools: This gets you some of the common command-line utilities from Linux, Unix, and BSD systems (make, touch, etc.). Download the latest installer (mingw-get-setup.exe) here.
- Notepad++ text editor: This is a full-featured text editor for Windows, including syntax highlighting, easy commenting, tabbed editing, etc. Download the latest version here. As of January 8, 2016, this will download Version 6.8.8.
Main steps:
1) Install the compiler
Run the mingw-w64-install.exe. When asked, select:Version: 5.3.0 (or later)
Architecture: x86_64
Threads: win32 (While I have tested posix, the native threading should be faster.)
Exception: seh (While sjlj works and should be more compatible with various GNU tools, the native SEH should be faster.)
Build version: 0 (or the default)
Leave the destination folder wherever the installer wants to put it. In my case, it is:
c:\Program Files\mingw-w64\x86_64-5.3.0-win32-seh-rt_v4_rev0
Let MinGW-w64 download and install whatever it needs.
2) Install the MSYS tools
- mingw-developer-toolkit. (Note: This should automatically select msys-base.)
3) Install the text editor
4) Add these tools to your system path
- Open Windows Explorer ( [Windows]+E )
- Browse through C:\, then Program Files, mingw-w64, then a messy path name corresponding to our installation choices (in my case, x86_64-5.3.0-win32-seh_rt_v4-rev0), then mingw64, and finally bin.
- Open notepad ([Windows]+R , notepad),
- Go to the address bar of Explorer and copy ([Control]+C) the full path of the directory you just browsed to.
- Paste it into notepad ([Control]+V), preceded and followed by a semicolon, and a final slash if it isn't there. In my case:
- Go back to Explorer, and choose "This PC" or "My Computer" from the left column.
- Browse through C:\, then Program Files (x86), then Notepad++.
- Copy the path from the Explorer address bar.
- Paste this path just after the final semicolon in notepad, followed by a backslash and a semicolon. In my case:
- Go back to Explorer, and choose "This PC" or "My Computer" from the left column.
- Browse through C:\, then MinGW, then msys, then 1.0, and finally bin.
- Copy the path from the Explorer address bar.
- Paste this path just after the final semicolon in notepad, followed by a backslash and a semicolon. In my case:
- Go the Start Menu, the right-click "This PC" or "My Computer", and chose "Properties."
- Click on "Advanced system settings"
- Click on "Environment Variables..." in the "Advanced" tab
- Scroll through the "System Variables" below until you find Path.
- Select "Path", then click "Edit..."
- At the very end of "Variable Value", paste what you made in Notepad in the prior steps. Make sure to paste at the end of the existing value, rather than overwriting it!
- Hit OK, OK, and OK to completely exit the "Advanced system settings."
5) Test the compiler
Write a basic parallelized program:
Write a makefile:
Compile and run the test:
What's next?
Download a copy of BioFVM and try out the included examples!- BioFVM announcement on Blogspot: [click here]
- BioFVM on MathCancer.org: http://BioFVM.MathCancer.org
- BioFVM on SourceForge: http://BioFVM.sf.net
- BioFVM Method Paper in BioInformatics: http://dx.doi.org/10.1093/bioinformatics/btv730
