Modify Your makefile
If you use makefiles to build your GCC* application, you need to change the value for the GCC compiler variable to use the
. For example:
Intel® oneAPI
. You may also want to review the options specified by
DPC++/C++
CompilerCFLAGS
Sample GCC makefile
|
---|
|
Sample makefile modified for the
Intel® oneAPI
DPC++/C++ Compiler |
---|
|
Where [.
invocation
] is
icpx
(for C++) or
dpcpp
(for DPC++)If your GCC code includes features that are not supported with the
Intel® oneAPI
(compiler options, language extensions, macros, pragmas, and so on), you can compile those sources separately with GCC if necessary.
DPC++/C++
CompilerIn the above makefile,
area_functions.c
is an example of a source file that includes features unique to GCC. Because the
Intel® oneAPI
uses the
DPC++/C++
CompilerO2
option by default and GCC uses option
O0
as the default, we instruct GCC to compile at option
O2
. We also include the
-fno-asm
switch from the original makefile because this switch is not supported with the
Intel® oneAPI
.
DPC++/C++
CompilerSample makefile modified for using the
Intel® oneAPI
and GCC together
DPC++/C++ Compiler |
---|
|
Where [.
invocation
] is
icpx
(for C++) or
dpcpp
(for DPC++)Output of
make using a modified makefile
|
---|
|
Where [.
invocation
] is
icpx
(for C++) or
dpcpp
(for DPC++)Use IPO in Makefiles
By default, IPO generates "dummy" object files containing Interprocedural information used by the compiler. To link or create static libraries with these object files requires special Intel®-provided tools. To use them in your makefile, simply replace references to "ld" with "xild" and references to "ar" with "xiar", or use
to link as shown below.
icx
or
icpx
(for C++) or
dpcpp
(for DPC++)Sample makefile modified for the
Intel® oneAPI
with IPO
DPC++/C++ Compiler |
---|
|
Where [.
invocation
] is
icpx
(for C++) or
dpcpp
(for DPC++)