Skip to content
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

Cross-compiling ITTAPI in LLVM with mingw32 #19

Closed
vchuravy opened this issue May 7, 2021 · 6 comments
Closed

Cross-compiling ITTAPI in LLVM with mingw32 #19

vchuravy opened this issue May 7, 2021 · 6 comments

Comments

@vchuravy
Copy link

vchuravy commented May 7, 2021

Cross compiling LLVM prior to LLVM 12 with mingw32 and -DLLVM_USE_INTEL_JITEVENTS used to work.

LLVM 12 switchted to ittapi in https://reviews.llvm.org/D86435 and in the cross-compilation environment for Julia's dependencies I am seeing:

[16:17:45] ninja: job failed: /opt/bin/i686-w64-mingw32-libgfortran4-cxx11/i686-w64-mingw32-gcc --sysroot=/opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/ -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/ExecutionEngine/IntelJITEvents -I/workspace/srcdir/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents -Iinclude -I/workspace/srcdir/llvm-project/llvm/include -I/workspace/srcdir/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/.. -Iittapi/include -remap -D__USING_SJLJ_EXCEPTIONS__ -D__CRT__NO_INLINE -fno-gnu-unique -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -O3 -DNDEBUG -MD -MT lib/ExecutionEngine/IntelJITEvents/CMakeFiles/LLVMIntelJITEvents.dir/__/__/__/ittapi/src/ittnotify/ittnotify_static.c.obj -MF lib/ExecutionEngine/IntelJITEvents/CMakeFiles/LLVMIntelJITEvents.dir/__/__/__/ittapi/src/ittnotify/ittnotify_static.c.obj.d -o lib/ExecutionEngine/IntelJITEvents/CMakeFiles/LLVMIntelJITEvents.dir/__/__/__/ittapi/src/ittnotify/ittnotify_static.c.obj   -c ittapi/src/ittnotify/ittnotify_static.c
[16:17:45] In file included from ittapi/src/ittnotify/ittnotify_static.c:7:0:
[16:17:45] ittapi/src/ittnotify/ittnotify_config.h:243:1: error: multiple storage classes in declaration specifiers
[16:17:45]  ITT_INLINE long
[16:17:45]  ^~~~~~~~~~
[16:17:45] ittapi/src/ittnotify/ittnotify_config.h:245:1: error: multiple storage classes in declaration specifiers
[16:17:45]  ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
[16:17:45]  ^~~~~~~~~~
[16:17:45] ittapi/src/ittnotify/ittnotify_static.c:10:0: warning: "PATH_MAX" redefined
[16:17:45]  #define PATH_MAX 512
[16:17:45]  
[16:17:45] In file included from /opt/i686-w64-mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include-fixed/limits.h:194:0,
[16:17:45]                  from /opt/i686-w64-mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include-fixed/syslimits.h:7,
[16:17:45]                  from /opt/i686-w64-mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include-fixed/limits.h:34,
[16:17:45]                  from /opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/include/stdlib.h:11,
[16:17:45]                  from /opt/i686-w64-mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include/mm_malloc.h:27,
[16:17:45]                  from /opt/i686-w64-mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include/xmmintrin.h:34,
[16:17:45]                  from /opt/i686-w64-mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include/emmintrin.h:31,
[16:17:45]                  from /opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/include/winnt.h:2299,
[16:17:45]                  from /opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/include/minwindef.h:163,
[16:17:45]                  from /opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/include/windef.h:8,
[16:17:45]                  from /opt/i686-w64-mingw32/i686-w64-mingw32/sys-root/include/windows.h:69,
[16:17:45]                  from ittapi/src/ittnotify/ittnotify_config.h:201,
[16:17:45]                  from ittapi/src/ittnotify/ittnotify_static.c:7:

https://dev.azure.com/JuliaPackaging/Yggdrasil/_build/results?buildId=10551&view=logs&jobId=64e4dabb-4ec3-501c-2d64-463504d2fa74&j=64e4dabb-4ec3-501c-2d64-463504d2fa74&t=884cc234-77a0-5797-1cd5-7376d470f420

@ekovanova
Copy link
Contributor

Could you please check compilation with the latest ittapi master?
To specify LLVM with ittapi's git tag "master", please, compile with -DITTAPI_GIT_TAG=master flag

@ekovanova
Copy link
Contributor

ekovanova commented May 13, 2021

Just to be sure that all necessary changes were involved, please, use -DITTAPI_GIT_TAG=cad9530e4250c7caf4813f03d87e302115f6ca4a flag.

@vchuravy
Copy link
Author

I can confirm that cad9530 does fix my issue.

@vchuravy
Copy link
Author

@ekovanova can you open a PR against LLVM or should I do so?

@ekovanova
Copy link
Contributor

@vchuravy , the corresponding PR in LLVM project: https://reviews.llvm.org/D102471
just waiting for landing now)

bader added a commit to llvm/llvm-project that referenced this issue May 14, 2021
…n LLVM with mingw

Fix was implemented in the ittap repo to solve an error about cross-compiling ITTAPI in LLVM with mingw.
The problem occurred in the cross-compilation environment for Julia's dependencies.
The corresponding issue item in ittapi repo: intel/ittapi#19
A new tag was created in ittapi repo for that fix.

This patch contains changes to update the ittapi tag in LLVM.

Reviewed By: bader

Differential Revision: https://reviews.llvm.org/D102471
@ekovanova
Copy link
Contributor

@vchuravy , patch with the latest ittapi tag was landed in LLVM project

arichardson pushed a commit to arichardson/llvm-project that referenced this issue Sep 12, 2021
…n LLVM with mingw

Fix was implemented in the ittap repo to solve an error about cross-compiling ITTAPI in LLVM with mingw.
The problem occurred in the cross-compilation environment for Julia's dependencies.
The corresponding issue item in ittapi repo: intel/ittapi#19
A new tag was created in ittapi repo for that fix.

This patch contains changes to update the ittapi tag in LLVM.

Reviewed By: bader

Differential Revision: https://reviews.llvm.org/D102471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants