Migrating from ROOT 5 to ROOT 6 in Windows 10

Dear all,

This is my first root (and not newbie) post, so I hope its on the correct category. I migrated from root 5.32.36 to the production version root 6.14.06 in windows 10 unsung MSVS 2017 and rebuilding root from scratch. Now, reading through past posts on the forum I managed to find a setup of versions for visual studio and cmake that would allow to do the configuration and compilation of root without errors (in spite of around 300 warnings). Here are the details of the setup that worked:

Microsoft Visual Studio Community 2017 15.7.6
CMake 3.7.2
FFTW 3.3.5

and the cmake commands for configuration and compilation:

cmake -G"Visual Studio 15 2017" -Dall=OFF -Dmathmore=OFF -Dbuiltin_zlib=ON -Dgfal=OFF -Dbuiltin_freetype=ON -Dbuiltin_ftgl=ON -Droofit=ON -Dfftw3=ON -DFFTW_INCLUDE_DIR=C:/root/fftw-3.3.5-dll32 -DFFTW_LIBRARY=C:/root/fftw-3.3.5-dll32/libfftw3-3.lib C:\root\Source\v6.14.06

cmake --build . --config Release -- /maxcpucount

Please note than this is the only setup I managed to get working (previous MSVS 2017 would not compile and previous or later cmake version would not configure).

Anyway, trying to compile now same code that was running perfectly in root 5 I get the following error:

C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0
Error in <ACLiC>: Compilation failed!

Went a bit rough the Microsoft knowledge base and this seems to be related to the linker trying to get the dll file instead of the lib file, or more specifically someone having specified the extension for the linker instead of just KERNEL32. That been said, I do not know where exactly I need to correct that, especially since I did not make my code as a visual studio project.
Any input would be great!!!

Thanks a lot,

Vagelis


_ROOT Version: 6.14.06
_Platform: Windows 10
_Compiler: VC++ 15


@bellenot could you have a look, please?

Can you post the complete output of the compilation?

Hi and thanks for the quick response!
I guess you want the output of the root built. I am attaching the cmake error and output log files (converted the extensions to txt since the forum does not allow log files to be uploaded). Let me know if this is not what you meant.

CMakeError.txt (218.5 KB)
CMakeOutput.txt (82.2 KB)

Well, you said the compilation of ROOT was successful, right? Then I need the complete output of the compilation of the code that was running perfectly in root 5

Yes, I figured there would be a misunderstanding there, i guess it probably my fault. I am compiling on run time through a stearing macro using ACLIC passing these commands:

gInterpreter->Reset(); // Reset Root
gInterpreter->AddIncludePath(“C:/Users/Luminociter/Desktop/HGTDUtils/”);
gInterpreter->LoadMacro(“C:/Users/Luminociter/Desktop/HGTDUtils/Root/HGTDUtils.cxx+”);

The only output i get is:

Info in <TWinNTSystem::ACLiC>: creating shared library C:/Users/Luminociter/Desktop/HGTDUtils/Root/HGTDUtils_cxx.dll
HGTDUtils_cxx_ACLiC_dict.cxx
   Création de la bibliothèque C:/Users/Luminociter/Desktop/HGTDUtils/Root\HGTDUtils_cxx.lib et de l'objet C:/Users/Luminociter/Desktop/HGTDUtils/Root\HGTDUtils_cxx.exp
C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0
Error in <ACLiC>: Compilation failed!

I can nevertheless attach the intermediate objects ACLIC is generating if they are of any help.
Thanks!

OK, I’ll try. In the mean time, could you try to simply use ACLiC from the ROOT command prompt, something like:

root[0] .L HGTDUtils.cxx++

And let me know if you have the same issue

Same issue, no difference. Even more peculiar, if I write all the commands in a small steering macro that i made to compile my code while developing, it seems to ignore everything above line 13. Is it proof reading before executing at root 6?
(I attach the macroRun.C (2.0 KB)
)

I cannot reproduce the error when compiling a macro with gInterpreter->LoadMacro. Can you try with another macro (e.g. one from the tutorials) to see if the error is always there?

I tried with the FFT.C macro from the tutorials/fft folder and the issue persists. I guess this is a setup issue and not a root 5 to root 6 specific issue. Is there a way to back trace if there was an issue with the build?
Thanks,
Vagelis

