exampleB1.exe cannot find files that exist when executed

Geant4 version: 10.6

operating system and version: windows 10

compiler vendor and version: windows visual studio 2019

I am trying to build and run example B1 by following the installation guide instructions. In windows visual studio there are two ways of getting to the command prompt which produce different results. If I go to tools>>command line>>developer command prompt then apply the two commands: > cd % HOMEPATH% \Geant4\geant4_10_06_p02\B1-build\Release | and > exampleB1.exe | nothing happens. The command line returns this:

%HOMEPATH%\Geant4\geant4_10_06_p02\B1-build\Release>exampleB1.exe

%HOMEPATH%\Geant4\geant4_10_06_p02\B1-build\Release>

If instead I go to tools>>visual studio command prompt then apply the same two commands, the command line returns four error messages on separate windows (not on the command line window) that are almost identical. The errors windows displays this:

The code execution cannot proceed because ________ was not found. Reinstalling the program may help with this problem.

The blank contains a file name. Each of the four error messages contain a different filename. The four file names are G4GMocren.dll , G4visHepRep.dll , G4Tree.dll , and G4RayTracer.dll . These files are contained in the directory %HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-build\BuildProducts\Release\bin . Normally I would try to reinstall the program however I already did this. After I posted my previous question here I decided to delete all of the Geant4 files, reinstall the program, and start over. So it is very frustrating that the suggested course of action to solve my current problem is what I just did to solve my previous problem. Especially when (for me) this takes several hours of time.

In my previous post I had trouble creating an executable file for example B1 because windows visual studio couldn’t find a few files it needed to create it. Some of these files were similar to the ones that windows visual studio can’t find now. G4Tree.lib, G4GMocren.lib, G4visHepRep.lib, and G4RayTracer.lib were among these.

Below are the commands I used to get to this point.after, I downloaded the geant4 files.

cd %HOMEPATH%\Geant4\geant4_10_06_p02

mkdir geant4_10_06-build

cd %HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-build

cmake -DCMAKE_INSTALL_PREFIX=“%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-install” “%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06”

cmake build . config Release

cmake build . config Release target install

mkdir %HOMEPATH%\B1

Xcopy %HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06\examples\basic\B1 %HOMEPATH%\B1 /E/H

cd %HOMEPATH%\Geant4\geant4_10_06_p02

mkdir B1-build

cd %HOMEPATH%\Geant4\geant4_10_06_p02\B1-build

cmake -DGeant4_DIR=“%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-build” “%HOMEPATH%\B1” > cmake build . config Release

cd %HOMEPATH%\Geant4\geant4_10_06_p02\B1-build\Release

exampleB1.exe

what do I do to execute example B1?
Any help would be greatly appreciated!

I have looked at other posts on this forum to try and get clues for what might be the problem and how to fix it. In this linux post it is mentioned in one of the command line outputs that some the graphic systems available are:

ASCIITree (ATree) DAWNFILE (DAWNFILE) G4HepRep (HepRepXML)

G4HepRepFile (HepRepFile) RayTracer (RayTracer) VRML1FILE (VRML1FILE)

VRML2FILE (VRML2FILE) gMocrenFile (gMocrenFile)

ASCIITree, G4HepRep, RayTracer, and gMocrenFile are important because the file names are similar to the files that were mentioned in the error messages. This means that the problem might have something to do with the graphic systems. I know this probably doesn’t help much but at least it is a step forward in isolating the problem. I’m not entirely sure if there is a set of commands in the installation guide that I need to use from the Building and Installing (Geant4 Build options) section and /or the Post Install section and /or How To Use The Geant4 Toolkit Libraries section. I didn’t use any commands from those sections to get to where I am now.

Any help or suggestions on how to proceed would be greatly appreciated!

I’d suspect that the PATH environment variable is not set to point the directory holding the Geant4 DLLs. Instructions on how to set that are in the PostInstall Setup instructions here:

http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/postinstall.html#required-environment-settings-on-windows

Try following that for both PATH and the dataset environment variables, then run exampleB1.exe again. No need to rebuild it or Geant4 yet, just update the environment.

