# Compilation

## GNU

### gcc

### g++

## Intel

### icc

### icpc

## MPI

### mpicc

### mpicxx

e.g. `mpicxx -Wall -march=pentium4 -mmmx ft.cpp -o ft -lpthread`

### mpiexec

e.g. `mpiexec -n 1-host node1 master: -n 32-host node2 slave`\
该命令在node1上启动一个进程运行master，在node2机器上启动32个进程运行slave.\
不使用mpiexec而直接运行可执行文件也可以启动MPI程序，只要程序中调用了MPI\_Init函数，则所启动的进程即为MPI进程，并可执行其它MPI调用。

## Reference

1. [mpicc/mpicxx/mpiexec的区别](http://blog.sina.com.cn/s/blog_c30f4e5c0102xcq0.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legacy.cookielau.com/archives/10-hardware/intel-cpu/2-compile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
