1 / 16

Compiling and Building Tutorial

Morty Abzug 2014-03-19. Compiling and Building Tutorial. Background. Notes with a lot more material than we have time for are at: http://frakir.org/~morty/lue/compiling-tutorial/ AKA http://goo.gl/tR6Etu Lots more info can be obtained by searching google. What is building?.

chavi
Download Presentation

Compiling and Building Tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Morty Abzug 2014-03-19 Compiling and Building Tutorial

  2. Background • Notes with a lot more material than we have time for are at: http://frakir.org/~morty/lue/compiling-tutorial/ • AKA http://goo.gl/tR6Etu • Lots more info can be obtained by searching google

  3. What is building? • Programs are often distributed in formats that are not suitable for immediate use • Building is the process of converting programs from a source code distribution into a form useful by the computer • Distribution in source form is important in research, where we want results to be transparent and reproducible • See background page for more information

  4. Do Researchers need to build? • Many orgs have in-house personnel who can do the building for you. • At NCBI, this is systems. Create a ticket with us. • If you are not NCBI, hopefully you have an equivalent • So why are we having this talk? • Some people are do-it-yourselfers • Some people don't have in-house personnel • Some people want to learn for their own software

  5. Meta Directions • Read directions! • Online at the website • In the distribution, in a README or INSTALL file • If you run into errors • look at the first error. Errors cascade. • Search google for errors • Contact the author if needed. • Feel free to contact local support personnel if available! Helping you is our job. • If you have admin privileges, you have the choice to install to your home directory/profile or to system areas. If you do not have admin privileges, you may only install to your home directory/profile.

  6. General directions • [We'll go into detail on each step] • Make sure you have a build environment set up • Download software • Check distribution expansion (optional) • Expand distribution • Configure • Actual build • Test the build • Install • Test the installed binaries

  7. Setting up a build environment on Ubuntu/Debian • sudo apt-get update; # update the collection of software available • sudo apt-get dist-upgrade; # update all your software • sudo apt-get install build-essential; # install lots of build tools • If you need to install some specific package – say, erlang: • sudo apt-cache search erlang | less; # search for an erlang package • sudo apt-get install erlang; # install the erlang package

  8. Download • Always find the official source for the program. Otherwise, you can end up with out-of-date software. • Usually download with your webbrowser • Or you can right-click a URL, select "copy link location", and then in a terminal window: wget PASTED_URL • Download class notes and samples: wget -m http://frakir.org/~morty/lue/compiling-tutorial/

  9. Check distribution expansion (optional) • Some files expand to a subdirectory. Some expand to the current directory. • for .tar.gz, .tgz, .tar.Z files: tar tzpf FILE.tar.gz | less • for .tar.bz2 files: tar tjpf FILE.tar.bz2 | less ; # note "j" • for .tar files: tar tpf FILE.tar | less • for zip files: unzip -l FILE.zip | less

  10. Expand distribution • If the distribution does not create a subdirectory, make one (mkdir subdir), cd into it (cd subdir), and expand the file using .. before filename below: tar xzpf ../FILE.tar.gz • for .tar.gz, .tgz, .tar.Z files: tar xzpf FILE.tar.gz • for .tar.bz2 files: tar xjpf FILE.tar.bz2; #note the j • for .tar files: tar xpf FILE.tar • for zip files: unzip -q FILE.zip

  11. Configure • If a script named "configure" is present, run it: ./configure • If Makefile.PL is present, run instead: perl Makefile.PL • If Imakefile is present, run instead: xmkmf -a • You can pass options to configure and Makefile.PL. The most useful is for non-default installation location: ./configure –prefix=$HOME/somepackage

  12. Actual build • Normally: make

  13. Test the build • Normally: make test

  14. Install • If you don't have admin admin priviliges: make install • If you do have admin priviliges, you may run: sudo make install

  15. Test the installed binaries • This is program-specific

  16. Installing binaries • This talk was mostly about installing source. • to install binaries in Ubuntu/Debian package format: sudo dpkg -i FILE.deb • To install binaries in RedHat/CentOS/Fedora: sudo rpm -Uvh FILE.rpm

More Related