intel / gmmlib

Other
159 stars 87 forks source link

build error with 22.3.7: ambiguating new declaration of 'GMM_STATUS GmmLib::GmmMultiAdapterContext::LockMAContextSyncMutex() #103

Closed kwizart closed 1 year ago

kwizart commented 1 year ago

With 22.3.7 (compared with 22.3.5), there is a build error using fedora-38 as following:

/builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/GlobalInfo/GmmInfo.cpp:628:24: error: ambiguating new declaration of 'GMM_STATUS GmmLib::GmmMultiAdapterContext::LockMAContextSyncMutex()'
  628 | GMM_STATUS GMM_STDCALL GmmLib::GmmMultiAdapterContext::LockMAContextSyncMutex()
      |                        ^~~~~~
In file included from /builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/inc/External/Common/GmmInfoExt.h:25,
                 from /builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/inc/../Texture/GmmTexture.h:27,
                 from /builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/inc/Internal/Common/GmmLibInc.h:52,
                 from /builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/GlobalInfo/GmmInfo.cpp:23:
/builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/inc/External/Common/GmmInfo.h:630:41: note: old declaration 'GMM_STATUS GmmLib::GmmMultiAdapterContext::LockMAContextSyncMutex()'
  630 |         GMM_STATUS                      LockMAContextSyncMutex();
      |                                         ^~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/GlobalInfo/GmmInfo.cpp:639:24: error: ambiguating new declaration of 'GMM_STATUS GmmLib::GmmMultiAdapterContext::UnLockMAContextSyncMutex()'
  639 | GMM_STATUS GMM_STDCALL GmmLib::GmmMultiAdapterContext::UnLockMAContextSyncMutex()
      |                        ^~~~~~
/builddir/build/BUILD/gmmlib-intel-gmmlib-22.3.7/Source/GmmLib/inc/External/Common/GmmInfo.h:631:41: note: old declaration 'GMM_STATUS GmmLib::GmmMultiAdapterContext::UnLockMAContextSyncMutex()'
  631 |         GMM_STATUS                      UnLockMAContextSyncMutex();
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [Source/GmmLib/CMakeFiles/igfx_gmmumd_dll.dir/build.make:527: Source/GmmLib/CMakeFiles/igfx_gmmumd_dll.dir/GlobalInfo/GmmInfo.cpp.o] Error 1

Patch coming...

johnmach commented 1 year ago

Hi @kwizart, Thank you for raising this issue. We will look into this and provide fix.

kwizart commented 1 year ago

@johnmach suggested fix in #104 Thanks for the feedback.

johnmach commented 1 year ago

Hi @kwizart, Could you please provide more details of the env in which the failure is found? Even I have tried building on fedora38, its building fine without errors. Need more details such as , OS version, Build Flags used, G++ compiler version and cmake version

kwizart commented 1 year ago

@johnmach It's reproducible using 32bit x86 build, (also reported to fix issue with nixos according to PR).

x86_32 cflags: "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection"

x86_64 cflags: "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"

kwizart commented 1 year ago

@johnmach This PR is really a no-brainer (1), can you please merge it ASAP ?

(1) You can't have a different prototype for a function.

johnmach commented 1 year ago

Hi @kwizart,

The PR is already merged as in https://github.com/intel/gmmlib/commit/bd7379952f721974f5c24a1946f90275bf3e28e1