You may need to set certain environment variables before using the command line. For more information, see Specify the Location of Compiler Components.
The Intel® oneAPI DPC++/C++ Compiler provides multiple drivers that can be used to invoke the compiler from the command line. Use the driver appropriate for your specific project.
Language | Linux Drivers | Windows Drivers | Option Style | Notes |
---|---|---|---|---|
C |
icx icx-cc |
icx-cc |
Linux-style |
icx is the recommended default C driver for Linux. If you use icx with a C++ source file, it is compiled as a C++ file. Use icx to link C object files. icx-cc is the Microsoft-compatible variant of icx. |
C++ |
icpx | icpx |
Linux-style |
icpx is the recommended default C++ driver for Linux. If you use icpx with a C source file, it is compiled as a C++ file. Use icpx to link C++ object files. |
C/C++ |
icx-cl (see notes) |
icx icx-cl |
Windows-style |
icx is the recommended default driver for Windows. icx-cl is the Microsoft-compatible variant of icx. NoteOn Linux, icx-cl is experimental and requires the Microsoft Visual Studio Package. |
Invoke the compiler on the command line using the following syntax:
{compiler driver} [option] file1 [file2...]
Argument | Description |
---|---|
option |
Indicates one or more command line options. On Linux systems, the compiler recognizes one or more letters preceded by a hyphen (-). On Windows, options are preceded by a hyphen (-) or slash (/). This includes linker options. Options are not required when invoking the compiler. The default behavior of the compiler implies that some options are ON by default when invoking compiler. |
file1, file2... |
Indicates one or more files to be processed by the compiler. |
For example:
icpx hello-world.cpp
For SYCL compilation, use the -fsycl option with the C++ driver:
icpx -fsycl hello-world.cpp
Linux
When you invoke the compiler on Linux:
It compiles and links the input source file(s).
It produces one executable file: a.out
It places a.out in your current directory.
Windows
When you invoke the compiler on Windows:
It compiles and links the input source file(s), producing object file(s) and assigns the names of the respective source file(s), but with an .obj extension.
It produces one executable file and assigns it the name of the first input file on the command line, but with an .exe extension.
It places all the files in your current directory.