# ROOT on Windows 11

**URL:** <https://root-forum.cern.ch/t/root-on-windows-11/62429>\
**Category:** ROOT\
**Tags:** root\
**Created:** [December 10, 2024, 12:23pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429 "2024-12-10T12:23:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 10, 2024, 12:23pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/1 "2024-12-10T12:23:15Z")

</div>

Hello,

I need a robust ROOT installation under Windows 11 using VS2022 and powershell.

This used to be possible with precompiled binaries for ROOT5 under Windows 10 with VS2010.

It is no longer possible (Win11, VS2022, ROOT6), because:  
1.) The precompiled binaries crash;  
2.) Multiple errors occur when installing from source;

My office at CERN is 3/1-066 in case someone from the root team would be kind enough to install it for me. I have a workstation Dell Precision 5820.

Many thanks in advance!  
Deyan

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 10, 2024, 12:25pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/2 "2024-12-10T12:25:52Z")

</div>

Welcome to the ROOT Forum!

> [@yordanov](#):
>
> The precompiled binaries crash;

How does it crashes? How/where did you install ROOT? What exact version (which file did you download)? How do you start ROOT?

---

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 10, 2024, 1:35pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/3 "2024-12-10T13:35:30Z")

</div>

1.) i just now re-installed:  
root\_v6.30.06.win64.vc17.exe (127Mb)

2.) and I have:  
Microsoft Visual Studio Community 2022  
Version 17.7.6  
VisualStudio.17.Release/17.7.6+34221.43  
Microsoft .NET Framework  
Version 4.8.09032

Now I get the error message at the start:  
PS D:\> root  
Assertion failed: !(isOverridden && isOutOfDate) && “an overridden cannot be out-of-date”, file C:\ROOT-CI\src\interpreter\llvm-project\clang\include\clang/Serialization/ModuleFile.h, line 78

This is strange, because it used to work. Anyway, problems. Pls, tell me which version to install how, etc. I want:  
a) Win 11 64 bit  
b) VC17  
c) powershell integration  
d) no pyton, cmake, etc.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 10, 2024, 1:57pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/4 "2024-12-10T13:57:03Z")

</div>

I just downloaded `root_v6.32.08.win64.vc17.zip`, on my Windows 11 desktop, unzipped it in `C:\root`, then started a `Developer PowerShell for VS 2022`, and then, from there:

```auto
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.12.1
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
PS C:\Program Files\Microsoft Visual Studio\2022\Community> cd ~
PS C:\Users\bellenot> C:\root\bin\thisroot.ps1
PS C:\Users\bellenot> root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.32.08 https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win64 on Nov 14 2024, 09:53:39 |
  | From tags/v6-32-08@v6-32-08 |
  | With MSVC 19.39.33521.0 |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0]

```

---

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 10, 2024, 11:48pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/5 "2024-12-10T23:48:52Z")

</div>

Thanks!

1.) Could you, please, run the example below with “.x test.cpp” twice. The second time it fails.  
2.) Could you compile it with “.x test.cpp++”. It returns an error.

My experience is with older versions of root. Never had the above problems.

I am used to running heavy scripts, which have to be compiled, otherwise they take long. The interpreter is not an option for those.

Here is my example “test.cpp”

```auto
#include "iostream"
using namespace std;
void test()
{ cout<<"blabla"<<endl;}

```

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 11, 2024, 7:48am UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/6 "2024-12-11T07:48:24Z")

</div>

> [@yordanov](#):
>
> 1. The second time it fails.

Right, there are still issues with unloading…

> [@yordanov](#):
>
> 2.) Could you compile it with “.x test.cpp++”. It returns an error.

```cmd
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.12.1
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
PS C:\Program Files\Microsoft Visual Studio\2022\Community> cd C:\root-dev\
PS C:\root-dev> C:\root\bin\thisroot.ps1
PS C:\root-dev> root -l test.cpp++
root [0]
Processing test.cpp++...
Info in <TWinNTSystem::ACLiC>: creating shared library C:/root-dev/test_cpp.dll
test_cpp_ACLiC_dict.cxx
   Creating library C:/root-dev\test_cpp.lib and object C:/root-dev\test_cpp.exp
test_cpp_ACLiC_dict.cxx
   Creating library C:/root-dev\test_cpp.lib and object C:/root-dev\test_cpp.exp
blabla
root [1]

```

---

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 11, 2024, 12:46pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/7 "2024-12-11T12:46:00Z")

</div>

It does not compile for me.

 ![Screenshot 2024-12-11 134106](https://root-forum.cern.ch/uploads/default/original/3X/8/e/8ea2fb0f3d08a0cfdecdddff46b2a59ce5df8b91.png)

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 11, 2024, 12:49pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/8 "2024-12-11T12:49:42Z")

</div>

As the error message it telling, you build fox x86 architecture while ROOT has been built for x64. Please start a x64 PowerShell (make sure the `DevCmdArguments` are `-arch=x64 -host_arch=x64`)

