Cmake error during installation

Good afternoon. I am trying to install geant4 (version 10.7.4) via cmake. But the following error pops up:
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):

Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindEXPAT.cmake:65 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/Modules/G4OptionalComponents.cmake:106 (find_package)
cmake/Modules/G4CMakeMain.cmake:59 (include)
CMakeLists.txt:51 (include)

_Geant4 Version: 10.7.4
_Operating System: Linux
Compiler/Version:
_CMake Version: 3.22


Hi @Friedrih ,
libexpat1-dev is missing in your machine.

here are the prerequisites,
install them first

sudo apt-get install build-essential libexpat1-dev libxmu-dev cmake cmake-curses-gui qt5-default -y

and then follow the steps you were following.

VRS

1 Like

Thank you very much.

After running “make - jN” (N = 4), the following red text appeared:

CMake Error at /home/erg/Загрузки/geant4-v10.7.4-build/Externals/G4EMLOW-7.13/src/G4EMLOW-stamp/download-G4EMLOW.cmake:170 (message):
Each download failed!

error: downloading 'https://cern.ch/geant4-data/datasets/G4EMLOW.7.13.tar.gz' failed
      status_code: 22
      status_string: "HTTP response code said error"
      log:
      --- LOG BEGIN ---
        Trying 188.184.37.219:443...
Trying 2001:1458:201:b0::100:1b:443...

Immediate connect fail for 2001:1458:201:b0::100:1b: Network is unreachable

Connected to cern.ch (188.184.37.219) port 443 (#0)

ALPN, offering h2

ALPN, offering http/1.1

TLSv1.0 (OUT), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.3 (OUT), TLS handshake, Client hello (1):

[512 bytes data]

TLSv1.2 (IN), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.3 (IN), TLS handshake, Server hello (2):

[93 bytes data]

TLSv1.2 (IN), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.2 (IN), TLS handshake, Certificate (11):

[4914 bytes data]

TLSv1.2 (IN), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.2 (IN), TLS handshake, Server key exchange (12):

[333 bytes data]

TLSv1.2 (IN), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.2 (IN), TLS handshake, Server finished (14):

[4 bytes data]

TLSv1.2 (OUT), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

[70 bytes data]

TLSv1.2 (OUT), TLS header, Finished (20):

[5 bytes data]

TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):

[1 bytes data]

TLSv1.2 (OUT), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.2 (OUT), TLS handshake, Finished (20):

[16 bytes data]

TLSv1.2 (IN), TLS header, Finished (20):

[5 bytes data]

TLSv1.2 (IN), TLS header, Certificate Status (22):

[5 bytes data]

TLSv1.2 (IN), TLS handshake, Finished (20):

[16 bytes data]

SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256

ALPN, server did not agree to a protocol

Server certificate:

subject: C=CH; ST=Gen�ve; O=CERN Organisation Europ�enne pour la Recherche Nucl�aire; CN=www.cern.ch
start date: Jan 16 00:00:00 2023 GMT
expire date: Jan 16 23:59:59 2024 GMT
subjectAltName: host “cern.ch” matched cert’s “cern.ch”
issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Organization Validation Secure Server CA
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.

TLSv1.2 (OUT), TLS header, Supplemental data (23):

[5 bytes data]

GET /geant4-data/datasets/G4EMLOW.7.13.tar.gz HTTP/1.1

Host: cern.ch

User-Agent: curl/7.81.0

Accept: /

TLSv1.2 (IN), TLS header, Supplemental data (23):

[5 bytes data]

Mark bundle as not supporting multiuse

HTTP 1.0, assume close after body

HTTP/1.0 408 Request Time-out

Cache-Control: no-cache

Connection: close

Content-Type: text/html

The requested URL returned error: 408

Closing connection 0

TLSv1.2 (IN), TLS header, Unknown (21):

[5 bytes data]

TLSv1.2 (IN), TLS alert, close notify (256):

[2 bytes data]

TLSv1.2 (OUT), TLS header, Unknown (21):

[5 bytes data]

TLSv1.2 (OUT), TLS alert, close notify (256):

[2 bytes data]

      --- LOG END ---

@Friedrih

INSTALLATION GEANT4

After Downloading G4 any version (source), follow steps;

1. make build directory --> mkdir build; cd build
2. cmake -DCMAKE_INSTALL_PREFIX=~/path_installation_folder/ -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON ../yoursourceG4    
[your source G4 -> e.g., geant4-v11.1.2 ]
[path_installation_folder --> e.g.,  /home/Geant4]

Extra DCMAKE OPTIONS ==> -DGEANT4_BUILD_MULTITHREADED=OFF -DGEANT4_USE_GDML=ON   ---> for G4GDML [GARFIELD]   [ pre-requisite -> sudo apt-get install libxerces-c-dev  ]

For G4TENDL data add -DGEANT4_INSTALL_DATASETS_TENDL=ON

3. make -jN   [where N ==> cores say 4]

4. make install

5. copy path of installation in .bashrc, i.e.
source ~/Geant/geant4-install/bin/geant4.sh

6. Set environment  -> printenv | grep G4

You are set to run your first project.

Regards,

Vijay

This is probably a network issue between this machine and CERN, possibly just a timeout/slow connection. You can try rebuilding to retry the downloads, maybe try plain make to avoid parallel downloads.

If this persists, set GEANT4_INSTALL_DATA to OFF and either:

  • Install Geant4, then run geant4-config --install-datasets (this program is in the bin folder where G4 was installed)
  • Download/unpack the datasets manually from here: Download Geant4-10.7.4 - Geant4

Thanks. What means point 6? I want to execute exampleB1.

Hi @Friedrih

Step 6 prints environment with names G4. grep is utility command that search text patterns.
To run your first project you can create build folder in example B1 and from there call

  1. cmake …/
  2. make
  3. ./exampleB1

VRS

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