Skip to content

Intel compiler discussion issue #2771

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

Open
henryiii opened this issue Jan 7, 2021 · 9 comments
Open

Intel compiler discussion issue #2771

henryiii opened this issue Jan 7, 2021 · 9 comments

Comments

@henryiii
Copy link
Collaborator

henryiii commented Jan 7, 2021

Intel support is just about the only thing holding up version 2.6.2; there are now three open PRs on it. I've been working with Intel's support team, and they would like standalone examples of the bugs if possible. This helps track the progress, and is a call for standalone examples of the bugs.

PR 1: #2573: Initial support for “OneAPI” Intel compilers, using CI for the first time. (We’ve always supported older compilers, like 18 & 19, but had no CI and only tested C++11 - C++14 was actually C++11 due to a typo)

  • arg()/arg{} transformation lifetime issue
  • Using Constructor() = default is broken, we have to use Constructor {} instead in several places. Also ~Destructor() = default, too.

PR 2: #2729: Builds / reimplements PR 1, from someone else, but also address new C++17 issues since we have never tested with C++17 on earlier compilers (14 either, actually, due to a typo):

  • Intel complier can’t compile enable_if_t<!all_of<is_positional<Args>...>::value> - have to use workaround to define in multiple parts
    • Three times, one time was not too bad, but one of them really should have been possible to write inline. It really doesn’t like complex template arguments.
    • Submitted as intel bug 04916230 on https://supporttickets.intel.com
      • Closed to due to no priority license
      • Needs standalone example if possible
  • Weird warning had to be added: If you are encountering an 'error: name followed by "::" must be a class or namespace name’ with the Intel compiler and a noexcept function here, try to use noexcept(true) instead of plain noexcept.
    • Includes a test change to compile
  • #if defined(__cpp_fold_expressions) && !defined(__INTEL_COMPILER) Intel compiler produces an internal error on this fold expression (This was broken on ICC 19 too)
  • We have to add <aligned_new> to get ICC to follow the standard, but that seems to be a known compatibly issue

PR 3: #2769 Just opened yesterday to try icpx. The CI configs may have an issue there, it’s not running at all yet.

@ax3l @mkuron @tobiasleibner @YannickJadoul @bstaletic might be interested.

I'm thinking about adding a workaround def so that we can disable the workarounds at will, to see if they are still needed. That might be the best way forward for us without interfering with getting the problems fixed upstream.

@bstaletic
Copy link
Collaborator

Weird warning had to be added: If you are encountering an 'error: name followed by "::" must be a class or namespace name’ with the Intel compiler and a noexcept function here, try to use noexcept(true) instead of plain noexcept.

In C++17 the noexcept specification is part of the type. That does not mean the error makes any more sense.

@Shmarvadon
Copy link

Just converted a project i work on with pybind11 to intels DPC++ 2022 and C++ 2022 compiler and it compiles but python hates it, throws a DLL not found error. If anyone has any updates on issues with intels OneAPI compilers please do reply.

@henryiii
Copy link
Collaborator Author

henryiii commented Feb 16, 2022

What DLL? What OS? Could you paste the error? We shouldn't be requiring a DLL, this is a header only no dependency project...

@Shmarvadon
Copy link

It gave a DLL load failed when importing the module.

ImportError: DLL load failed while importing GavinBackendDatasetUtils: The specified module could not be found.

Im on windows 10.
Same code compiles and works perfectly fine with MSVC compiler.

@henryiii
Copy link
Collaborator Author

I have a feeling it has something to do with https://docs.python.org/3/library/os.html#os.add_dll_directory (new in Python 3.8) - for security reasons, Python has to be told where modules live. If you are not doing a "normal" install into site-packages, it won't work unless you also fiddle with that os.add_dll_directory function.

@alessandrofasse
Copy link

alessandrofasse commented Apr 12, 2022

Hey, I also have the same problem. I wrote a simple example project to be compiled with dpcpp and this works without any problems with cmake. However when I want to import I get the same dll error.

>>> import example_project
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing example_project: The specified module could not be found.

Is there a way to get more debug information about this? @henryiii could you explain a bit more what you mean with the add_dll thing or the "normal" install?

On linux side it work :)

@alessandrofasse
Copy link

alessandrofasse commented May 2, 2022

I could trace down the problem a bit more. I seems that error comes from a missing libmmd.dll, which I could figure out by using

dumpbin /dependents example_project.pyd

which gave this output:

Dump of file .\example_project.cp310-win_amd64.pyd
File Type: DLL

  Image has the following dependencies:

    python310.dll
    libmmd.dll
    MSVCP140.dll
    VCRUNTIME140.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    KERNEL32.dll

  Summary

        3000 .data
        3000 .pdata
        F000 .rdata
        1000 .reloc
        1000 .rsrc
       22000 .text
        2000 _RDATA

When I then manually copy libmmd.dll to lib/site-packages the import works (make sure to take the 64 bit version if you compile with 64).

Any ideas to automate this?

I am now also blocked again when I really want to use sycl code. The above command adds a sycl.dll to the dependencies. Unfortunately, just copying the file as above did not resolve this issue.

@alessandrofasse
Copy link

any news on this?

@GenieTim
Copy link

for me, not even compilation works, fails with the following error:

 /data/home/.../vendor/pybind11/include/pybind11/detail/common.h:717:35: error: expected ')' before '__extension__'
    717 | template <size_t... IPrev, size_t I, bool B, bool... Bs>
        |                                   ^
  /data/home/.../vendor/pybind11/include/pybind11/detail/common.h:717:35: error: expected '>' before '__extension__'
  /data/home/.../vendor/pybind11/include/pybind11/detail/common.h:717:35: error: expected unqualified-id before ')' token
    717 | template <size_t... IPrev, size_t I, bool B, bool... Bs>
        |                                   ^

Icx version:

Intel(R) oneAPI DPC++/C++ Compiler 2024.2.0 (2024.2.0.20240602)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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

5 participants