본문 바로가기

C C++

OpenMPI Compiling CUDA와 MPI를 같이 사용하려면,../configure --prefix=/usr/local \ --with-cuda=/usr/local/cuda 더보기
라이브러리 설치 위치 잡는 법 When building Open MPI from source on Ubuntu, two common approaches for setting the --prefix are: 1. Install system-wide in /usr/localThis is the default prefix if you don’t specify one. You’ll end up with: • Executables in /usr/local/bin • Libraries in /usr/local/lib • Headers in /usr/local/includeThis is a simple approach if you only need one custom version, and you don’t mind overwriting the .. 더보기
Module 기본 사용법 일반적으로 모듈 Configuration file은 아래의 디렉토리에 작성하면 된다./opt/modules/modulefiles 다름은 Module을 사용하기 위한 기본 명령어 들이다.• module avail: Lists all available modules on the system.• module load : Loads the specified module and modifies your current shell environment accordingly.• module unload : Unloads a previously loaded module and reverts the environment changes it made.• module list: Shows which modules are cu.. 더보기
Intel Compiler Classic Intel compilerC : iccC++ : icpcFortran : ifortIn CMAKE option,cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc \ -DCMAKE_Fortran_COMPILER=ifort ../cmake Intel oneAPIC : icxC++ : icpxFortran : ifxIn CMAKE option,cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx \ -DCMAKE_Fortran_COMPILER=ifx ../cmake Intel  oneAPI를 설치하면 module 설정을 위한 스크립트 파일이 제공된다.아래와 같이 실행하면 module이 .. 더보기
Module : 컴파일을 위해 여러 library를 사용해야 할 경우 C++을 이용한 컴파일시, 여러 Compiler를 사용해야 할 경우가 있다.예를 들어 OpenFoam은 GCC컴파일러를, LAMMPS는 Intel Compiler를 사용해야 할 경우,./bashrc에서 라이브러리 path를 지정하게되면, 컴파일 할 때 마다 라이브러리 path를 바꿔줘야 하는 불편함이 생긴다.또는, 위에 상황이 복잡해 지면 혹자는 이런 상황을 "dependency hell"이라고 한다. 그렇지 않을 경우, 컴파일 된 프로그램에서 아래와 같은 에러 뱉어내는 경우가 있는데,이는 LAMMPS의 Main code는 cmake를 통해 Intel compiler를 사용하도록 지정되었지만, 이미 설치된 VTK library는 apt install과정에서 GCC로 컴파일된 binary 라이브러리가 깔려.. 더보기
CMAKE https://www.tuwlab.com/ece/27234 더보기