Answer
Nov 02, 2025 - 09:39 AM
To compile a C++ program using the Intel oneAPI DPC++/C++ Compiler on Linux, follow these steps:
1. **Set Environment Variables:**
- Determine your installation directory ``.
- Source the environment-setting script for your shell:
- For bash: `source /setvars.sh intel64`
- For csh/tcsh: `source /setvars.csh intel64`
2. **Compile Your C++ Program:**
- Use a text editor to create a file, for example, `hello-world.cpp`, with your C++ code.
- Compile the C++ program using the compiler:
- For standard C++ compilation: `icpx hello-world.cpp`
- For SYCL compilation: `icpx -fsycl hello-world.cpp`
3. **Build and Run Your Program:**
- After successful compilation, you will have an executable file.
- Run the executable to test your program.
4. **Additional Options:**
- You can control the compilation process using various compiler options.
- For more advanced compilation scenarios, refer to the Compiler Options in the Intel oneAPI DPC++/C++ Compiler documentation.
By following these steps, you can compile your C++ program using the Intel oneAPI DPC++/C++ Compiler on a Linux system. For more detailed information and troubleshooting, refer to the Intel oneAPI Programming Guide and the Intel oneAPI DPC++/C++ Compiler Developer Guide and Reference provided by Intel.
User Manual Q&A

Add New Comment