@bmorgan I went through the steps mentioned in the Installation guide/ post install setup /Required Environment Settings on Windows section. I navigated through the system/control panel options and windows to get to the environment variables. Under the user variables section was a variable named path . I added a value to that variable which was the directory that contains the dll files. I then manually managed the environment variables. I had to do this since I didn’t use the command cmake -DGEANT4_INSTALL_DATA=ON directly after configuring the build. (This is mentioned in the installation guide/ building and installing/ windows platforms and in the post install setup /Required Environment Settings on Windows sections). I downloaded all of the data files that were mentioned in post install setup/Environment Variables for datasets from the geant4 download page. (There are 12 files from the download page but only11 were mentioned in the Environment Variables for datasets section.) For each data file I unpacked it into it’s own directory. For each data set I added an environment variable (user variable). It’s variable name was the name listed environment variable/ value chart in the post install setup . It’s value is the directory where that the data file was unpacked. I then attempted again to run exampleB1.exe , and this happened:

%HOMEPATH%\Geant4\geant4_10_06_p02\B1-build\Release>exampleB1.exe

Available UI session types: [ Win32, GAG, csh ]

-------- WWWW ------- G4Exception-START -------- WWWW -------

*** ExceptionHandler is not defined ***

*** G4Exception : UI0002

issued by : G4UIExecutive::G4UIExecutive()

Specified session type is not build in your system,

or no session type is specified.

A fallback session type is used.

*** This is just a warning message. ***

-------- WWWW ------- G4Exception-END -------- WWWW -------

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** G4Exception : PART70001

issued by : G4NuclideTable

ENSDFSTATE.dat is not found.

*** Fatal Exception *** core dump ***

Even though I find it frustrating to uninstall and reinstall again, I didn’t know how to make any progress otherwise (and as I have mentioned before reinstalling has fixed previous problems) so I deleted the Geant4 files and started using the commands I have mentioned in the original post above. First unpacked the source file to %HOMEPATH% \Geant4\Geant4.10.06 . Doing so created the directory %HOMEPATH% \Geant4\Geant4.10.06\geant4_10_06_p02.

I then used the commands:
cd %HOMEPATH% \Geant4\Geant4.10.06

mkdir %HOMEPATH% \Geant4\Geant4.10.06\geant4_10_06-build

cd %HOMEPATH%\Geant4\Geant4.10.06\geant4_10_06-build

cmake -DCMAKE_INSTALL_PREFIX="%HOMEPATH%\Geant4 ** Geant4.10.06 \geant4_10_06-install" "%HOMEPATH%\Geant4 ** Geant4.10.06\geant4_10_06"

The output of the last command came out as expected. I then tried a command I haven’t used yet cmake -DGEANT4_INSTALL_DATA=ON . From what I have read It appears that using this command will make things easier in the long run when trying to run exampleB1 (though I might be wrong about this).

When I used the command I got this as an output:

CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases. CMake Error: The source directory “%HOMEPATH%/Geant4/Geant4.10.06/geant4_10_06-build” does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.

So I changed directories from the build directory to the source directory. (Which contained the CmakeLists.txt and ran the command again.
%HOMEPATH%\Geant4\Geant4.10.06\geant4_10_06-build>cd %HOMEPATH%\Geant4\Geant4.10.06\geant4_10_06_p02

%HOMEPATH%\Geant4\Geant4.10.06\geant4_10_06_p02>cmake -DGEANT4_INSTALL_DATA=ON cmake -DGEANT4_INSTALL_DATA=ON

CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases. – Building for: Visual Studio 16 2019 – Geant4 requires an out-of-source build. – Please remove these files from %HOMEPATH%/Geant4/Geant4.10.06/geant4_10_06_p02 first: – CMakeCache.txt – CMakeFiles – Once these files are removed, create a separate directory – and run CMake from there CMake Error at CMakeLists.txt:13 (message): in-source build detected – Configuring incomplete, errors occurred!

My questions are below.

My goal is to run exampleB1. Those that are reading this can answer the questions at their discretion to help me achieve that goal. If you see a clear path way that allows me to execute exampleB1 without answering some or any of the questions below I would be happy to see that. These questions are just areas where I think the problems or potential problems might be along the way. They do not all have to be answered.

  1. Before uninstalling and reinstalling was there a simple fix that I could have performed that would have potentially allowed me to run exampleB1?

  2. Did follow the post install instructions correctly?

  3. Is helpful for me to use cmake -DGEANT4_INSTALL_DATA=ON ? (In other words, is faster, more simple, easier to use this command then not use this command?)

  4. [If yes to 3)] should I remove CmakeCache.txt and CmakeFiles as instructed or move them somewhere else that they can be found later? In the output of the last command above When it says “create a separate directory and run cmake from there”. Where should this directory be? Does it have any restrictions on what it can be named?

  5. [if yes to 3)] If I Remove or move the CmakeCache.txt and CmakeFiles do I have to change or add any commands that are given in the installation guide when configuring Geant4 and running exampleB1?

  6. Do I have to install the 11 data files again?

  7. What do I do next in order to run exampleB1?

