Open vanotuvanov opened 2 weeks ago
No idea ... these symbols are provided by libCoreLegacy.lib
, which is listed on the command line above.
Can you check that library with dumpbin.exe /exports
? Maybe there's a disagreement between calling conventions.
I don't quite understand what I should see in the output of this command. I copied the entire output to the attached file. Can you take a look at it or tell me what to find? outLibCoreLegace.txt
From that output, you can see that libCoreLib contains symbols build for 64b windows, but you are creating a 32b build above. My best guess is that you are running a 32b version of Python in a 64b MSVC environment.
Thanks! It really helped to complete the build, but other problems arose. I want to make a small digression and explain why I'm going to use your wonderful library. I need to wrap a fairly large library written in c++ using CMAKE. It needs to be implemented on Linux and Windows. Everything worked out on Linux, and the following problems occurred when building on Windows:
At the same time, everything was imported into Python without errors. Since it was possible to solve a similar problem on Linux by building from source, attempts were also made to build on Windows. Thanks to your previous answer, it turned out to create whl files for each module (cppyy-cling, cppyy-backend, CPyCppyy, cppyy).
But after installing dll files using pip (pip install
A similar problem was manifested in PyCharm. But, there was also the following conclusion:
The file libcppyy_backend.dll indeed, it is in the Python\Python311\Lib\site-packages\cppyy_backend\lib folder. The path to the loder.The py is transmitted correctly. And a curious note, with the usual installation of cppyy using pip, the installation is correct. The cppyy import is error-free, but the error in QtCreator is still being reproduced. QtCreator uses MSVC 2017 64 bit. Do you have any thoughts about the following:
For the first error, I'm not sure how the the build of that dictionary file was executed (I can't find the actual link command in the trace), but all those symbols live in libCoreLegacy, so it should be linked with that. On Linux, you don't need to: symbol resolution is completely deferred until runtime, so that difference isn't surprising. Aside, dictionaries aren't needed unless you want to package code (such as include paths and headers) with binaries. Technically, dictionaries only still exist for automatic I/O, but that has never been advertised as a feature and is slated to be removed altogether. It suffices to simply load the headers and shared libraries.
As for the Python error, there may still be issues of 32b vs. 64b Python and library. A clearer, more descriptive, error typically shows up if you try to load libcppyy_backend.dll
with ctypes.CDLL()
(use the full path to the filename). The file build really should have the full platform name in it, so not sure why that isn't the case here (old releases didn't, but using the full platform name has been added quite some time ago).
That backtrace from PyCharm is likely a segfault somewhere. Unfortunately, the stack traces on Windows are unreliable in my experience (upstream claims they work fine). If this is after a failure of loading libcppyy_backend
, I wouldn't put too much stock in it; it may be a problem with unloading some of the other legacy libraries.
Understood. Thank you so much for your help. As a result, you will have to abandon the Windows build until a better time. Can you tell me when the next library release will be? Since the last issue was a long time ago (November 15, 2023).
I don't understand what part of the above you think is fixed in a future release? They still seem to be local issues?
(And I'm working on it; was hoping to wait for LLVM18 in upstream, but there are some issues on Mac where LLVM13 is no longer support.)
Yes, rather, these are local problems as well. I tried to build on two different systems and in both cases the error was reproduced
Right, but whatever the reason is, I don't see any of it being fixed by a new release?
If it doesn't fix it, it won't fix it.
Hello, when building from the source codes of your library with the command pip install cppyy --no-binary=cppyy-cling --force-reinstall --verbose, the build crashes with , the log is presented below. The build takes place in Windows 10, using the MSVC compiler, python 3.11.5.
Build log with errors
Building wheels for collected packages: cppyy-backend, cppyy-cling Building wheel for cppyy-backend (pyproject.toml): started Running command Building wheel for cppyy-backend (pyproject.toml) running bdist_wheel running build running build_ext checking for build\temp.win32-cpython-311\Release creating build\temp.win32-cpython-311\Release creating build\temp.win32-cpython-311\Release\src "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\TEMP\pip-build-env-kijlmn05\overlay\Lib\site-packages\cppyy_backend\include -IC:\Users\tumanov\AppData\Local\Programs\Python\Python311\include -IC:\Users\tumanov\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc\clingwrapper.cxx /Fobuild\temp.win32-cpython-311\Release\src\clingwrapper.obj -O2 -Zc:__cplusplus /std:c++latest /GR /EHsc- /MD cl: Є®¬ ¤ п бва®Є warning D9025: ЇҐаҐ®ЇаҐ¤Ґ«ҐЁҐ "/EHc" "/EHc-" clingwrapper.cxx now building libcppyy_backend.dll creating C:\TEMP\pip-install-hzqqolkh\cppyy-backend_05bfc0ed0867423aa35acf6f0f653bac\build\lib.win32-cpython-311 creating C:\TEMP\pip-install-hzqqolkh\cppyy-backend_05bfc0ed0867423aa35acf6f0f653bac\build\lib.win32-cpython-311\cppyy_backend creating C:\TEMP\pip-install-hzqqolkh\cppyy-backend_05bfc0ed0867423aa35acf6f0f653bac\build\lib.win32-cpython-311\cppyy_backend\lib "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\TEMP\pip-build-env-kijlmn05\overlay\Lib\site-packages\cppyy_backend\lib /LIBPATH:C:\Users\tumanov\AppData\Local\Programs\Python\Python311\libs /LIBPATH:C:\Users\tumanov\AppData\Local\Programs\Python\Python311 /LIBPATH:C:\Users\tumanov\AppData\Local\Programs\Python\Python311\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86" libCoreLegacy.lib libThreadLegacy.lib libRIOLegacy.lib libCling.lib build\temp.win32-cpython-311\Release\src\clingwrapper.obj /OUT:build\lib.win32-cpython-311\cppyy_backend\lib\libcppyy_backend.dll /IMPLIB:build\lib.win32-cpython-311\cppyy_backend\lib\libcppyy_backend.lib /EXPORT:?__type_info_root_node@@3U__type_info_node@@A ‘®§¤ Ґвбп ЎЁЎ«Ё®вҐЄ build\lib.win32-cpython-311\cppyy_backend\lib\libcppyy_backend.lib Ё ®ЎкҐЄв build\lib.win32-cpython-311\cppyy_backend\lib\libcppyy_backend.exp clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "__declspec(dllimport) class CppyyLegacy::TInterpreter * gCling" (__imp_?gCling@@3PAVTInterpreter@CppyyLegacy@@A). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "__declspec(dllimport) class CppyyLegacy::TSystem * gSystem" (__imp_?gSystem@@3PAVTSystem@CppyyLegacy@@A). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "__declspec(dllimport) struct CppyyLegacy::ExceptionContext_t * gException" (__imp_?gException@@3PAUExceptionContext_t@CppyyLegacy@@A). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TDictionary * __thiscall CppyyLegacy::TListOfDataMembers::Get(class CppyyLegacy::DataMemberInfo_t *,bool)" (?Get@TListOfDataMembers@CppyyLegacy@@QAEPAVTDictionary@2@PAVDataMemberInfo_t@2@_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: static bool __cdecl CppyyLegacy::TROOT::Initialized(void)" (?Initialized@TROOT@CppyyLegacy@@SA_NXZ). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TFunction * __thiscall CppyyLegacy::TROOT::GetGlobalFunctionWithPrototype(char const *,char const *,bool)" (?GetGlobalFunctionWithPrototype@TROOT@CppyyLegacy@@QAEPAVTFunction@2@PBD0_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TFunctionTemplate * __thiscall CppyyLegacy::TROOT::GetFunctionTemplate(char const *)" (?GetFunctionTemplate@TROOT@CppyyLegacy@@QAEPAVTFunctionTemplate@2@PBD@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TDataType * __thiscall CppyyLegacy::TROOT::GetType(char const *,bool)const " (?GetType@TROOT@CppyyLegacy@@QBEPAVTDataType@2@PBD_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TCollection * __thiscall CppyyLegacy::TROOT::GetListOfFunctionTemplates(void)" (?GetListOfFunctionTemplates@TROOT@CppyyLegacy@@QAEPAVTCollection@2@XZ). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TCollection * __thiscall CppyyLegacy::TROOT::GetListOfEnums(bool)" (?GetListOfEnums@TROOT@CppyyLegacy@@QAEPAVTCollection@2@_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TCollection * __thiscall CppyyLegacy::TROOT::GetListOfGlobalFunctions(bool)" (?GetListOfGlobalFunctions@TROOT@CppyyLegacy@@QAEPAVTCollection@2@_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TCollection * __thiscall CppyyLegacy::TROOT::GetListOfGlobals(bool)" (?GetListOfGlobals@TROOT@CppyyLegacy@@QAEPAVTCollection@2@_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TCollection * __thiscall CppyyLegacy::TROOT::GetListOfTypes(bool)" (?GetListOfTypes@TROOT@CppyyLegacy@@QAEPAVTCollection@2@_N@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "void __cdecl CppyyLegacy::Class_ShowMembers(class CppyyLegacy::TClass *,void const *,class CppyyLegacy::TMemberInspector &)" (?Class_ShowMembers@CppyyLegacy@@YAXPAVTClass@1@PBXAAVTMemberInspector@1@@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "__declspec(dllimport) int CppyyLegacy::gErrorIgnoreLevel" (__imp_?gErrorIgnoreLevel@CppyyLegacy@@3HA). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: virtual void __thiscall CppyyLegacy::TIter::Streamer(class CppyyLegacy::TBuffer &)" (?Streamer@TIter@CppyyLegacy@@UAEXAAVTBuffer@2@@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: static class CppyyLegacy::TClass * __cdecl CppyyLegacy::TIter::Class(void)" (?Class@TIter@CppyyLegacy@@SAPAVTClass@2@XZ). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: static void __cdecl CppyyLegacy::TObject::operator delete(void *)" (??3TObject@CppyyLegacy@@SAXPAX@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: static void * __cdecl CppyyLegacy::TStorage::ObjectAlloc(unsigned int)" (?ObjectAlloc@TStorage@CppyyLegacy@@SAPAXI@Z). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: static void __cdecl CppyyLegacy::TThread::Initialize(void)" (?Initialize@TThread@CppyyLegacy@@SAXXZ). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class CppyyLegacy::TypeInfo_t * __thiscall CppyyLegacy::TMethodArg::GetTypeInfo(void)const " (?GetTypeInfo@TMethodArg@CppyyLegacy@@QBEPAVTypeInfo_t@2@XZ). clingwrapper.obj : error LNK2001: Ґа §аҐиҐл© ўҐиЁ© бЁ¬ў®« "public: class std::basic_string