본문 바로가기
misc./Software

MacPorts 이용해서 설치한 Geant4 예제 build 하기

by medical physicist 2022. 8. 15.

조금 오래된 macOS (High Sierra 10.13.6)에 MacPorts 를 이용해서 Geant4 를 설치해보았다.

Xcode 설치와 xcode command line tool 설치 등의 사전 준비를 하고

sudo port install geant4

설치된 버전은 Geant4-10.6.3 이고,

  • /opt/local/share/Geant4 폴더 아래에 Data 와 example, geant4make 등이 위치해 있다.
  • /opt/local/bin 폴더 아래에 geant4.sh, geant4.csh 스크립트가 위치해 있다.
  • /opt/local/lib 폴더 아래에 Geant4 폴더와 관련 하위 폴더들이 위치해 있다.

사용자 home directory 에 'g4work' directory 를 생성하고 그 아래 B1 예제를 복사해왔다.

복사해온 B1 source code 가 compile 한 결과물과 섞이지 않도록 'B1-build' directory 를 생성하고, B1-build 로 이동해서,

cmake   -DGeant4_DIR=/opt/local/lib/Geant4/Geant4.10.6/Geant4-10.6.3   ../B1

그리고 나서 'make' 하면 임무 완료. 이제 만들어진 실행 파일을 실행하면,

./exampleB1

'misc. > Software' 카테고리의 다른 글

DICOM RT  (0) 2023.02.18
[Python] DICOM 파일 열기  (0) 2023.02.17
TOPAS MC 3.7 - 'GNUTLS_3_6_9' 관련 오류 발생할 때  (0) 2021.12.01
Windows PowerShell에서 bash 사용하기  (0) 2021.08.06
TOPAS version 3.3 release  (0) 2020.03.26

댓글