Command Line Tools High Sierra



  • Mac users who prefer to have a more traditional Unix toolkit accessible to them through the Terminal may wish to install the optional Command Line Tools subsection of the Xcode IDE. From MacOS High Sierra, Sierra, OS X El Capitan, Yosemite, Mavericks onward, this is now easily possible directly and without installing the entire Xcode package.
  • Reboot mac and use Command + R key to enter recovery mode. Disable Daemon, Agent and Phone home. In recovery tools choose Terminal from the Utilities menu; Do following command csrutil disable; Reboot and go again to recovery mode with Command + R key. Use Disk utility to mount main Mac disk, if it is not mounted. Close Disk utility.

Below a number of installation recipes is presented, with varying degree of complexity.

Cross-platform under anaconda python (fastest install)¶

Introduction to anaconda¶

When possible RAF Bomber Command would arrange a diversionary attack which was known as a 'spoof raid', using a small secondary force, often aircraft from Operational Training Units, in an attempt to confuse the enemy night fighter controllers and draw the Luftwaffe night fighters of the Kammhuber line sufficiently far away from the main bomber. . If your Mac is using macOS Sierra or earlier, include the -applicationpath argument and installer path, similar to the way this is done in the command for El Capitan. After typing the command: Press Return to enter the command. When prompted, type your administrator password and press Return again.

Conda is an open-source, cross-platform, software package manager. It supports the packaging and distribution of software components, and manages their installation inside isolated execution environments. It has several analogies with pip and virtualenv, but it is designed to be more “python-agnostic” and more suitable for the distribution of binary packages and their dependencies.

How to get conda¶

The easiest way to get Conda is having it installed as part of the Anaconda Python distribution. A possible (but a bit more complex to use) alternative is provided with the smaller and more self-contained Miniconda. The conda source code repository is available on github and additional documentation is provided by the project website.

Uninstall xcode command line tools high sierraHigh

How to install RDKit with Conda¶

Creating a new conda environment with the RDKit installed requires one single command similar to the following::

Finally, the new environment must be activated so that the corresponding python interpreter becomes available in the same shell:

If for some reason this does not work, try:

Windows users will use a slightly different command:

How to build from source with Conda¶

For more details on building from source with Conda, see the conda-rdkit repository.

macOS 10.12 (Sierra): Python 3 environment¶

The following commands will create a development environment for macOS Sierra and Python 3. DownloadMiniconda3-latest-MacOSX-x86_64.sh from Conda and run thesefollowing commands:

Optionally, add the following packages to your environment as useful development tools.

Then follow the usual build instructions. The PYTHON_INCLUDE_DIR must be set in thecmake command.

Once make and makeinstall completed successfully, use the following command to run the tests:

This is required due to the System Integrity Protection SIPintroduced in more recent macOS versions.

Linux x86_64: Python 3 environment¶

The following commands will create a development environment for Linux x86_64 and Python 3.

Start by downloading the latest anaconda installer from Anaconda and install it. Then, install the required packages:

Numpy and matplotlib are already part of the base installation of anaconda. Due to the latest boost libraries being currently built with a GLIBC version higher than the default in anaconda, we need to update to a more recent version:

At this point, you should be able to clone the RDKit repository to the desired build location, and start the build. Please consider that it is necessary to indicate the path to the numpy headers for RDKit to find them, since anaconda hides them inside the numpy package:

And finally, make, makeinstall and ctest

Installing and using PostgreSQL and the RDKit PostgreSQL cartridge from a conda environment¶

Due to the conda python distribution being a different version to the system python, it is easiest to install PostgreSQL and the PostgreSQL python client via conda.

With your environment activated, this is done simply by:

The conda packages PostgreSQL version needs to be initialized by running the initdb command found in [condafolder]/envs/my-rdkit-env/bin

PostgreSQL can then be run from the terminal with the command:

For most use cases you will instead need to run PostgreSQL as a daemon, one way to do this is using supervisor. You can find out more and how to install supervisor here. The required configuration file will look something like this:

Once PostgreSQL is up and running, all of the normal PostgreSQL commands can then be run when your conda environment is activated. Therefore to create a database you can run:

If you are trying to use multiple installations of PostgreSQL in different environments, you will need to setup different pid files, unix sockets and ports by editing the PostgreSQL config files. With the above configurations these files can be found in /folder/where/data/should/be/stored.

Linux and OS X¶

Installation from repositories¶

Ubuntu 12.04 and later¶

Thanks to the efforts of the Debichem team, RDKit is available via the Ubuntu repositories. To install:

Fedora, CentOS, and RHEL¶

Thanks to Gianluca Sforna’s work, binary RPMs for the RDKit are now part of the official Fedora repositories:https://admin.fedoraproject.org/pkgdb/package/rpms/rdkit/

