Step 1: Install Code::Blocks with MinGW
- Go to the official Code::Blocks download page:
👉 https://www.codeblocks.org/downloads/ - Download this version:
✅codeblocks-25.03mingw-setup.exe
(This includes MinGW, which is the compiler) - Run the installer and complete installation with default options.
Step 2: Install Microsoft MPI (MS-MPI) SDK & mpiSetup
- Go to the official Microsoft MPI download page:
👉 https://www.microsoft.com/en-us/download/details.aspx?id=57467 - Click on downlaod: Choose both file and then click on downlaod button.
- Run the installer and complete installation with default options (one by one):
- First install msmpisdk.msi after then install msmpisetup.exe.
Step 3: Config OpenMP and MPI in Code::Blocks (one-time Setup)
- In Code::Blocks, go to: (Settings → Compiler)

- Now do the following:
➤ Under “Compiler Settings” → “Other Compiler Options”:
Add:
-fopenmp

➤ Under “Linker Settings” → “Other Linker Options”:
- First add link Libraries by click on add button as per below screenshot.

- After then click on folder icon to select library as per below screenshot.

- First go to C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64, select all files, click Open, then click OK to add them.
- Repeat the same: go to C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x86, select all files, click Open, then click OK to add them.
- Then, under Other linker options, add -fopenmp.

➤ Finally under the “Search directories” → “Compiler”:
- Click on add button to select directory.

- After then click on folder icon as per below screenshot.

- Next, go to C:\Program Files (x86)\Microsoft SDKs\MPI\Include, click Select Folder, then click OK to add it.
- Finally click on ok button to save all the compiler configuration.

- restart the Code::Blocks.
Step 4: Create a New Project
- Open Code::Blocks
- Go to File → New → Project
- Select Console Application, then click Go → Next
- Choose C language → Next
- Name your project (e.g.,
MergeSort
) and choose a folder where you want to save your program (recomended Desktop)→ Next - Select GNU GCC Compiler → Finish.
- Then, click on Sources, open main.c, delete the default code, and write your own program.