Any help would be appreciated!!!

The error in running exampleB1 is due to the environment variables for the data not being set in the session it is run in. You can see what variables are set from the command prompt by running the set command. That should print all the variables and you can check the ones for the data libraries are set and point in the right places.

Yes, this will download and install the data for you, but it will not set the environment variables for you. Those steps still need to be done manually.

I don’t know what happened here. Assuming that you ran cmake -DGEANT4_INSTALL_DATA=ON . in %HOMEPATH%\Geant4\Geant4.10.06\geant4_10_06-build then it should not have complained.

Geant4’s CMake build enforces a strict separation between source and build to avoid mixing generated and actual source. If you have CMakeCache.txt and CMakeFiles/ in %HOMEPATH%\Geant4\Geant4.10.06\geant4_10_06_p02 then you should remove them.

You don’t need to change/add any commands, just cd back into %HOMEPATH% \Geant4\Geant4.10.06\geant4_10_06-build. That’s the build directory and where you can run cmake commands in.
[/quote]

No, if they are already present on your system, that’s all that’s needed apart from setting the environment variables to point to them.

First, check that the session you are running in has the data environment variables set, using the command outlined earlier. Second, if you’re rebuilding/installing Geant4 again, you may want to add -DGEANT4_USE_OPENGL_WIN32=ON to the cmake options. That will enable a better visualisation system that will be helpful later.

from the B1-build file enter

.\Release\exampleB1.exe

I attempted again to execute example B1 but with no success. I uninstalled Geant4 and effectively used the same set of commands that I used on the original topic post (the bottom part of the first post on the top of this page) with a few exceptions. The first difference is that I used the command:

cmake -DGEANT4_INSTALL_DATA=ON .

directly after this command:

cmake -DCMAKE_INSTALL_PREFIX=“%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-install” “%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06”

In my previous reply I had trouble making the

cmake -DGEANT4_INSTALL_DATA=ON .

command work without giving an error. I figured out what the problem was. The command has a space and a dot after after the word ON. I didn’t include the dot after the word ON in my previous reply, but I did so in my latest attempt and seemed to have worked as it was supposed to.

Directly after using the commands:

cmake build . config Release

cmake build . config Release target install

I tried to set the environment variables as stated in installation guide (post install setup). I added the directory where the dll files are located (%HOMEPATH%\geant4\geant4_10_06_p02-build\BuildProducts\Release\bin) as a value in the path entry of user variables. I then added the 11 variables that were listed in the environment variables for data sets section of the installation guide (post install setup). The variable names being the names listed in the environment variables data sets and the values being CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data. I then ran the rest of the commands listed on the top of this page. I got the same error that occurred in my previous reply after running the command:

.\Release\exampleB1.exe

in the B1-build directory

which is this:

Available UI session types: [Win32, GAG, csh]

-------- WWWW ------- G4Exception-START -------- WWWW -------

*** ExceptionHandler is not defined ***

*** G4Exception : UI0002

issued by : G4UIExecutive::G4UIExecutive()

Specified session type is not build in your system,

or no session type is specified.

A fallback session type is used.

*** This is just a warning message. ***

-------- WWWW ------- G4Exception-END -------- WWWW -------

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** G4Exception : PART70001

issued by : G4NuclideTable

ENSDFSTATE.dat is not found.