Well, you can try to set the gDebug variable to something greater than zero to see if you have some useful printout, but I don’t think it will be useful if the issue is coming from your environment… Do you run from a x86 Native Tools Command Prompt for VS 2017?

Yes I do, i tried the gDebug method and this is a printout for the FFT macro:

root [0] gDebug=1
(int) 1
root [1] .L C:/root/tutorials/fft/FFT.c+
Info in TWinNTSystem::ACLiC: creating shared library C:/root/tutorials/fft/FFT_c.dll
Info in TWinNTSystem::Load: loaded library C:\root\bin\libHist.dll, status 0
Info in TWinNTSystem::Load: loaded library C:\root\bin\libGpad.dll, status 0
FFT_c_ACLiC_dict.cxx
Création de la bibliothèque C:/root/tutorials/fft\FFT_c.lib et de l’objet C:/root/tutorials/fft\FFT_c.exp
C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0
Error in : Compilation failed!
Info in TPluginManager::LoadHandlerMacros: C:\root\etc\plugins\TVirtualPad
Info in TPluginManager::FindHandler: found plugin for TPad
Info in TPluginManager::LoadHandlerMacros: C:\root\etc\plugins\TVirtualX
Info in TPluginManager::FindHandler: found plugin for TGWin32
Info in TWinNTSystem::Load: loaded library C:\root\bin\libWin32gdk.dll, status 0
Info in TInterpreter::TCling::AutoLoad: loaded library libWin32gdk.dll for TGWin32
Info in TPluginManager::LoadHandlerMacros: C:\root\etc\plugins\TGuiFactory
Info in TPluginManager::FindHandler: found plugin for TRootGuiFactory
Info in TWinNTSystem::Load: loaded library C:\root\bin\libGui.dll, status 0
Info in TInterpreter::TCling::AutoLoad: loaded library libGui.dll for TRootGuiFactory

It does not seem to show where things go wring…

OK, trying to figure out where this could be coming from… Can you check the value of MAKESHAREDLIB in the %ROOTSYS%\include\compiledata.h header?

#define MAKESHAREDLIB “cl $Opt -nologo -TP -c -nologo -IC:/root/Source/v6.14.06/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EHsc- -W3 -wd4141 -wd4291 -wd4244 -wd4049 -D_WIN32 -D_XKEYCHECK_H -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -std=c++14 $IncludePath $SourceFiles -Fo$ObjectFiles && bindexplib $LibName $ObjectFiles > $BuildDir\$LibName.def && lib -nologo -MACHINE:IX86 -out:$BuildDir\$LibName.lib $ObjectFiles -def:$BuildDir\$LibName.def && link -nologo $ObjectFiles -DLL -out:$BuildDir\$LibName.dll $BuildDir\$LibName.exp -LIBPATH:%ROOTSYS%\lib $LinkedLibs libCore.lib kernel32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib && if EXIST “$BuildDir\$LibName.dll.manifest” ( mt -nologo -manifest “$BuildDir\$LibName.dll.manifest” “-outputresource:$BuildDir\$LibName.dll;2” && del “$BuildDir\$LibName.dll.manifest” )”

OK, this looks OK, there is no KERNEL32.DLL in the list. So I have no idea where this could come from…

The only reference of a kernel32.dll in root source files is at TWinNTSystem.cxx line 1512, if this is of any help…
Ah, there is also a reference at RWMutex.inc at \interpreter\llvm\src\lib\Support\Windows\ line 50, and this is only in root 6, none of the previous version i checked…

Well, there are several, but AFAICS they are not related to ACLiC…

OK just some later news after a bit of hassling around…
I re-compiled root 6 from scratch with the latest CMake distribution and VS 2017 but the same problem remains. Then I uninstalled everything and tried one of the compiled binaries for windows from the webpage, and I still experience the same issue.
Then i reinstalled root 5 (with VS2017 I might add) which works without any problem!
This is specific to root 6, so there is an issue somewhere and is probably not related to my system. The only reason i need root 6 is because i need fftw and root 5 will not compile from source with my configuration correctly no matter how many different versions of cmake and vs studio i try.

FYI, ROOT 5 only compiles with at most VS 2013. Any more recent version is not supported.

BTW, you can also compile your code in the command line…