C2110 UNIX and programming Lesson 13 / Module 2 -1C2110 UNIX and programming Petr Kulhanek kulhanek@chemi.muni.cz National Center for Biomolecular Research, Faculty of Science Masaryk University, Kamenice 5, CZ-62500 Brno PS / 2020 Distance form of teaching: Rev1 13. lesson / module 2 C2110 UNIX and programming Lesson 13 / Module 2 -2- Compilation ➢ Armagetron application ➢ Unpacking archive ➢ Configuration ➢ Compilation ➢ Installation C2110 UNIX and programming Lesson 13 / Module 2 -3- Procedure: 1) Download source code • Web browser • wget, curl • git, svn, etc. (versioning systems) 2) Unpack archive • tar/gzip 3) Installation instructions (README, INSTALL, doc/README, doc/INSTALL) 4) Configuration (configure, cmake, qmake, etc.) 5) Compilation 6) Installation Compilation of applications Holy Trinity https://en.wikipedia.org/wiki/Configure_script Configuration script $ ./configure $ make $ (sudo) make install CMake $ cmake . $ make $ (sudo) make install https://en.wikipedia.org/wiki/CMake Examples of configuration approaches C2110 UNIX and programming Lesson 13 / Module 2 -4- Armagetron http://armagetronad.org/ Procedure: 1) Download source code 2) Unpack archive 3) Installation instructions (README, INSTALL, doc/README, doc/INSTALL) 4) Configuration 5) Compilation 6) Installation C2110 UNIX and programming Lesson 13 / Module 2 -5Armagetron, Procedure I We do everything in scratch.1) Unpacking the archive: $ tar xvf armagetronad-0.2.9.1.0.tbz 2) Create an installation directory, i.e., where the program will be installed (required if you do not have root permission) $ mkdir armagetronad $ pwd /scratch/kulhanek/game/armagetronad 3) Changing the working directory to the extracted archive: $ cd armagetronad-0.2.9.1.0 4) Configuration for compilation and installation: $ ./configure --prefix=/scratch/kulhanek/game/armagetronad \ -disable-etc -disable-uninstall At this stage, some libraries or applications may be missing. These can either be installed in a similar way. However, it is more convenient (and faster) to ask the administrator to install them. For compilation, it is necessary to install development packages of individual libraries. E.g: # apt-get install libxml2-dev where program will be installed C2110 UNIX and programming Lesson 13 / Module 2 -6Armagetron, Procedure II 5) Compilation $ make 6) Installation $ make install 7) Starting the program $ cd /scratch/kulhanek/game/armagetronad $ bin/armagetronad where program is installed