*** Fatal Exception *** core dump ***

I ran the

SET

command and a large number of items appeared. Among these items were these:

G4ABLADATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4ENSDFSTATEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4INCLDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4LEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4LEVELGAMMADATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4NEUTRONHPDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4PARTICLEXSDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4PIIDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4RADIOACTIVEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4REALSURFACEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

G4SAIDXSDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data

I changed directories from the B1-build directory to the main geant4 build file.

I then used the command (Suggested by @bmorgan):

cmake -DGEANT4_USE_OPENGL_WIN32=ON .

– Found OpenGL: opengl32

– Reusing dataset G4NDL (4.6)

– Reusing dataset G4EMLOW (7.9.1)

– Reusing dataset PhotonEvaporation (5.5)

– Reusing dataset RadioactiveDecay (5.4)

– Reusing dataset G4PARTICLEXS (2.1)

– Reusing dataset G4PII (1.3)

– Reusing dataset RealSurface (2.1.1)

– Reusing dataset G4SAIDDATA (2.0)

– Reusing dataset G4ABLA (3.1)

– Reusing dataset G4INCL (1.0)

– Reusing dataset G4ENSDFSTATE (2.2)

– The following Geant4 features are enabled:

GEANT4_BUILD_CXXSTD: Compiling against C++ Standard ‘17’

GEANT4_USE_OPENGL_WIN32: Build OpenGL driver with Win32 support

– Configuring done

– Generating done

– Build files have been written to: %HOMEPATH%/geant4/geant4_10_06_p02-build

I then changed back to the B1-build directory and tried the

.\Release\exampleB1.exe

command again I got the same error.

I then changed the environment variable values and included the 11 subdirectories listed in the environment variables for data sets section of the installation guide (post install setup).

I used the

SET

command again

Which gave the items below among the many other items in it’s output

G4ABLADATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4ABLA3.1

G4ENSDFSTATEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4ENSDFSTATE2.2

G4INCLDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4INCL1.0

G4LEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4EMLOW7.9

G4LEVELGAMMADATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/PhotonEvaporation5.5

G4NEUTRONHPDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4NDL4.6

G4PARTICLEXSDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4PARTICLEXS2.1

G4PIIDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4PII1.3

G4RADIOACTIVEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/RadioactiveDecay5.4

G4REALSURFACEDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/RealSurface2.1.1

G4SAIDXSDATA=CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4SAIDDATA2.0

I changed directories from the B1-build directory to the main geant4 build directory.

I then used the command :

cmake -DGEANT4_USE_OPENGL_WIN32=ON .

And got this output:

– Reusing dataset G4NDL (4.6)

– Reusing dataset G4EMLOW (7.9.1)

– Reusing dataset PhotonEvaporation (5.5)

– Reusing dataset RadioactiveDecay (5.4)

– Reusing dataset G4PARTICLEXS (2.1)

– Reusing dataset G4PII (1.3)

– Reusing dataset RealSurface (2.1.1)

– Reusing dataset G4SAIDDATA (2.0)

– Reusing dataset G4ABLA (3.1)

– Reusing dataset G4INCL (1.0)

– Reusing dataset G4ENSDFSTATE (2.2)

– The following Geant4 features are enabled:

GEANT4_BUILD_CXXSTD: Compiling against C++ Standard ‘17’

GEANT4_USE_OPENGL_WIN32: Build OpenGL driver with Win32 support

– Configuring done

– Generating done

– Build files have been written to: %HOMEPATH%/geant4/geant4_10_06_p02-build

I then changed back to the B1-build directory and tried the

.\Release\exampleB1.exe

command again, I got the same error YET AGAIN.

My questions

  1. did set up the environment variables properly(on either attempt)?

  2. I assumed that since the

cmake -DGEANT4_INSTALL_DATA=ON .

command has has a dot after the word ON that the

cmake -DGEANT4_USE_OPENGL_WIN32=ON .

command also should have a dot after the word ON.

am I right about this?

  1. Did I use the

cmake -DGEANT4_USE_OPENGL_WIN32=ON .

command at the right time?

