# Geant4 installation options on Windows

**URL:** <https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802>\
**Category:** Getting Started\
**Created:** [March 30, 2021, 10:40am UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802 "2021-03-30T10:40:53Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![faca87](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@faca87](https://geant4-forum.web.cern.ch/u/faca87)\
**Post date:** [March 30, 2021, 10:40am UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/1 "2021-03-30T10:40:53Z")

</div>

Hello, I had to format my computer so I’ve to installa Geant4 again.  
To use an application that one researcher gave me to modify, I need

1. HepMC (I’ve to try to solve the problem explained here [Problem in building - #4 by faca87](https://geant4-forum.web.cern.ch/t/problem-in-building/4751/4)
2. He said me to set  
`-DGEANT4_USE_GDML=ON -DGEANT4_BUILD_MULTITHREADED=ON -DWITH_GEANT4_UIVIS=ON`

I looked here [Building and Installing from Source — Geant4 Installation Guide 10.7 documentation](https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/installguide.html)

a. -DGEANT4\_USE\_GDML=ON it looks like that I don’t need special path for it, true?  
b. GEANT4\_BUILD\_MULTITHREADED it says

> At present, this is only supported on Unix systems.

so, isn’t it possible to use it on Windows machine? (Windows isn’t UNIX based)

c. -DWITH\_GEANT4\_UIVIS I can’t find nothing about it…but, is it for the visualization? So can I replace it by using QT?

@bmorgan maybe you can help me…

Thank you

---

<div class="post-metadata">

**Author:** ![weller](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/weller/32/3357_2.png) [@weller](https://geant4-forum.web.cern.ch/u/weller)\
**Post date:** [March 30, 2021, 11:42am UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/2 "2021-03-30T11:42:40Z")

</div>

for GDML, you need xerces-c. this is how I did this:

```
##GMDL support
https://xerces.apache.org/xerces-c/download.cgi
extract, e.g., to C:\Users\wel\Geant4\xerces-c-3.2.3-source
create build folder: C:\Users\wel\Geant4\xerces-c-3.2.3-build
#open powershell
cmake -DCMAKE_INSTALL_PREFIX=C:\Users\wel\Geant4\xerces-c\xerces-c-3.2.3 C:\Users\wel\Geant4\xerces-c\xerces-c-3.2.3-source
cmake --build . --config Release
cmake --build . --config Release --target install

```

to build geant, I did this:

```
cd C:\Users\wel\Geant4\geant4_10_07-build
cmake -DCMAKE_INSTALL_PREFIX=C:\Users\wel\Geant4\geant4_10_07 -DGEANT4_BUILD_MULTITHREADED=ON -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019_64;C:\Users\wel\Geant4\xerces-c\xerces-c-3.2.3" -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_DATA=OFF -DGEANT4_BUILD_MSVC_MP=ON -DGEANT4_INSTALL_DATADIR="C:\Users\wel\Geant4\data" C:\Users\wel\Geant4\geant4_10_07_files\geant4_10_07-source
cmake --build . --config Release
cmake --build . --config Release --target install

```

of course, adapt paths and make sure you have installed Qt 🙂

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [March 30, 2021, 12:01pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/3 "2021-03-30T12:01:08Z")

</div>

> [@faca87](#):
>
> b. GEANT4\_BUILD\_MULTITHREADED it says
> 
> > At present, this is only supported on Unix systems.
> 
> so, isn’t it possible to use it on Windows machine? (Windows isn’t UNIX based)

That’s an oversight in the docs (which we’ll fix), MT should work on Windows from 10.7, so fine to enable it.

---

<div class="post-metadata">

**Author:** ![faca87](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@faca87](https://geant4-forum.web.cern.ch/u/faca87)\
**Post date:** [March 30, 2021, 12:25pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/4 "2021-03-30T12:25:49Z")

</div>

Thank you the both @weller and @bmorgan currently I’m installing QT …then I will try!

@weller then, did you install xerces before to install geant, true?  
Thank you

---

<div class="post-metadata">

**Author:** ![weller](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/weller/32/3357_2.png) [@weller](https://geant4-forum.web.cern.ch/u/weller)\
**Post date:** [March 30, 2021, 12:34pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/5 "2021-03-30T12:34:57Z")

</div>

> [@faca87](#):
>
> then, did you install xerces before to install geant, true?

this is correct. also, don’t be afraid to try things out and learn from experience 🙂

---

<div class="post-metadata">

**Author:** ![faca87](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@faca87](https://geant4-forum.web.cern.ch/u/faca87)\
**Post date:** [March 30, 2021, 1:55pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/7 "2021-03-30T13:55:20Z")

</div>

@weller thank you! I installed xerces!

@bmorgan I was installing HepMC using ROOTIO, but I had a problem due to compatibility between ROOT (installed by binary) and visual studio. In the ROOT forum, said me to install ROOT from the master …so now I’m trying to install ROOT from the master (using the sources)…

Anyway, I’m installing QT but it’s long time that I read

 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/6/6c5bfa7d7ca64bfa8102152f12fe4c4c03f0d157.jpeg)

looking on internet, I see maybe there is a bug on conan

> <https://github.com/conan-io/conan/issues/7181>
>
> I am running Conan in a docker container, and while a package is installing, if I docker stop the container that...

so can I install QT without conan to use QT in geant4? @weller, did you select conan during QT installation?

Last question  
`-DWITH_GEANT4_UIVIS` I can’t find nothing about it…but, is it for the visualization? So can I replace it by using QT?

---

<div class="post-metadata">

**Author:** ![weller](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/weller/32/3357_2.png) [@weller](https://geant4-forum.web.cern.ch/u/weller)\
**Post date:** [March 30, 2021, 2:15pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/8 "2021-03-30T14:15:57Z")

</div>

when I did the install, version 6 was not yet available. I would install without, and see if things work afterwards, and if they dont: reinstall and try again 😉

---

<div class="post-metadata">

**Author:** ![faca87](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@faca87](https://geant4-forum.web.cern.ch/u/faca87)\
**Post date:** [March 30, 2021, 2:44pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/9 "2021-03-30T14:44:26Z")

</div>

Thank you @weller

I selected all this

 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/1/11224a06be3e96dcd0c184431b93bcbe45b4ecc4.jpeg)  
 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/f/f902558351b1a1e8998013482008dcee847457af.png)  
 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/e/ea4409cfe50991c56c1c7e5da2080820e1007cc9.jpeg)  
 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/f/f2f05dda32c7bf893bca281ae41a259a6eba34c8.jpeg)  
I hope it is enough…  
I was looking my old installation of QT (QT6 yet)  
[Use QT with Geant in Windows - #7 by faca87](https://geant4-forum.web.cern.ch/t/use-qt-with-geant-in-windows/3921/7) there wans’t the conan option…

---

<div class="post-metadata">

**Author:** ![weller](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/weller/32/3357_2.png) [@weller](https://geant4-forum.web.cern.ch/u/weller)\
**Post date:** [March 30, 2021, 2:54pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/10 "2021-03-30T14:54:11Z")

</div>

I just selected MSVC 2019 64-bit, sources and Qt Debug Information Files, and the Qt Creator, and I use Qt Creator to code and compile (probably thereby using MSVC)

---

<div class="post-metadata">

**Author:** ![faca87](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@faca87](https://geant4-forum.web.cern.ch/u/faca87)\
**Post date:** [March 30, 2021, 3:21pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/11 "2021-03-30T15:21:39Z")

</div>

Thank you @weller then…do you think this is enogh

 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/b/bea6e77bc4b07a504025033e2e0785cad8f10fff.jpeg)

?

---

<div class="post-metadata">

**Author:** ![allison](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/a/90db22/32.png) [@allison](https://geant4-forum.web.cern.ch/u/allison)\
**Post date:** [March 30, 2021, 4:10pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/12 "2021-03-30T16:10:27Z")

</div>

Hi Fausto

> [@faca87](#):
>
> Last question  
> `-DWITH_GEANT4_UIVIS` I can’t find nothing about it…but, is it for the visualization? So can I replace it by using QT?

There is no such option. It will simply say “option not used” or some such.

The Installation Guide lists the meaningful options. I don’t use Windows myself but I believe Windows has OpenGL already installed, so you can build with `-DGEANT4_USE_OPENGL_WIN32=ON` and you should get something when you run, say, `exampleB1`.

As for Qt, yes, great, but we have not yet built with Qt6. Please try it, but if it does work please build against the latest version of Qt5.

John

---

<div class="post-metadata">

**Author:** ![allison](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/a/90db22/32.png) [@allison](https://geant4-forum.web.cern.ch/u/allison)\
**Post date:** [March 30, 2021, 4:11pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/13 "2021-03-30T16:11:07Z")

</div>

“does” should read “doesn’t”.

---

<div class="post-metadata">

**Author:** ![faca87](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@faca87](https://geant4-forum.web.cern.ch/u/faca87)\
**Post date:** [March 30, 2021, 4:46pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/14 "2021-03-30T16:46:47Z")

</div>

Thank you @allison the I aborted the installation and I’m installing again QT using

 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/c/cd9c6c67d3ab4fe6b4d5efc10e2bc0555eb5fb5c.jpeg)  
 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/a/a2d92cc264094a3e56fb748f6677fec6743f9a5f.png)

I hope it’s enough

Regarding of the the Geant4 UIVIS…sorry, I’m Looking again the email and he wrote  
`-DWITH_GEANT4_UIVIS=ON`

then it’s -DWITH\_ and not -DGEANT4, this is the e-mail

 ![image](https://geant4-forum.web.cern.ch/uploads/default/original/2X/a/a9dda50315c1b2f6d93dd5ad0791afdf6721bf30.png)

but I can’t find `-DWITH\_GEANT4\_UIVIS too…

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [July 2, 2022, 4:55pm UTC](https://geant4-forum.web.cern.ch/t/geant4-installation-options-on-windows/4802/15 "2022-07-02T16:55:07Z")

</div>

Closed on July 2, 2022, 4:55pm UTC


