-
Notifications
You must be signed in to change notification settings - Fork 448
Building BOINC on Unix
The C++ part of BOINC consists of several components, divided into directories as follows:
client/
: the BOINC client
clientgui/
: the BOINC Manager (GUI for the client)
sched/, tools/
: the BOINC server
api/
: API for BOINC applications
samples/
: wrappers and example applications
lib/
: utility functions, used by all the above
NOTE: if you're creating or upgrading a BOINC project, you don't need the client software; participants can get that from the BOINC web site. You only need sched, tools, and maybe api.
To build components on Unix, first install the software prerequisites and get the BOINC source code. Then, in the source code directory, type
./_autosetup
./configure [see options below]
make
If you have updated the tools used by the build system (make, autotools, gcc, ...) since your last build, rebuild the files created by _autosetup using
./_autosetup -f
The configure command syntax is
./configure [OPTION]... [VAR=VALUE]...
You can use environment variables to override the choices made by configure
or to help it to find libraries and programs with nonstandard names/locations.
To assign environment variables (e.g., CC, CFLAGS...),
specify them as VAR=VALUE
.
For example, to compile BOINC with strict compiler warnings, use
./configure CXXFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fno-common "
The options are as follows.
-h, --help
: display configuration options and exit.
Use configure options to select only the components you need.
--disable-COMPONENT
: do not include COMPONENT (same as --enable-COMPONENT=no)
--enable-COMPONENT[=ARG]
: include COMPONENT [ARG=yes]
For example:
--disable-server
: disable building the server components
--disable-manager
: disable building the manager (Disabled automatically if configure can't find wxWidgets)
--disable-client
: disable building the client.
If you're creating a project, use
./configure --disable-client --disable-manager
To build the client and manager, use
./configure --disable-server
If you're developing or porting a BOINC application, you need only the API:
./configure --disable-server --disable-client --disable-manager
--enable-debug
: enable tracing and debugging flags for all components (alternatively, include -g in CFLAGS and CXXFLAGS)
--enable-shared[=PKGS]
: build shared libraries [default=yes]
--enable-static[=PKGS]
: build static libraries [default=yes]
--disable-static-linkage
: disable static linking of certain libraries
--with-PACKAGE[=ARG]
: use PACKAGE [ARG=yes]
--without-PACKAGE
: do not use PACKAGE (same as --with-PACKAGE=no)
--with-x
: use the X Window System
--with-apple-opengl-framework
: use Apple OpenGL framework (Mac OS X only)
--with-wxdir=PATH
: Use installed version of wxWidgets in PATH
--with-wx-config=CONFIG
: wx-config script to use (optional)
CC
: C compiler command
CFLAGS
: C compiler flags
LDFLAGS
: linker flags, e.g. -L<dir>
if you have libraries in a nonstandard directory.
CPPFLAGS
:
C/C++ preprocessor flags, e.g. -I<dir>
if you have headers in a nonstandard directory.
CXX
: C++ compiler command
CXXFLAGS
: C++ compiler flags.
CPP
: C preprocessor
CXXCPP
: C++ preprocessor
F77
: Fortran 77 compiler command
FFLAGS
: Fortran 77 compiler flags
MYSQL_CONFIG
: path of mysql_config program
Configure options:
--enable-client-release
: Try building a portable 'release-candidate' (currently implemented for Linux and Solaris only):
this links libstd++ statically.
You will probably need gcc-3.0 for this to produce a portable client-binary.
It is therefore recommended to use CC=gcc-3.0 and CXX=g++-3.0 for this. (Default = no)
--with-boinc-platform=NAME
:
Override the BOINC platform name determined by autoconf;
i.e. Use NAME as platform to compile into the client.
Only necessary if configure does not recognize your platform
correctly by default.
You can check the platform after the configure step by
looking at the value of the HOSTTYPE variable in config.h
--with-boinc-alt-platform=NAME
:
Use this option to build an client that supports an alternate platform name. For example, on a x86_64 linux system that supports both 64 bit and 32 bit executables, you might specify --with-boinc-platform=x86_64-pc-linux-gnu and --with-boinc-alt-platform=i686-pc-linux-gnu.
To set the BOINC client version:
set-version 5.12.47
in the BOINC top-level source directory.
This updates the AC_INIT
line in configure.ac
and regenerates files that use the version numbers
(config.h, py/version.py, test/version.inc, client/win/win_config.h, Makefiles)
The top-level Makefile.am
contains the SUBDIRS=
line
which sets up directory recursion,
and the rules for creating source distributions.
Each subdirectory's Makefile.am
contains the rules for making the binaries
and libraries in that directory and any extra files to distribute.
If you create a new directory with another Makefile.am
, you should
- make sure the directory is referenced by a
SUBDIRS=
line from its parentMakefile.am
- add it to the AC_CONFIG_FILES directive in
configure.ac
.
In the resulting Makefile,
make install
(run as root) will install BOINC libraries in system directories.
Configure options:
--prefix=PREFIX
:
install architecture-independent files in PREFIX [/usr/local
]
By default, make install
will install all the files in /usr/local/bin
, /usr/local/lib
etc.
You can specify an installation prefix other than /usr/local
using --prefix
, for instance --prefix=
.