File: INSTALL

package info (click to toggle)
rdkit 201203-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 37,840 kB
  • sloc: cpp: 93,902; python: 51,897; java: 5,192; ansic: 3,497; xml: 2,499; sql: 1,641; yacc: 1,518; lex: 1,076; makefile: 325; fortran: 183; sh: 153; cs: 51
file content (421 lines) | stat: -rw-r--r-- 15,620 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
The most recent version of the build instructions can always be found
linked from the RDKit wiki: 
http://code.google.com/p/rdkit/wiki/GettingStarted

The instructions below are for the Q2 2011 release and subsequent releases.

= Building on Linux or the Mac =

== Getting Ready ==
 * Required packages:

   * cmake. You need at least version 2.6. http://www.cmake.org if
     your linux distribution doesn't have an appropriate
     package. _Update: It seems that v2.8 is a better bet than
     v2.6. It might be worth compiling your own copy of v2.8 even if
     v2.6 is already installed._

   * flex and bison. These are frequently already installed if you
     have the various pieces of the development environment
     installed. Note that some Redhat-based systems have an extremely
     ancient version of flex (v2.5.4, from 1997) installed; in order
     to build the RDKit on these systems you need to compile and
     install a more recent version. The source is available at
     http://flex.sourceforge.net.

   * The following are required if you are planning on using the Python wrappers:

      * The python headers. This probably means that you need to
        install the python-dev package (or whatever it's called) for
        your linux distribution.

      * sqlite3. You also need the shared libraries. This may require
        that you install a sqlite3-dev package.

      * You need to have numpy (http://www.scipy.org/NumPy) installed.

 * Optional packages

   * If you would like to install the RDKit InChI support (first
     available in the Q2 2011 release), follow the instructions in
     $RDBASE/External/INCHI-API to get a copy of the InChI source and
     put it in the appropriate place.

== Installing Boost ==

  * *NOTE*: if your linux distribution has a boost-devel package
     including the python and regex libraries, you can use that and
     save yourself the steps below. _Update: if you *do* have a
     version of the boost libraries pre-installed and you want to use
     your own version, be careful when you build the code. We've seen
     at least one example on a Fedora system where cmake compiled
     using a user-installed version of boost and then linked against
     the system version. This led to segmentation faults. There is a
     workaround for this below in the
     [#Frequently_Encountered_Problems Frequently Encountered
     Problems] section._

  * download the boost source distribution from [http://www.boost.org
    the boost web site]

  * extract the source somewhere on your machine
    (e.g. `/usr/local/src/boost_1_45_0`)

  * build the required boost libraries:

    * `cd $BOOST`

    * If you want to use the python wrappers: `./bootstrap.sh --with-libraries=python,regex`

    * If not using the python wrappers: `./bootstrap.sh --with-libraries=regex`

    * Building on 32 bit systems: `./bjam install`

    * Building on 64 bit systems: `./bjam address-model=64 cflags=-fPIC cxxflags=-fPIC install`

    If you have any problems with this step, check the boost
    [http://www.boost.org/more/getting_started/unix-variants.html
    installation instructions].

== Building the Code ==
  * follow the Installing Boost instructions above.

  * environment variables:

    * RDBASE: the root directory of the RDKit distribution (e.g. ~/RDKit)

    * *Linux:* LD_LIBRARY_PATH: make sure it includes $RDBASE/lib and
       wherever the boost shared libraries were installed

    * *Mac:* DYLD_LIBRARY_PATH: make sure it includes $RDBASE/lib and
       wherever the boost shared libraries were installed

    * The following are required if you are planning on using the
      * Python wrappers: PYTHONPATH: make sure it includes $RDBASE

  * Building: 

    * cd to $RDBASE

    * `mkdir build`

    * `cd build`

    * `cmake ..` : See the section below on configuring the build if
      you need to specify a non-default version of python or if you
      have boost in a non-standard location

    * `make` : this builds all libraries, regression tests, and
      wrappers (by default).

    * `make install`

See below for a list of [#Frequently_Encountered_Problems frequently
encountered problems] and solutions.

== Testing the Build (optional, but recommended) ==
  * cd to $RDBASE/build and do `ctest`

  * you're done!

== Advanced ==

=== Specifying an alternate Boost installation ===

You need to tell cmake where to find the boost libraries and header files:

If you have put boost in /opt/local, the cmake invocation would look like:

{{{cmake -DBOOST_ROOT=/opt/local ..}}}

=== Specifying an alternate Python installation ===

You need to tell cmake where to find the python library it should link
against and the python header files.

Here's a sample command line:

{{{cmake -D PYTHON_LIBRARY=/usr/lib/python2.5/config/libpython2.5.a -D PYTHON_INCLUDE_DIR=/usr/include/python2.5/ -D PYTHON_EXECUTABLE=/usr/bin/python ..}}}

The `PYTHON_EXECUTABLE` part is optional if the correct python is the
first version in your PATH.

=== Disabling the Python wrappers ==

You can completely disable building of the python wrappers by setting
the configuration variable RDK_BUILD_PYTHON_WRAPPERS to nil:

{{{cmake -D RDK_BUILD_PYTHON_WRAPPERS= ..}}}

=== Building the Java wrappers ===

*Additional Requirements*

  * SWIG v2.0.x: http://www.swig.org

  * Junit: get a copy of the junit .jar file from
    https://github.com/KentBeck/junit/downloads and put it in the
    directory `$RDBASE/External/java_lib` (you will need to create the
    directory) and rename it to junit.jar.

*Building*

  * When you invoke cmake add `-D RDK_BUILD_SWIG_WRAPPERS=ON` to the
    arguments. For example: {{{cmake -D RDK_BUILD_SWIG_WRAPPERS=ON ..}}}

  * Build and install normally using `make`. The directory
    `$RDBASE/Code/JavaWrappers/gmwrapper` will contain the three
    required files: libGraphMolWrap.so (libGraphMolWrap.jnilib on the
    Mac), org.RDKit.jar, and org.RDKitDoc.jar.

*Using the wrappers*

To use the wrappers, the three files need to be in the same directory,
and that should be on your CLASSPATH and in the java.library.path. An
example using jython:

{{{
% CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar; jython -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper
Jython 2.2.1 on java1.6.0_20
Type "copyright", "credits" or "license" for more information.
>>> from org.RDKit import *
>>> from java import lang
>>> lang.System.loadLibrary('GraphMolWrap')
>>> m = RWMol.MolFromSmiles('c1ccccc1')
>>> m.getNumAtoms()
6L
}}}


== Frequently Encountered Problems ==

In each case I've replaced specific pieces of the path with `...`.

*Problem:*
{{{
Linking CXX shared library libSLNParse.so
/usr/bin/ld: .../libboost_regex.a(cpp_regex_traits.o): relocation R_X86_64_32S against `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage' can not be used when making a shared object; recompile with -fPIC
.../libboost_regex.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Code/GraphMol/SLNParse/libSLNParse.so] Error 1
make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/all] Error 2
make: *** [all] Error 2
}}}

*Solution:*

Add this to the arguments when you call cmake:
`-DBoost_USE_STATIC_LIBS=OFF`

[http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01119.html more information here]

---- 

*Problem:*

{{{
 .../Code/GraphMol/Wrap/EditableMol.cpp:114:   instantiated from here
 .../boost/type_traits/detail/cv_traits_impl.hpp:37: internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:5067
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccgSaXge.out file, please attach this to your bugreport.
make[2]: *** [Code/GraphMol/Wrap/CMakeFiles/rdchem.dir/EditableMol.cpp.o] Error 1
make[1]: *** [Code/GraphMol/Wrap/CMakeFiles/rdchem.dir/all] Error 2
make: *** [all] Error 2
}}}

*Solution:*

Add `#define BOOST_PYTHON_NO_PY_SIGNATURES` at the top of
`Code/GraphMol/Wrap/EditableMol.cpp`

[http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01178.html
more information here]


---- 

*Problem:*

Your system has a version of boost installed in /usr/lib, but you
would like to force the RDKit to use a more recent one.

*Solution:*

This can be solved by using cmake version 2.8.3 (or more recent) and
providing the `-D Boost_NO_SYSTEM_PATHS=ON` argument :

{{{
cmake -D BOOST_ROOT=/usr/local -D Boost_NO_SYSTEM_PATHS=ON ..
}}}


#------------------------------------------------
= Building on Windows =
#------------------------------------------------

== Software to Install ==

  * Microsoft Visual C++ : The Express version has everything
    necessary and can be downloaded for free
    [http://www.microsoft.com/express/download/ from Microsoft]. This
    is a big installation and will take a while. The RDKit has been
    successfully built with all version of visual c++ since 6.0, so
    the current version of VC++ (2008 as of this writing) should be
    fine.

  * flex and bison : these are easily installed as part of a
    [http://www.cygwin.com cygwin] installation, but one can also find
    flex and bison binaries for windows elsewhere. Cygwin is not
    required to build the RDKit, but it's very useful to have (a
    minimal cygwin installation is fine). *Note* if you install flex
    and bison without cygwin, be sure to read
    [http://eli.thegreenplace.net/2007/07/27/bison-looking-for-bisonsimple-on-windows/
    this web page] about environment variables and set the
    BISON_SIMPLE environment variable to the appropriate value.

  * cmake : [http://www.cmake.org/cmake/resources/software.html cmake] should be installed.

  * python : [http://www.python.org/download python] should be installed

  * numpy : the
    [http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
    current version of numpy] should be installed. It's fine to use
    the binary installer.

  * boost : download a copy of the current versions of the
    [http://www.boost.org/users/download/ boost source distribution
    and boost-Jam]. Both are available from the same link, be sure to
    get the `.ntx86.zip` file for boost-Jam.  Extract the source
    distribution (to, for example, c:\boost\boost_1_43_0) and copy the
    bjam.exe executable from the boost jam zip file to the same
    directory. *Note:* it is also possible to download and use a
    precompiled version of the boost libraries from
    http://www.boostpro.com/download/ . When you run the installer,
    the only binary libraries you need are python and regex.

  * a subversion client : _This is only necessary if you are planning
    on building development versions of the RDKit_. A command line
    client for subversion can be installed as part of the cygwin
    installation, or a very nice graphical client that integrates well
    with windows explorer can be downloaded from the
    [http://tortoisesvn.tigris.org/ Tortoise SVN home page].

 * Optional packages

   * If you would like to install the RDKit InChI support (first
     available in the Q2 2011 release), follow the instructions in
     $RDBASE/External/INCHI-API to get a copy of the InChI source and
     put it in the appropriate place.

== Setup and Preparation ==
This section assumes that python is installed in c:\Python26, that the
boost libraries have been extracted to c:\boost\boost_1_43_0, and that
you will build the RDKit from a directory named c:\RDKit. If any of
these conditions is not true, just change the corresponding paths.

_Notes_ :

    # If you install things in paths that have spaces in their names,
      be sure to use quotes properly in your environment variable
      definitions.

    # If you have more than one version of visual studio installed,
      the instructions below may not use the correct compiler. In this
      case you need to use a different `--toolset` argument to specify
      the version of the compiler used in all commands. Information
      for this situation is covered in
      [http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html
      the boost.build documentation].

  * Make sure that boost builds properly by going to the directory
    c:\boost\boost_1_43_0 and executing the command: `.\bjam.exe
    --toolset=msvc --with-regex --with-python release install`. This
    may take a while, but it should finish without errors. _This step
    is not required if you are using a pre-compiled version of boost._

  * If you are planning on using a development version of the RDKit:
    get a copy of the current RDKit source using subversion. If you're
    using the command-line client the command is: `svn co
    http://rdkit.svn.sourceforge.net/svnroot/rdkit/trunk c:\RDKit`

  * If you are planning on using a released version of the RDKit : get
    a copy of the most recent release and extract it into the directory c:\RDKit 

  * Set the required environment variables (you can set this in cygwin
    or in windows. If you set them in windows, be sure to restart your
    cygwin window):

    * RDBASE = c:\RDKit *Note* this variable is optional for the Q3
      2010 release and later releases.

  * Make sure that the directory c:\Python26 is in your PATH

  * Make sure that the directory c:\RDKit\lib is in your PATH

  * Make sure that the directory c:\boost\lib is in your PATH _If you
    are using a precompiled version of boost, make sure the directory
    containing its DLLs is in your path._

  * Make sure that the directory c:\RDKit is in your PYTHONPATH

== Building the Code ==
  * follow the Installing Boost instructions above.

  * environment variables:

    * if you built your own version of boost and cmake complains about
      not being able to find it, define the environment variable
      BOOST_ROOT to point to the directory containing the boost
      source.

  * Configure the build:

    * Start the cmake gui

    * tell it where the source code is (e.g. c:/RDKit) and where to
      build the binaries (recommended: c:/RDKit/build)

    * click "Configure", select your compiler, and wait until the
      basic configuration is complete, you'll see a bunch of red lines
      entries in the main windows.

    * click "Configure" again

    * click "Generate"

  * Build:

    * open the solution file that cmake created
      (c:/RDKit/build/RDKit.sln) with Visual Studio.

    * check to be sure that you're building a Release build (for some
      reason CMake produces solution files that default to doing a
      Debug build)

    * build the "ALL_BUILD" target; this will take a while and
      generate warnings, but there should be no errors. *Note:* if you
      are building the SWIG wrappers you may get an error the first
      time you try to build them. If you see this error, try building
      ALL_BUILD again; it should work the second time.

    * build the "INSTALL" target

== Testing the Build (optional, but recommended) ==
  * cd to $RDBASE/build and run `ctest`

  * you're done!

== Additional notes ==

  * There is a bug in boost v1.44 that causes link errors related to
    boost-serialization on windows. To fix this you need to edit one
    of the boost header
    files. [https://groups.google.com/group/boost-list/msg/066897d43d9ca27a?hl=en
    This post] contains instructions on what needs to be done.

=======
# $Id: INSTALL 1782 2011-07-01 09:34:17Z glandrum $
# Copyright (C) 2008-2010 Greg Landrum