Difference between revisions of "Developer:Building"

From Open Babel
Jump to: navigation, search
Line 1: Line 1:
In all cases, if you have questions about the building/compiling process for Open Babel, please contact the developer list at [mailto:[email protected]]
+
In all cases, if you have questions about the building/compiling process for Open Babel, please contact the developer list at [mailto:[email protected] [email protected]]
  
 
==UNIX/Linux/Mac OS X==
 
==UNIX/Linux/Mac OS X==
Line 18: Line 18:
  
 
The <code>configure</code> script itself is generated from <code>configure.in</code> by autoconf. It rarely needs changes, except when needed to detect the presence of new libraries on a system. If you think you need to make changes to the configure script, please send an e-mail on the developer list and someone will be glad to point you in the right directions.
 
The <code>configure</code> script itself is generated from <code>configure.in</code> by autoconf. It rarely needs changes, except when needed to detect the presence of new libraries on a system. If you think you need to make changes to the configure script, please send an e-mail on the developer list and someone will be glad to point you in the right directions.
 +
 +
By default on UNIX-like platforms (including [http://www.cygwin.com/ Cygwin], Mac OS X, Linux, etc.) all code is built for shared libraries. There are, however, a few differences, particularly with [http://www.cygwin.com/ Cygwin].
 +
 +
===Build Outputs (Linux, Unix, Mac OS X)===
 +
 +
* src/math/libmath  -- Temporary build library (linked into libopenbabel)
 +
* src/formats/inchi -- libinchi library for [[InChI]] output -- built if not found among the system libraries
 +
* src/formats/ -- Individual shared, loadable file format modules/plugins for each [[:Category:Formats|file format]]
 +
* src/libopenbabel -- Main shared library, including OBConversion, OBError, OBMol, etc.
 +
* src/[[babel]] -- Main command-line binary
 +
* tools/ -- A variety of other command-line binaries including [[obgrep]], [[obchiral]], [[obprop]], etc.
 +
* test/roundtrip -- A testing tool for comparing the chemical equivalence of two files produced during conversion from [[babel]]
 +
* test/ -- A set of [[Developer:Testing|unit tests]]
 +
 +
===Build Outputs (Cygwin)===
 +
 +
On Cygwin, the current build environment has difficulty producing individual file translation shared objects. Therefore, the configure script and Makefiles build "libformats" which is a temporary build library, linked into libopenbabel itself. All shared libraries (i.e., libopenbabel) produce [http://en.wikipedia.org/wiki/Dynamic-link_library DLLs].
 +
 +
* src/math/libmath  -- Temporary build library (linked into libopenbabel)
 +
* src/formats/inchi -- libinchi library for [[InChI]] output -- built if not found among the system libraries
 +
* src/formats/libformat -- Temporary build library including every [[:Category:Formats|file format]] (linked into libopenbabel)
 +
* src/libopenbabel.dll -- Main shared library, including OBConversion, OBError, OBMol, etc.
 +
* src/[[babel]] -- Main command-line binary
 +
* tools/ -- A variety of other command-line binaries including [[obgrep]], [[obchiral]], [[obprop]], etc.
 +
* test/roundtrip -- A testing tool for comparing the chemical equivalence of two files produced during conversion from [[babel]]
 +
* test/ -- A set of [[Developer:Testing|unit tests]]
  
 
==Windows (Visual C++)==
 
==Windows (Visual C++)==
  
The CVS and source distributions should include Visual C++ project files.
+
The SVN and source distributions should include Visual C++ project files. These are used to compile the [[Windows GUI]].
  
 
==Perl and Python Wrappers==
 
==Perl and Python Wrappers==

Revision as of 07:20, 9 May 2006

In all cases, if you have questions about the building/compiling process for Open Babel, please contact the developer list at [email protected]

UNIX/Linux/Mac OS X

The build environment on UNIX-like platforms, including Linux, and Mac OS X involves a variety of tools.

  • autoconf - Used to detect headers, libraries, and other packages to flexibly build on a range of platforms
  • automake - Used to create the "Makefile.in" and "Makefile" build rules
  • libtool - Used to build shared libraries (i.e., libopenbabel) and the shared object modules for file translators

Because these are not always present on every system (often "devel" packages or other developer tools are needed), the build setup is designed to compile the existing source and NOT rebuild the build system itself (i.e., the configure script, babelconfig.h, and the Makefile scripts).

If you intend to add source code files, you should make sure to also edit the build files -- particularly the Makefile.am files used by automake. You will also need to re-run the configure script, e.g.

 ./configure --enable-maintainer-mode

The --enable-maintainer-mode option adds the rules to rebuild Makefiles and other elements of the build environment when changed.

The configure script itself is generated from configure.in by autoconf. It rarely needs changes, except when needed to detect the presence of new libraries on a system. If you think you need to make changes to the configure script, please send an e-mail on the developer list and someone will be glad to point you in the right directions.

By default on UNIX-like platforms (including Cygwin, Mac OS X, Linux, etc.) all code is built for shared libraries. There are, however, a few differences, particularly with Cygwin.

Build Outputs (Linux, Unix, Mac OS X)

  • src/math/libmath -- Temporary build library (linked into libopenbabel)
  • src/formats/inchi -- libinchi library for InChI output -- built if not found among the system libraries
  • src/formats/ -- Individual shared, loadable file format modules/plugins for each file format
  • src/libopenbabel -- Main shared library, including OBConversion, OBError, OBMol, etc.
  • src/babel -- Main command-line binary
  • tools/ -- A variety of other command-line binaries including obgrep, obchiral, obprop, etc.
  • test/roundtrip -- A testing tool for comparing the chemical equivalence of two files produced during conversion from babel
  • test/ -- A set of unit tests

Build Outputs (Cygwin)

On Cygwin, the current build environment has difficulty producing individual file translation shared objects. Therefore, the configure script and Makefiles build "libformats" which is a temporary build library, linked into libopenbabel itself. All shared libraries (i.e., libopenbabel) produce DLLs.

  • src/math/libmath -- Temporary build library (linked into libopenbabel)
  • src/formats/inchi -- libinchi library for InChI output -- built if not found among the system libraries
  • src/formats/libformat -- Temporary build library including every file format (linked into libopenbabel)
  • src/libopenbabel.dll -- Main shared library, including OBConversion, OBError, OBMol, etc.
  • src/babel -- Main command-line binary
  • tools/ -- A variety of other command-line binaries including obgrep, obchiral, obprop, etc.
  • test/roundtrip -- A testing tool for comparing the chemical equivalence of two files produced during conversion from babel
  • test/ -- A set of unit tests

Windows (Visual C++)

The SVN and source distributions should include Visual C++ project files. These are used to compile the Windows GUI.

Perl and Python Wrappers

The Perl and Python wrappers for the Open Babel library are generated using a tool called SWIG:

  • swig - Simplified Wrapper and Interface Generator

These files are auto-generated from the SWIG file "openbabel.i" by the UNIX Makefiles, assuming SWIG is detected by the configure script and --enable-maintainer-mode is used.