should this command be used before Cmake builds Geant4 or is okay to use it after?

  1. I set up the environment variables on the user variable list. Was this the correct list to put the variables on or should they go on the system variables list?

  2. what could be the source of my error that prevents the execution of exampleB1? What can I do to fix it?

Is CMAKE_INSTALL_PREFIX in here the literal string that’s printed, or have you just written it as a shorthand for where you installed? If the literal value that’s printed is CMAKE_INSTALL_PREFIX/share/Geant4-10.6.0/data/G4ABLA3.1 then that’s wrong (we’ll make the documentation clearer here). Based on your initial invocation of the cmake command, this string should really be something like %HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-install/share/Geant4-10.6.0/data/G4ABLA3.1 (and ideally with %HOMEPATH% expanded to its absolute path).

@bmoragn I didn’t realize how confused I was on specific portions of this process until it was explicitly pointed out that CMAKE_INSTALL_PREFIX is a shorthand for the directory path to the install file created by cmake. Which now looking in hindsight seems obvious and worthy of a palm smack on my forehead! It was the literal string not shorthand. I have now changed the environment variables accordingly however I have encountered a new problem I am still not seeing the visual component after I used

.\Release\exampleB1.exe

from the B1-bulild directory
I tried a few /vis commands from the idle prompt but I couldn’t get the visuals to show up.

I when I copied everything from my command prompt after I used the

.\Release\exampleB1.exe

and the vis commands it came out to 12 pages on a word document so I think if I summarize what was there it will be a lot more efficient . First the same initial warning message (from my previous reply) showed up however instead of the core dump error at the end it showed this instead:

<<< Reference Physics List QBBC
Visualization Manager instantiating with verbosity “warnings (3)”…
Visualization Manager initialising…
Registering graphics systems…

Then it showed a bunch of things that are now registered such as graphic systems, model factories, filter factories, etc.

Then it showed a large number of /vis command options

I tried this:

Idle> /vis/open DAWNFILE
/vis/open DAWNFILE
/vis/sceneHandler/create DAWNFILE
/vis/sceneHandler/attach
/vis/viewer/create ! ! 600
Issue /vis/viewer/refresh or flush to see effect.

Then this:

/vis/viewer/flush
/vis/viewer/flush
/vis/viewer/refresh viewer-0
===========================================
Output file: g4_0000.prim
Destination directory (current dir if NULL):
Maximal number of files in the destination directory: 100
Note: * The maximal number is customizable as:
% setenv G4DAWNFILE_MAX_FILE_NUM number

  • The destination directory is customizable as:
    % setenv G4DAWNFILE_DEST_DIR dir_name/
    ** Do not forget “/” at the end of the
    dir_name, e.g. “./tmp/”.
    ===========================================
    -------- WWWW ------- G4Exception-START -------- WWWW -------
    *** G4Exception : dawn0001
    issued by : G4FRSCENEHANDLER::AddPrimitive (const G4Polyline&)
    2D polylines not implemented. Ignored.
    *** This is just a warning message. ***
    -------- WWWW -------- G4Exception-END --------- WWWW -------

/vis/viewer/update viewer-0

File g4_0000.prim is generated.
dawn g4_0000.prim
‘dawn’ is not recognized as an internal or external command,
operable program or batch file.

I then I did this:

/vis/viewer/refresh
/vis/viewer/refresh
===========================================
Output file: g4_0001.prim
Destination directory (current dir if NULL):
Maximal number of files in the destination directory: 100
Note:

  • The maximal number is customizable as:
    % setenv G4DAWNFILE_MAX_FILE_NUM number
  • The destination directory is customizable as:
    % setenv G4DAWNFILE_DEST_DIR dir_name/
    ** Do not forget “/” at the end of the
    dir_name, e.g. “./tmp/”.
    ===========================================

None of the vis commands I used so far gave the visual component and I don’t know what I need to do In order to see the visual part of exampleB1

When running B1, then there should be output that includes the lines:

...
Available UI session types: [ <comma-sep-list> ]
...
You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
<maybe-others>

Do you see these, and what do you have, if anything, in <comma-sep-list> and <maybe-others>?

@bmorgan These are the relevent output lines you asked for
Available UI session types: [ Win32, GAG, csh ]

