-
-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support of icx/icpx and dpcpp toolchain #2474
Comments
try |
$ xmake f --toolchain=icc --cxx=icpc --cc=icc && xmake -vD
checking for platform ... linux
checking for architecture ... x86_64
checking for Intel C/C++ Compiler (x86_64) ... ok
checking for icpc ... /home/jonathan/bin/icpc
checking for flags (-fPIC) ... ok
> icpc "-fPIC"
checking for icpc ... /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc
checking for the linker (ld) ... icpc
checking for /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc ... ok
checking for flags (-fPIC) ... no
> icpc "-fPIC"
checkinfo: @programdir/core/sandbox/modules/os.lua:257: ld: cannot find -limf: No such file or directory
ld: cannot find -lsvml: No such file or directory
ld: cannot find -lirng: No such file or directory
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:872]:
[@programdir/core/sandbox/modules/os.lua:257]: in function 'runv'
[@programdir/modules/detect/tools/gcc/has_flags.lua:42]:
[ 50%]: linking.release test
/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc -o build/linux/x86_64/release/test build/.objs/test/linux/x86_64/release/test.cpp.o -m64
|
try |
Still the same error. The wrong |
please run xmake f --toolchain=icc --cc=/home/jonathan/bin/icc --cxx=/home/jonathan/bin/icpc -cvD
xmake -rvD and give me full logs. |
checking for platform ... linux
checking for architecture ... x86_64
checking for icc ... /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc
checking for Intel C/C++ Compiler (x86_64) ... ok
configure
{
buildir = build
toolchain = icc
cc = /home/jonathan/bin/icc
plat = linux
mode = release
cxx = /home/jonathan/bin/icpc
clean = true
ccache = true
ndk_stdcxx = true
kind = static
arch = x86_64
host = linux
}
checking for /home/jonathan/bin/icpc ... ok
checking for flags (-fPIC) ... ok
> icpc "-fPIC"
[ 25%]: ccache compiling.release test.cpp
/home/jonathan/bin/icpc -c -m64 -o build/.objs/test/linux/x86_64/release/test.cpp.o test.cpp
checking for flags (-MMD -MF) ... ok
> icpc "-MMD" "-MF" "/dev/null"
checking for icpc ... /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc
checking for the linker (ld) ... icpc
checking for /opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc ... ok
checking for flags (-fPIC) ... no
> icpc "-fPIC"
checkinfo: @programdir/core/sandbox/modules/os.lua:257: ld: cannot find -limf: No such file or directory
ld: cannot find -lsvml: No such file or directory
ld: cannot find -lirng: No such file or directory
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:872]:
[@programdir/core/sandbox/modules/os.lua:257]: in function 'runv'
[@programdir/modules/detect/tools/gcc/has_flags.lua:42]:
[ 50%]: linking.release test
/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc -o build/linux/x86_64/release/test build/.objs/test/linux/x86_64/release/test.cpp.o -m64
error: @programdir/modules/private/async/runjobs.lua:256: @programdir/actions/build/kinds/binary.lua:74: @programdir/core/sandbox/modules/os.lua:257: ld: cannot find -limf: No such file or directory
ld: cannot find -lsvml: No such file or directory
ld: cannot find -lirng: No such file or directory
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:872]:
[@programdir/core/sandbox/modules/os.lua:257]: in function 'runv'
[@programdir/modules/core/tools/gcc.lua:363]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:280]:
[@programdir/actions/build/kinds/binary.lua:74]: in function 'callback'
[@programdir/modules/core/project/depend.lua:189]: in function 'on_changed'
[@programdir/actions/build/kinds/binary.lua:55]: in function '_do_link_target'
[@programdir/actions/build/kinds/binary.lua:102]:
[@programdir/actions/build/kinds/binary.lua:129]: in function '_link_target'
[@programdir/actions/build/kinds/binary.lua:157]: in function 'jobfunc'
[@programdir/modules/private/async/runjobs.lua:232]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:280]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:121]: in function 'try'
[@programdir/modules/private/async/runjobs.lua:218]: in function 'cotask'
[@programdir/core/base/scheduler.lua:388]:
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:872: in function 'base/os.raiselevel'
(...tail calls...)
@programdir/modules/private/async/runjobs.lua:256: in field 'catch'
@programdir/core/sandbox/modules/try.lua:127: in global 'try'
@programdir/modules/private/async/runjobs.lua:218: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:388: in function <@programdir/core/base/scheduler.lua:385> |
you can update to dev and try it again. |
Same, only difference is the line number of the stack trace - [@programdir/modules/core/tools/gcc.lua:363]:
+ [@programdir/modules/core/tools/gcc.lua:368]: |
this patch 47d4445 |
This is what I have. |
It should work, can you try
and give me all output again? |
I saw your previous logs, it works!
but you just switch compiler to if you want to switch linker, you need set xmake f --toolchain=icc --cc=/home/jonathan/bin/icc --cxx=/home/jonathan/bin/icpc --ld=/home/jonathan/bin/icpc -cvD
xmake -rvD |
Oh... Quite simply. Otherwise, for $ xmake f --toolchain=clang --cc=/home/jonathan/bin/icx --cxx=/home/jonathan/bin/icpx --ld=/home/jonathan/bin/icpx -cvD
checking for platform ... linux
checking for architecture ... x86_64
checking for clang ... /usr/bin/clang
configure
{
toolchain = clang
cxx = /home/jonathan/bin/icpx
mode = release
ndk_stdcxx = true
host = linux
kind = static
ld = /home/jonathan/bin/icpx
plat = linux
arch = x86_64
clean = true
ccache = true
buildir = build
cc = /home/jonathan/bin/icx
}
$ xmake -rvD
error: @programdir/core/main.lua:280: @programdir/actions/build/main.lua:166: ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:96: ...mdir/core/sandbox/modules/import/core/base/scheduler.lua:56: @programdir/modules/private/async/runjobs.lua:256: ...amdir/core/sandbox/modules/import/core/tool/compiler.lua:37: cannot find known tool script for /home/jonathan/bin/icpx
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:872]:
[...amdir/core/sandbox/modules/import/core/tool/compiler.lua:37]: in function 'load'
[@programdir/modules/private/action/build/object.lua:40]: in function 'script'
[@programdir/modules/private/action/build/object.lua:98]: in function 'build_object'
[@programdir/modules/private/action/build/object.lua:123]: in function 'jobfunc'
[@programdir/modules/private/async/runjobs.lua:232]:
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:872: in function 'os.raiselevel'
(...tail calls...)
@programdir/modules/private/async/runjobs.lua:256: in field 'catch'
@programdir/core/sandbox/modules/try.lua:127: in global 'try'
@programdir/modules/private/async/runjobs.lua:218: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:388: in function <@programdir/core/base/scheduler.lua:385>
stack traceback:
@programdir/core/base/utils.lua:290: in function <@programdir/core/base/utils.lua:280>
[C]: in function 'error'
@programdir/core/base/os.lua:872: in function 'os.raiselevel'
(...tail calls...)
...mdir/core/sandbox/modules/import/core/base/scheduler.lua:56: in field 'co_start_withopt'
@programdir/modules/private/async/runjobs.lua:217: in function <@programdir/modules/private/async/runjobs.lua:162>
[C]: in function 'xpcall'
@programdir/core/base/utils.lua:280: in function 'base/utils.trycall'
@programdir/core/base/scheduler.lua:504: in function 'base/scheduler.co_group_begin'
...mdir/core/sandbox/modules/import/core/base/scheduler.lua:94: in field 'co_group_begin'
@programdir/modules/private/async/runjobs.lua:162: in function <@programdir/modules/private/async/runjobs.lua:56>
(...tail calls...)
@programdir/actions/build/build.lua:252: in function <@programdir/actions/build/build.lua:240>
(...tail calls...)
@programdir/actions/build/main.lua:103: in global '_do_build'
@programdir/actions/build/main.lua:150: in function <@programdir/actions/build/main.lua:144>
[C]: in function 'xpcall'
@programdir/core/base/utils.lua:280: in function 'base/utils.trycall'
@programdir/core/sandbox/modules/try.lua:121: in global 'try'
@programdir/actions/build/main.lua:142: in function <@programdir/actions/build/main.lua:108>
(...tail calls...)
[C]: in function 'xpcall'
@programdir/core/base/utils.lua:280: in function 'base/utils.trycall'
(...tail calls...)
@programdir/core/base/task.lua:501: in function 'base/task.run'
@programdir/core/main.lua:278: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:388: in function <@programdir/core/base/scheduler.lua:385>
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:872: in function 'os.raiselevel'
(...tail calls...)
@programdir/core/main.lua:280: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:388: in function <@programdir/core/base/scheduler.lua:385>
test.cpp template<auto T> struct A {};
struct B { using type = int; };
int main() {
A<B{}>();
} $ icpx -std=c++20 -fsanitize=address test.cpp
ok, compiles and asan is recognized
$ icpc -std=c++20 -fsanitize=address test.cpp
icpc: command line warning #10148: option '-fsanitize=address' not supported
test.cpp(5): error: a nontype template parameter may not have class type
A<B{}>();
^
compilation aborted for test.cpp (code 2)
|
Yes, only the icc and icpc compilers are currently supported, not the icx icpx compiler, which is unknown to xmake. I don't have the icx icpx compiler environment to support them or test them at the moment. You can open pr to support them. you can add and add |
It seems that for |
It just use find_icxenv to find dpcpp, xmake/xmake/toolchains/dpcpp/check.lua Line 33 in cea2f82
you can also improve it and open a pr. |
I mean the |
oneapi contains many compilers , icc, icx, ifortran, dpcpp, and we should not rename dpcpp to oneapi. but you can add dpcpp-llvm as a separate toolchain. |
Is your feature request related to a problem? Please describe.
xmake should be able to use icx, icpx, dpcpp and dpcpp-cl who are intel llvm compiler.
Describe the solution you'd like
xmake f --toolchain=icx
andxmake f --toolchain=dpcpp
should work.icx
is a C compiler, others are C++ compiler.dpcpp-cl
is likeclang-cl
, others are likeclang
.I don't know to what extent
-E
is used, but you should know that dpcpp (and dpcpp-cl?) has a problem with the-E
flag: it expects a syntactically valid file, as if it were compiling.Reading the file from stdin doesn't work either (it seems to want to read the stream twice)
Describe alternatives you've considered
xmake f --toolchain=clang --cxx=icpx --cc=icx
, but it doesn't workAdditional context
No response
The text was updated successfully, but these errors were encountered: