Geant4 work to build a platform in the Win7 environment

This small master physics, materials laboratory work now, research is probably the software to simulate nuclear shielding material of it. In fact, most of his fellow laboratory are engaged in welding, usually have access to such opportunities directly to the source code to compile software is essentially zero, so everything explore on their own, after successfully built a platform Geant4 under Win7 environment , the share installation experience it for your reference. Another: This article Special thanks to Sina, "a walk to see" big brother blog @ http://blog.sina.com.cn/morpheusndpat . Then there is the concrete:

Before building a platform in Ubuntu too Geant4, but because it was new to, so most of them are still scanty, the virtual machine is not accidentally lost, among Zhuomang rush job, but learned a lot. First of all, compared to the majority of children's shoes will be used by Geant4 visualization and data analysis capabilities, as the host for the monitor with a keyboard with the same. Therefore, this selection as the CERN ROOT and Qt, respectively, data analysis and visualization component. The first step, of course, select the appropriate software to work according to their own OS. This article used OS is Win7 64-bit operating system, do not underestimate this 64-bit, a lot of software version is not Windows 64 drops, children's shoes with the same 64-bit system can be recommended to select the software version of this article based on.

First: Geant4 the latest version of choice geant4_10_05_p01 writing, Download po here http://geant4.web.cern.ch/support/download , at the same time, children's shoes, we should also download a list of Data files listed below full download, save in another place. However, in order to ensure the systematic installation of the platform, the proposed new folder "Geant4", then put two folders a source file, put a file in the library folder.

Second: the entire platform need a compiler, therefore, recommended Microsoft universe first IDE visual studio, UP where the selected version is VS2019, this open-source software developers for free, please be safe to eat. https://visualstudio.microsoft.com/zh-hans/vs/ installation-friendly, just the next step to complete. After the use of ROOT and Qt are related to this IDE.

Third: select CERN ROOT download version, this is the best thing to install, just put the address on here like https://root.cern.ch/downloading-root , where the selected version is recommended that the newer the better, as used herein, the version is root_v6.18.02.win32.vc16.exe , as seen children's shoes, marked above win32, but has been tested and is available 64-bit OS, which is one reason why this stuff is good reason to install. The installation process is very easy, the next step Dafa.

Fourth: Qt installation fee of UP a lot of effort, should be particularly marked, because a lot of Qt version is not unrelated to the VS2019, is the 32-bit version, can not be compiled, therefore, UP After several attempts to find when almost gave the this version - qt-x86-opensource-Windows-msvc2015_64-5.7.1.exe see, MSVC refers associated with the version of VS, VS backward compatible with 2019 down it anyway, mainly after 64 very important ! ! Without this word, after compiling can not pass! It is not recommended to download with the official website, the site will save a lot of trouble paying registration http://download.qt.io/archive/qt/5.7/5.7.1/ . After downloaded, it is more important is that here you need to add about system variables (even if there are not really understand this adorable new little one to manually Baidu it ^ _ ^)

Variable Name: QMAKESPEC variable values:. \ Qt \ Qt5.7.1 \ 5.7 \ msvc2015_64 \ mkspecs \ winrt-x64-msvc2015

Variable Name: QTDIR variable values:. \ Qt \ Qt5.7.1

Note: Here \ is the relative file path, children's shoes please make changes in accordance with the path to install their own time.

Fifth: experienced the most tiring part of the above, we put all the parts are almost the download is complete, what they need to link it (how could squeeze?)? This is Cmake command on a Linux system is often used, where our windows system does not like Linux command line installation Dafa, so we need to manually download and install cmake GUI (of course, are interested in children's shoes can try Windows Linux emulator on cygwin, before so many chiefs also used). Here, I only po cmake Windows version of the downloadable version of cmake-3.15.2-win64-x64.msi and address https://cmake.org/download/ . Try to use the most recent version, because the previous version is not compatible with the VS2019! ! Installation is very simple, not repeat them here.

Sixth: So, all in all have installed the (real this time!) To compile the hands begin! ! ! Here we double-click the desktop icon to point to open Cmake GUI, the "where is the source code:" The first line of the box to find a place where we Geant4 source (that is downloaded before Geant4 folder geant4_10_05_p01 what), the next line. " where to build the binaries: "box and then Geant4 folder in a folder with the parallel place a new folder named" build "(which is used to it, of course, you are willing, Tun Town also OK). Fill out probably like this drop:

Not the same? It does not matter, this is the situation I have compiled after the UP, just like children's shoes are installed above to fill out. After that, we click on the Configure button in the lower left corner to start pre-compiled, here, we need to select the version of the IDE, remember to choose VS2019 Oh, I believe the correct version, then it should find. After that, the picture is much like the case with the above, the question now is what we need and what --Qt where necessary plug-in OpenGL checked, in fact, I feel completely install Qt is to use this plug-in. . . If the picture does not jump out of the path associated Qt Qt install and check the environment variable settings are correct. After all right, CMAKE_CONFIGURATION_TYPES would like to leave a Release, then select INSTALL installation address CMAKE_INSTALL_PREFIX, you can fill out the shining figure, Configure again.

Seventh: Congratulations basically completed 90% of the task came here, the following things very simple, click Generate to generate c ++ project to work it!

Eighth: Cmake mission is over, close it, or click on the third button: Open Project, the interface will automatically go to the universe on the first IDE tall - VS9012 on (error), we just opened personally generated geant4 project. Do not worry, we have to do little things: first download a good library Geant4 remember? Now look to the following environment variable to configure them up!

Variable name: PATH variable value: Add two \ Qt \ Qt5.7.1 \ 5.7 \ msvc2015_64 \ bin; \ root_v6.18.00 \ bin (which seems to be the front line of work ... forget).

Variable Name: G4ENSDFSTATEDATA variable values:. \ Geant4 \ DATA \ G4ENSDFSTATE2.2

Variable Name: G4LEDATA variable values:. \ Geant4 \ DATA \ G4EMLOW7.7

Variable Name: G4LEVELGAMMADATA variable values:. \ Geant4 \ DATA \ PhotonEvaporation5.3

Variable Name: G4NDLDATA variable values:. \ Geant4 \ DATA \ G4NDL4.5

Variable Name: G4PARTICLEXSDATA variable values:. \ Geant4 \ DATA \ G4PARTICLEXS1.1

Variable Name: G4PIIDATA variable values:. \ Geant4 \ DATA \ G4PII1.3

Variable Name: G4SAIDXSDATA variable values:. \ Geant4 \ DATA \ G4SAIDDATA2.0

At present it seems these libraries would suffice, right? Geant4 can also go to the official website query corresponding variable name to add - not enough

Ninth: Call ~ finally finished! Now, find the INSTALL project in Solution VS2019's list, here's what you previously selected in the INSTALL CMake address system installation project installed. Right -> Generate, after which, it will generate a very long time, but when it's all done time (no error), Congratulations, Geant4 platform already in your computer up!

Here, as a test of teaching, simple and practical example where we do B4C test (do not ask me why), we open CMake GUI again, find the example source code in the source code line, and establish where you want to generate the compiled file build folder, following the operation is very simple, what do not choose, configure between, over and then generate, and then Open project. After opening the VS2019, to find INSALL project, right generation, after waiting, your example has served the (false -) here, needs to be emphasized, we should check twice to generate INSTALL way to compile the top is " Release "before setting over the CMake should be right, if wrong, please correct for the Release.

All in all have been completed, when you open a folder of your example again, you will find inside more than a build folder, open it, a bunch of the project file, there is a Release folder, open it, and ultimately, you see your project executable files --exampleB4c.exe. Is not it exciting? Do not worry, drag it to the parent directory, that is, after the build directory, and then double-click to open, you will see this effect:

Is not forget what? This example comes ROOT program, so use it, the last special episode task - with open .root ROOT data analysis table:

Double-click ROOTlogo (? Nothing would own logo with a pretty good?!) And then enter the command: TBrowser b, after finding B4C example build files in the folder pop-up list .root generated files, open them, you will find that, you're done! !

Well, children's shoes to send you here, also put this note as my first blog post in the blog Park, we welcome message treatise!

Guess you like

Origin www.cnblogs.com/Evan-Physics/p/11502737.html