Skip to content

Commit 7ffdaba

Browse files
committed
Add tips on building with Anaconda libobjcryst.
1 parent d72fa2e commit 7ffdaba

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.rst

+20
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pyobjcryst requires Python 2.7, C++ compiler and the following software:
2222
https://github.com/diffpy/libobjcryst
2323
* ``setuptools`` - tools for installing Python packages
2424
* ``NumPy`` - library for scientific computing with Python
25+
* ``scons`` - software constructions tool (1.0 or later)
2526
* ``python-dev`` - header files for interfacing Python with C
2627
* ``libboost-all-dev`` - Boost C++ libraries and development files
2728

@@ -101,6 +102,25 @@ construction environment can be further customized in a ``sconscript.local``
101102
script. The package integrity can be verified by executing unit tests with
102103
``scons -j4 test``.
103104

105+
When developing with Anaconda Python it is essential to specify
106+
header path, library path and runtime library path for the active
107+
Anaconda environment. This can be achieved by setting the ``CPATH``,
108+
``LIBRARY_PATH`` and ``LDFLAGS`` environment variables as follows::
109+
110+
# resolve the prefix directory P of the active Anaconda environment
111+
P="$(conda info --json | grep default_prefix | cut -d\" -f4)"
112+
export CPATH=$P/include
113+
export LIBRARY_PATH=$P/lib
114+
export LDFLAGS=-Wl,-rpath,$P/lib
115+
# compile and re-install pyobjcryst
116+
scons -j4 build=debug develop
117+
118+
On Mac OS X the distributed Anaconda packages are built for operating
119+
system version 10.6, which may be incompatible with codes compiled on a
120+
newer OS. To avoid this problem set the environment variable
121+
``MACOSX_DEPLOYMENT_TARGET=10.6``. This allows to build pyobjcryst
122+
against the Anaconda package for the libobjcryst library.
123+
104124

105125
CONTACTS
106126
--------

0 commit comments

Comments
 (0)