views:

382

answers:

7

I always use the terms compile and build interchangeably.

What exactly do these terms stand for?

+1  A: 

They often are used to mean the same thing. However, "build" may also mean the full process of compiling and linking a whole application (in the case of e.g. C and C++), or even more, including, among others

  • packaging
  • automatic (unit and/or integration) testing
  • installer generation
  • installation/deployment
  • documentation/site generation
  • report generation (e.g. test results, coverage).

There are systems like Maven, which generalize this with the concept of lifecycle, which consists of several stages, producing different artifacts, possibly using results and artifacts from previous stages.

Péter Török
+1  A: 

From wikipedia:

In the field of computer software, the term software build refers either to the process of converting source code files into standalone software artifact(s) that can be run on a computer, or the result of doing so. One of the most important steps of a software build is the compilation process where source code files are converted into executable code.

While for simple programs the process consists of a single file being compiled, for complex software the source code may consist of many files and may be combined in different ways to produce many different versions.

codaddict
+2  A: 

Most people would probably use the terms interchangeably. You could see one nuance : compiling is only the step where you pass some source file through the compiler (gcc, javac, whatever).

Building could be heard as the more general process of checking out the source, creating a target folder for the compiled artifacts, checking dependencies, choosing what has to be compiled, running automated tests, creating a tar / zip / ditributions, pushing to an ftp, etc...

phtrivier
+5  A: 

You "compile" units of code, but you "build" solutions -- which might involve compiling code, assembling resources, packaging deployment scripts, ...

T.J. Crowder
+1  A: 

Compiling is the act of turning source code into object code.

Linking is the act of combining object code with libraries into a raw executable.

Building is the sequence composed of compiling and linking, with possibly other tasks such as installer creation.

Many compilers handle the linking step automatically after compiling source code.

Ignacio Vazquez-Abrams
+1  A: 

A build could be seen as a script, which comprises of many steps - the primary one of which would be to compile the code. Others could be

  • running tests
  • reporting (e.g. coverage)
  • static analysis
  • pre and post-build steps
  • running custom tools over certain files
  • creating installs
  • labelling them and deploying/copying them to a repository
Gishu
+2  A: 

From my experience I would say that "compiling" refers to the conversion of one or several human-readable source files to byte code (object files in C) while "building" denominates the whole process of compiling, linking and whatever else needs to be done of an entire package or project.

chris