---

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 12, 2024, 11:54am UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/9 "2024-12-12T11:54:02Z")

</div>

It seems the only PS installed by visual studio is not 64bit.  
1.) Can you, please, give me the exact syntaxis to set the DevCmdArguments?  
2.) Or, would you recommend I download the 32bit binaries of root?

 ![Screenshot 2024-12-12 124807](https://root-forum.cern.ch/uploads/default/original/3X/f/7/f7f1ce2fd33ab56503df82498a27130f5215814e.jpeg)

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 12, 2024, 11:59am UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/10 "2024-12-12T11:59:08Z")

</div>

Do you really need PowerShell? Can you try first with a `x64 Native Tools Command Prompt for VS 2022`? I personally use a `Windows Terminal (Version: 1.21.3231.0)` from where you can invoke several command prompts and PowerShell

---

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 12, 2024, 12:18pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/11 "2024-12-12T12:18:02Z")

</div>

I am not IT, so my knowledge is basic. Yes, I prefer powershell, but cmd might be ok.

1.) Can’t setup the environment variables in cmd, which in powershell is done with: “C:\root\bin\thisroot.ps1”. Should I use the installation package instead?

2.) In the past I had a PS profile which setup VS for use in the powershell, and I used the installation package to set the variables for root. Can you provide a powershell profile that does both? Here is roughly (some folder names are guessed) what I had in the past, but I did not write it myself, so I hardly understand it.

```auto
## Aliases.ps1 -- to be dot-sourced from your profile
if($Host.Version.Major -ge 2) {
   function script:Resolve-Aliases
   {
      param($line)

      [System.Management.Automation.PSParser]::Tokenize($line,[ref]$null) | % {
         if($_.Type -eq "Command") {
            if($cmd.CommandType -eq "Alias") {
               $line = $line.Remove( $_.StartColumn -1, $_.Length ).Insert( $_.StartColumn -1, $cmd.Definition )
            }
         }
      }
      $line
   }
}

function alias {
   # pull together all the args and then split on =
   $alias,$cmd = [string]::join(" ",$args).split("=",2) | % { $_.trim()}

   if($Host.Version.Major -ge 2) {
      $cmd = Resolve-Aliases $cmd
   }
   New-Item -Path function: -Name "Global:Alias$Alias" -Options "AllScope" -Value @"
Invoke-Expression '$cmd `$args'
###ALIAS###
"@

   Set-Alias -Name $Alias -Value "Alias$Alias" -Description "A UNIX-style alias using functions" -Option "AllScope" -scope Global -passThru
}

function unalias([string]$Alias,[switch]$Force){
   if( (Get-Alias $Alias).Description -eq "A UNIX-style alias using functions" ) {
      Remove-Item "function:Alias$Alias" -Force:$Force
      Remove-Item "alias:$alias" -Force:$Force
      if($?) {
         "Removed alias '$Alias' and accompanying function"
      }
   } else {
      Remove-Item "alias:$alias" -Force:$Force
      if($?) {
         "Removed alias '$Alias'"
      }
   }
}

alias rt='root -l'
alias rq='root -l -q'

pushd "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools"
cmd /c "VsDevCmd.bat&set" |
foreach {
  if ($_ -match "=") {
    $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
  }
}
popd
#Write-Host "`nVisual Studio 2022 Command Prompt variables set." -ForegroundColor Yellow

```

D:

cls

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 12, 2024, 12:22pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/12 "2024-12-12T12:22:13Z")

</div>

> [@yordanov](#):
>
> 1.) Can’t setup the environment variables in cmd, which in powershell is done with: “C:\root\bin\thisroot.ps1”. Should I use the installation package instead?

In the command prompt you have to call `C:\root\bin\thisroot.bat`  
Then if you really want PowerShell, here is the command used in my Windows terminal:

```auto
powershell.exe -NoExit -Command "&{Import-Module """C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell 095cf59e -SkipAutomaticLocation -DevCmdArguments """-arch=x64 -host_arch=x64"""}"

```

---

<div class="post-metadata">

**Author:** ![yordanov](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/2bfe46/32.png) [@yordanov](https://root-forum.cern.ch/u/yordanov)\
**Post date:** [December 12, 2024, 1:09pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/13 "2024-12-12T13:09:26Z")

</div>

Thanks. The simple example compiles in cmd. Older files which ran fine in root 5, however, do not. I will dig into this separately.

Thank you for your time. Feel free to close the topic.  
, Deyan

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [December 12, 2024, 1:11pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/14 "2024-12-12T13:11:22Z")

</div>

OK, thanks for the feedback

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 26, 2024, 1:11pm UTC](https://root-forum.cern.ch/t/root-on-windows-11/62429/15 "2024-12-26T13:11:54Z")

</div>

Closed on December 26, 2024, 1:11pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