OS X¶

Eddie Cao has produced a homebrew formula that can be used to easily build the RDKit https://github.com/rdkit/homebrew-rdkit

Building from Source¶

Starting with the 2018_03 release, the RDKit core C++ code is written in modern C++; for this release that means C++11.This means that the compilers used to build it cannot be completely ancient. Here are the minimum tested versions:

  • g++ v4.8: though note that the SLN parser code cannot be built with v4.8. It will automatically be disabled when this older compiler is used.

  • clang v3.9: it may be that older versions of the compiler also work, but we haven’t tested them.

  • Visual Studio 2015: it may be that older versions of the compiler also work, but we haven’t tested them.

Installing prerequisites from source¶

  • Required packages:

    • cmake. You need version 3.1 (or more recent). http://www.cmake.org if your linux distribution doesn’t have an appropriate package.

    • 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 installed.

note

for building with XCode4 on OS X there seems to be a problem with the version of numpy that comes with XCode4. Please see below in the (see faq) section for a workaround.

Installing Boost¶

If your linux distribution has a boost-devel package with a version >= 1.58 including the python and serialization libraries, you can use that and save yourself the steps below.

note

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 (see FAQ) section.

  • download the boost source distribution from the boost web site

  • extract the source somewhere on your machine (e.g. /usr/local/src/boost_1_58_0)

  • build the required boost libraries. The boost site has detailed instructions for this, but here’s an overview:

    • cd$BOOST

    • If you want to use the python wrappers: ./bootstrap.sh--with-libraries=python,serialization

    • If not using the python wrappers: ./bootstrap.sh--with-libraries=serialization

    • ./b2install

If you have any problems with this step, check the boost installation instructions.

Building the RDKit¶

Fetch the source, here as tar.gz but you could use git as well:

  • Ensure that the prerequisites are installed

  • 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

    • OS X: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$RDBASE

    • mkdirbuild

    • cdbuild

    • 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).

    • makeinstall

See below for a list of FAQ and solutions.

Testing the build (optional, but recommended)¶

  • cd$RDBASE/build and do ctest

  • you’re done!

Advanced¶

Specifying install location¶

You need to turn RDK_INSTALL_INTRE off:

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:

Note that if you are using your own boost install on a system with a system install, it’s normally a good idea to also include the argument -DBoost_NO_SYSTEM_PATHS=ON in your cmake command.

Specifying an alternate Python installation¶

If you aren’t using the default python installation for your computer, 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:

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:

Recommended extras¶
  • You can enable support for generating InChI strings and InChI keys by adding the argument -DRDK_BUILD_INCHI_SUPPORT=ON to your cmake command line.

  • You can enable support for the Avalon toolkit by adding the argument -DRDK_BUILD_AVALON_SUPPORT=ON to your cmake command line.

  • If you’d like to be able to generate high-quality PNGs for structure depiction, you should have cairo installed on your system and build the RDKit with cairo support enabled: -DRDK_BUILD_CAIRO_SUPPORT=ON

  • If you’d like to be able to use the 3D descriptors, you need to have a copy of eigen3 installed. Most operating systems have an appropriate package.

Building the Java wrappers¶

Additional Requirements

  • SWIG >v2.0: http://www.swig.org

Building

  • When you invoke cmake add -DRDK_BUILD_SWIG_WRAPPERS=ON to the arguments. For example: cmake-DRDK_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 OS X), 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:

Optional packages¶
  • If you would like to install the RDKit InChI support, follow the instructions in $RDBASE/External/INCHI-API/README.

  • If you would like to install the RDKit Avalon toolkit support, follow the instructions in $RDBASE/External/AvalonTool/README.

  • If you would like to build and install the PostgreSQL cartridge, follow the instructions in $RDBASE/Code/PgSQL/rdkit/README.

Frequently Encountered Problems¶

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

Problem: :

Solution:

Command Line Tools (macos High Sierra Version 10.13) For Xcode-10.1

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

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

Problem: :

Solution:

Add #defineBOOST_PYTHON_NO_PY_SIGNATURES at the top of Code/GraphMol/Wrap/EditableMol.cpp

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

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 providing the -DBoost_NO_SYSTEM_PATHS=ON argument:

Problem:

Building on OS X with XCode 4

The problem seems to be caused by the version of numpy that is distributed with XCode 4, so you need to build a fresh copy.

Solution: Get a copy of numpy and build it like this as root: as root:

Be sure that the new numpy is used in the build:

and is at the beginning of the PYTHONPATH:

Now it’s safe to build boost and the RDKit.

Windows¶

Prerequisites¶

