Update Win11 Installation authored by Igor Semeniouk's avatar Igor Semeniouk
# Geant4 Installation on Windows 11
<!--
For Geant4 version 11.2.0 you can also apply pathch win.path
which you can found in installg4/install/MSVC/ directory.
-->
[[_TOC_]]
Hire the instructions for native Geant4 installation with the Visual Studio C++ compiler on Windows.
......@@ -10,7 +14,7 @@ Hire the instructions for native Geant4 installation with the Visual Studio C++
* Windows 10 or 11
* Microsoft Visual Studio C++ compiler
The installation tested with Windows 11 MSVC 2022 (v17.9)
The installation tested with Windows 11 MSVC 2022 (v17.13.5) and Qt 5.12.2
## Development Environment
......@@ -80,11 +84,11 @@ Visual Studio.
I use following commands:
```
7z x xerces-c-3.2.5.zip
7z x xerces-c-3.2.3.zip
mkdir xerces-c-build
cd xerces-c-build
cmake -DCMAKE_INSTALL_PREFIX=D:\Xerces-C ..\xerces-c-3.2.5
cmake -DCMAKE_INSTALL_PREFIX=D:\Xerces-C ..\xerces-c-3.2.3
cmake --build . --config RelWithDebInfo --parallel
ctest -V -C RelWithDebInfo -j 4
cmake --build . --config RelWithDebInfo --parallel --target install
......@@ -138,7 +142,7 @@ TODO
Download desired root version from http://root.cern.ch:
```
curl -SLO https://root.cern/download/root_v6.30.04.win64.vc17.zip
curl -SLO https://root.cern/download/root_v6.34.06.win64.python311.vc17.relwithdebinfo.zip
```
i download zip, but you can use installer version.
......@@ -146,10 +150,10 @@ To unpack you mast have zip or 7zip packages installed, using 7zip :
```
cd /d D:\
7z x <path_to_zip>\root_v6.30.04.win64.vc17.zip
7z x <path_to_zip>\root_v6.34.06.win64.python311.vc17.relwithdebinfo.zip
```
This will install 64 bit root version 6.28/02 to D:\root directory. But you can use any directory which you prefer. ROOT is installed in _relocatable_ mode.
This will install 64 bit root version 6.34/06 to D:\root directory. But you can use any directory which you prefer. ROOT is installed in _relocatable_ mode.
To use ROOT, you must set its environment sourcing the *thisroot.bat* script from
the ROOT installation directory:
......@@ -159,9 +163,9 @@ Visit http://root.cern.ch for more information about ROOT.
### Installing Geant4
You can download geant v11.2.1 installer ( or .zip file ) for Windows 10 , 64 bit compiled using Visual Studio 2022 from geant4 download page:
You can download geant v11.3.1 installer ( or .zip file ) for Windows 10 , 64 bit compiled using Visual Studio 2022 from geant4 download page:
https://geant4.web.cern.ch/support/download
https://geant4.web.cern.ch/download/11.3.1.html
### Build Geant4 locally
......@@ -178,13 +182,13 @@ You can use script *setup_env.bat* from `setup\MSVC` to setup compiler and qt in
```
git clone ssh://git@gitlab.cern.ch:7999/geant4/geant4.git
cd geant4
git checkout v11.2.1
git checkout v11.1.1
mkdir g11.2.1-build
cd ..\g11.2.1-build
mkdir g11.1.1-build
cd ..\g11.1.1-build
cmake -DCMAKE_PREFIX_PATH=D:\Xerces-C ^
-DCMAKE_INSTALL_PREFIX=D:\Geant4\11.2.1 ^
-DCMAKE_INSTALL_PREFIX=D:\Geant4\11.1.1 ^
-DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_WIN32=ON ^
-DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON ..\geant4
......@@ -195,7 +199,7 @@ cmake --build . --config RelWithDebInfo --target install --parallel 6
### 1. Open new DOS Prompt window
- You can use "x86 Native Tools Command Prompt for VS 2022" and setup Qt
- You can use "x86 Native Tools Command Promt for VS 2022" and setup Qt
environment via command `call <QT_INSTALL_DIR\msvc2019_64\bin\qtenv2.bat`
### 2. Setup environment
......@@ -222,17 +226,17 @@ You will see the output like this:
```
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.39.33519.0
-- The CXX compiler identification is MSVC 19.39.33519.0
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.35.32217.1
-- The CXX compiler identification is MSVC 19.35.32217.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
......@@ -242,21 +246,20 @@ You will see the output like this:
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Found XercesC: D:/Xerces-C/lib/xerces-c_3.lib (found suitable version "3.2.5", minimum required is "3.2.5")
-- Found XercesC: D:/Xerces-C/lib/xerces-c_3.lib (found suitable version "3.2.3", minimum required is "3.2.3")
-- Found OpenGL: opengl32
-- Found Geant4: D:/Geant4/11.2.1/lib/cmake/Geant4/Geant4Config.cmake (found version "11.2.1")
-- Configuring done (11.6s)
-- Generating done (0.3s)
-- Build files have been written to: D:/workspace/installg4/install/MSVC/B1-Build
-- Found Geant4: D:/Geant4/11.1.1/lib/cmake/Geant4/Geant4Config.cmake (found version "11.1.1")
-- Configuring done
-- Generating done
-- Build files have been written to: D:/workspace/GEANT4/B1-build
```
Now we can build and run example.
The build step:
```cmake --build . --config RelWithDebInfo --parallel 8```
```cmake --build . --config RelWithDebInfo --parallel 4```
To run example use command:
To run exaple use command:
```RelWithDebInfo\exampleB1.exe run1.mac```
......@@ -265,7 +268,7 @@ You will see the output like below:
```
**************************************************************
Geant4 version Name: geant4-11-02-patch-01 [MT] (16-February-2024)
Geant4 version Name: geant4-11-01-ref-04 [MT] (30-April-2023)
<< in Multi-threaded mode >>
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
......@@ -273,7 +276,6 @@ You will see the output like below:
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/
**************************************************************
...
<snip>
...
......@@ -305,12 +307,12 @@ http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/h
### 4. Test ROOT Installation
Example of root v6.30/04.
Example of root v6.26/02.
Setup root environment if not yet done:
```
workspace> call d:\root\bin\thisroot.bat
D:\workspace>call d:\root\bin\thisroot.bat
```
Start the ROOT interactive session:
......@@ -318,12 +320,12 @@ Start the ROOT interactive session:
```
D:\workspace>root
------------------------------------------------------------------
| Welcome to ROOT 6.30/04 https://root.cern |
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for win64 on Jan 31 2024, 09:17:16 |
| From heads/master@tags/v6-30-04 |
| With MSVC 19.32.31332.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
| Welcome to ROOT 6.26/02 https://root.cern |
| (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for win64 on Apr 12 2022, 16:28:03 |
| From tags/v6-26-02@v6-26-02 |
| With MSVC 19.31.31104.0 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0]
......@@ -368,3 +370,7 @@ solution was tested.
- use busybox installed with his aliases, i use `scoop install busybox`
to install the busybox.
- The md5sum command from busybox not support *--tag* option. To allow
geant4-config --install-datasets work correctly you need to install
openssl for windows f.e. `scoop install openssl`.