You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)

There are no other graphic systems

Thanks! O.k., it looks like that the install of Geant4 that’s being used as it stands was not built with GEANT4_USE_OPENGL_WIN32=ON. I realise that you did note this as being set in the cmake command line, so the thing to check is the content of the Geant4Config.cmake file in the install. Assuming from the output you posted that Geant4 is installed in

%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-install

then this should be located under that directory at

%HOMEPATH%\Geant4\geant4_10_06_p02\geant4_10_06-install\lib\Geant4-10.6.2\Geant4Config.cmake

If this install was built with OpenGL support, it should have a lines in there:

...
# - OpenGL Win32
set(Geant4_vis_opengl_win32_FOUND ON)
if(Geant4_vis_opengl_win32_FOUND)
...

The set(Geant4_vis_opengl_win32_FOUND ON) is the key one - if this is present with ON, then the install supports OpenGL. Otherwise it will need to be reconfigured/reinstalled with that switch on. Note that if the directory where you did the build is still present, you can reconfigure/reinstall in there without needing to delete/start from scratch.

@bmorgan I finally got the install to work that included

cmake -DGEANT4_INSTALL_DATA=ON .

and

cmake -DGEANT4_USE_OPENGL_WIN32=ON .

before the commands:

cmake build . config Release

and

cmake build . config Release target install

However I cannot get the environment variables to be included. When I use the

SET

command, it doesn’t show the environment variables that I put in. The environment variables windows has the new directory for the variable PATH. The directory being where the dll files are located. I put in the 11 variables listed in the postinstall setup of the installation guide with the appropriate directories as values. No I didn’t use HOMEPATH or CMAKE_INSTALL_PREFIX as literal text. I wrote out the full pathway. No I didn’t accidentally put them as system variables I put them as user variables. I triple checked the paths that I put in. The directory is where each of the datasets are located. They don’t show up when I use

SET

For Unix-based systems, the g4setup.sh script (or geant4make.sh if you use Make with your applications) defines all of the required environment variables.

For Windows systems, see the Installation Guide “Postinstall Setup” instructions.

1 Like

I am having a similar issue to here. I followed this whole forum thread and did everything accordingly as suggested by the installation guide and post-install setup. However, when I run the executable generated by the B1 example, I still get the same error core dump shown at the start of this thread. I documented the problem in this new thread:

I would appreciate your help tremendously!

Thank you!
Rodrigo

Hello @bmorgan and @ABD-421,

I am currently having the same issue running an executable that I created with VS19 for ExampleB1, not related to the data downloads and cross section env vars but the System Error:

The code execution cannot proceed because,
G4visHepRep.dll, G4FR.dll, G4GMocren.dll, G4Tree.dll
was not found. Reinstalling the program may fix this problem.

Working backwards from this moment, my environment variables for the dll’s is set as stated as well in the documentation as shown here as described in Post Install Instructions as described by you and @mkelsey :

Additionally, after installation, I checked my install folder containing C:\Program Files\geant4_10_07_install\lib\Geant4.10.07\Geant4Config.cmake which does contain the notification that opengl_win32 and other vis options were found:

Previous to this, I configured my build folder with the following options and install instructions:

cmake -DCMAKE_INSTALL_PREFIX=“C:\Program Files\geant4_10_07_install” “C:\Program Files\geant4_10_07” -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_OPENGL_WIN32=ON -DCMAKE_PREFIX_PATH=“C:\Program Files\XercesC-install”

I appreciate any advice, as I cannot figure out what I am missing here with regards to the environment variables? I have been running everything in Admin Developer Command Prompt for VS19, and had no errors throughout the install process.

Ok… In short time I have found the problem, but I think it may be informative to those who have this same issue.

If I attempt to run my executable in Release at: C:\Program Files\geant4_workspace\B1-b\Release\exampleB1.exe by either

  1. Clicking on my executable
  2. Running the executable from the VS19 command prompt (opened as administrator)

I obtain the errors written by the first author, and in my reply above.

On the other hand if I right click on my executable in …\Release\exampleB1.exe and select “Run as administrator” the application runs fine.

I hope that this helps anyone else running windows to not be under the impression that they compiled improperly.