Update Xcode Command Line Tools High Sierra

  • python 3.6+ (from http://www.python.org/)

  • numpy (from http://numpy.scipy.org/ or use pipinstallnumpy). Binaries for win64 are available here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

  • Pillow: (from https://python-pillow.github.io/> or use pipinstallPillow)

Recommended extras¶

  • matplotlib: a library for scientific plotting from Python. http://matplotlib.sourceforge.net/

  • ipython : a very useful interactive shell (and much more) for Python. http://ipython.scipy.org/dist/

Installation from source¶

Command Line Tools High Sierra

Extra software to install¶

  • Microsoft Visual C++ : The Community version has everything necessary and can be downloaded for free (https://www.visualstudio.com/vs/community). This is a big installation and will take a while. The RDKit has been built with Visual Studio 2015 and 2017. More recent versions should be fine.

  • cmake : (http://www.cmake.org/cmake/resources/software.html) should be installed.

  • boost : It is strongly recommended to download and use a precompiled version of the boost libraries from http://sourceforge.net/projects/boost/files/boost-binaries/ . When you run the installer, the only binary libraries you need are python and serialization. If you want to install boost from source, download a copy from http://www.boost.org and follow the instructions in the “Getting Started” section of the documentation. Make sure the libraries and headers are installed to C:boost

  • a git client : This is only necessary if you are planning on building development versions of the RDKit. This can be downloaded from http://git-scm.com/downloads; git is also included as an optional add-on of Microsoft Visual Studio 2015.

Setup and Preparation¶

This section assumes that python is installed in C:Python36thattheboostlibrarieshavebeeninstalledtoC:boost,andthatyouwillbuildtheRDKitfromadirectorynamedC:RDKit`. If any of these conditions is not true, just change the corresponding paths.

  • 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 are planning on using a development version of the RDKit: get a copy of the current RDKit source using git. If you’re using the command-line client the command is: gitclonehttps://github.com/rdkit/rdkit.gitC: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:

    • RDBASE=C:RDKit

    • Make sure `C:Python36 is in your PATH

    • Make sure C:RDKitlib is in your PATH

    • Make sure C:boostlib is in your PATH.

    • Make sure C:RDKitis in your PYTHONPATH

Xcode Command Line Tools High Sierra

Building from the command line (recommended)¶

  • Create a directory C:RDKitbuild and cd into it

  • Run cmake. Here’s an example basic command line for 64bit windows that will download the InChI and Avalon toolkit sources from the InChI Trust and SourceForge repositories, respectively, and build the PostgreSQL cartridge for the installed version of PostgreSQL:
    cmake-DRDK_BUILD_PYTHON_WRAPPERS=ON-DBOOST_ROOT=C:/boost-DRDK_BUILD_INCHI_SUPPORT=ON-DRDK_BUILD_AVALON_SUPPORT=ON-DRDK_BUILD_PGSQL=ON-DPostgreSQL_ROOT='C:ProgramFilesPostgreSQL9.5'-G'VisualStudio142015Win64'..

  • Build the code. Here’s an example command line:
    C:/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe/m:4/p:Configuration=ReleaseINSTALL.vcxproj

  • If you have built in PostgreSQL support, you will need to open a shell with administrator privileges, stop the PostgreSQL service, run the pgsql_install.bat installation script, then restart the PostgreSQL service (please refer to %RDBASE%CodePgSQLrdkitREADME for further details):

    • 'C:ProgramFilesPostgreSQL9.5binpg_ctl.exe'-N'postgresql-9.5'-D'C:ProgramFilesPostgreSQL9.5data'-wstop

    • C:RDKitbuildCodePgSQLrdkitpgsql_install.bat

    • 'C:ProgramFilesPostgreSQL9.5binpg_ctl.exe'-N'postgresql-9.5'-D'C:ProgramFilesPostgreSQL9.5data'-wstart

    • Before restarting the PostgreSQL service, make sure that the Boost libraries the RDKit was built against are in the system PATH, or PostgreSQL will fail to create the rdkit extension with a deceptive error message such as:
      ERROR:couldnotloadlibrary'C:/ProgramFiles/PostgreSQL/9.5/lib/rdkit.dll':Thespecifiedmodulecouldnotbefound.

Command Line Tools High Sierra Download

Testing the Build (optional, but recommended)¶

  • cd to C:RDKitbuild and run ctest. Please note that if you have built in PostgreSQL support, the current logged in user needs to be a PostgreSQL user with database creation and superuser privileges, or the PostgreSQL test will fail. A convenient option to authenticate will be to set the PGPASSWORD environment variable to the PostgreSQL password of the current logged in user in the shell from which you are running ctest.

  • You’re done!

License¶

Uninstall Xcode Command Line Tools High Sierra

This document is copyright (C) 2012-2020 by Greg Landrum

Command Line Tools Macos High Sierra

This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.

The intent of this license is similar to that of the RDKit itself. In simple words: “Do whatever you want with it, but please give us some credit.”