Invoking the Intel® oneAPI DPC++ Compiler

Requirements Before Using the Command Line

You may need to set certain environment variables before using the command line. For more information, see Specifying the Location of Compiler Components with setvars.

Using the Intel® oneAPI DPC++ Compiler from the Command Line

You can invoke the compiler using the dpcpp or dpcpp-cl command.

Note

You can also use the compiler from within the IDE.

For more information on using Microsoft Visual Studio*, see Using Microsoft Visual Studio. For information on using Eclipse*, see Using Eclipse.

Linux*:

Invoke the compiler using dpcpp to compile DPC++ source files.

  • When you invoke the compiler with dpcpp the compiler builds DPC++ source files using DPC++ libraries and DPC++ include files. If you use dpcpp with a C source file, it is compiled as a DPC++ file. Use dpcpp to link DPC++ object files.

The dpcpp command does the following:

  • Compiles and links the input source file(s).
  • Produces one executable file, a.out, in the current directory.

Windows*:

You can invoke the Intel® oneAPI DPC++ Compiler on the command line using the dpcpp-cl command. This command:

  • Compiles and links the input source file(s).
  • Produces object file(s) and assigns the names of the respective source file(s), but with a .obj extension.
  • Produces one executable file and assigns to it the name of the first input file on the command line, but with a .exe extension.
  • Places all the files in the current directory.

When compilation occurs with the Intel® Compiler, many tools may be called to complete the task which may reproduce diagnostics unique to the given tool.For instance, the linker may return a message if it cannot resolve a global reference.

Command Line Syntax

When you invoke the Intel® oneAPI DPC++ Compiler, the syntax is:

// (Linux)
dpcpp [options] file1 [file2...]
// (Windows)
dpcpp-cl [options] file1 [file2...] [/link link_options]

Argument

Description

options

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 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. You can specify more than one file, using space as a delimiter for multiple files.

/link (Windows)

All options following /link are passed to the linker. Compiler options must precede link if they are not to be passed to the linker.

Other Methods for Using the Command Line to Invoke the Compiler

See Also