Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Path Issue when Using RDKit Conda Install #10

Open
kheyer opened this issue Jan 23, 2021 · 4 comments
Open

CMake Path Issue when Using RDKit Conda Install #10

kheyer opened this issue Jan 23, 2021 · 4 comments

Comments

@kheyer
Copy link

kheyer commented Jan 23, 2021

Thanks for making this available through RDKit!

When I compiled the code, I ran into issues with CMake not finding RDKit libs. I believe this is because I have RDKit installed through Anaconda. Specifically I found ${RDKIT_LIBRARIES} was not set and CMake was picking up a Python install outside of the Anaconda installation I was trying to use. The solution was to add more compile flags:

cmake   -D CMAKE_INSTALL_PREFIX=<install location> \
        -D CMAKE_PREFIX_PATH=$CONDA_PREFIX \
        -D BUILD_RDKIT_SUPPORT=ON \
        -D BUILD_PYTHON_SUPPORT=ON \
        -D RDKIT_INCLUDE_DIR=/anaconda3/envs/myenv/include/rdkit \
        -D Boost_INCLUDE_DIR=/anaconda3/envs/myenv/include \
        -D Python3_FIND_STRATEGY=LOCATION \
        -D PYTHON_INSTDIR=lib/python3.6/site-packages ..

After adding the additional flags, I was able to successfully compile the code.

@TannerW-STX
Copy link

TannerW-STX commented Apr 29, 2021

@kheyer We too had some headaches getting shapeit to compile in conda envs. Thankfully your comment saved us a little time debugging. We also needed to install gxx_linux-64.

Here is a copy and paste of my terminal if it is fruitful for anyone out there:

conda create --name shapeit
conda activate shapeit
conda install -y -c conda-forge rdkit cmake
conda install -y gxx_linux-64
git clone https://github.com/rdkit/shape-it.git
mkdir shape-it_install
cd shape-it
mkdir build && cd build
cmake -D CMAKE_PREFIX_PATH=$CONDA_PREFIX \
-D CMAKE_INSTALL_PREFIX=<path>/shape-it_install/ \
-D BUILD_RDKIT_SUPPORT=ON \
-D BUILD_PYTHON_SUPPORT=ON \
-D PYTHON_INSTDIR=$CONDA_PREFIX/lib/python3.9/site-packages \
-D Boost_INCLUDE_DIR=$CONDA_PREFIX/include/Boost \
-D RDKIT_INCLUDE_DIR=$CONDA_PREFIX/include/rdkit \
-D Python3_FIND_STRATEGY=LOCATION ..
make -j12
make install

@dww100
Copy link

dww100 commented Nov 10, 2021

Doing this today required a small edit - changing the Boost include directory:

-D Boost_INCLUDE_DIR=$CONDA_PREFIX/include/

@dww100
Copy link

dww100 commented Oct 12, 2024

In case it helps anyone currently the above methods runs into issues not finding headers in the current conda-forge version of rdkit. The rdkit channel works using the following recipe (note: this pins the version of Python to 3.7):

conda create --name shapeit
conda activate shapeit
conda install -y -c rdkit rdkit 
conda install -y -c conda-forge cmake gxx_linux-64
git clone https://github.com/rdkit/shape-it.git
mkdir shape-it_install
cd shape-it
mkdir build && cd build
cmake -D CMAKE_PREFIX_PATH=$CONDA_PREFIX \
-D CMAKE_INSTALL_PREFIX=<path>/shape-it_install/ \
-D BUILD_RDKIT_SUPPORT=ON \
-D BUILD_PYTHON_SUPPORT=ON \
-D PYTHON_INSTDIR=$CONDA_PREFIX/lib/python3.7/site-packages \
-D Boost_INCLUDE_DIR=$CONDA_PREFIX/include/ \
-D RDKIT_INCLUDE_DIR=$CONDA_PREFIX/include/rdkit \
-D Python3_FIND_STRATEGY=LOCATION ..
make -j12
make install

@pgoverna
Copy link

pgoverna commented Oct 27, 2024

Hi!
Is this still a valid way to compile?
I tried today and it did not work.
This is the command I used:

cmake -D CMAKE_PREFIX_PATH=$CONDA_PREFIX CMAKE_INSTALL_PREFIX=/home/pgoverna/local/shape-it BUILD_RDKIT_SUPPORT=ON BUILD_PYTHON_SUPPORT=ON PYTHON_INSTDIR=$CONDA_PREFIX/lib/python3.7/site-packages Boost_INCLUDE_DIR=$CONDA_PREFIX/include/ RDKIT_INCLUDE_DIR=$CONDA_PREFIX/include/rdkit Python3_FIND_STRATEGY=LOCATION ..

I got these warnings:

CMake Warning:
  Ignoring extra path from command line:

   "/home/pgoverna/local/shape-it/build/CMAKE_INSTALL_PREFIX=/home/pgoverna/local/shape-it"


CMake Warning:
  Ignoring extra path from command line:

   "Python3_FIND_STRATEGY=LOCATION"

and then this error message:

CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "shapeit_lib":

    "OPENBABEL3_INCLUDE_DIR-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "shape-it":

    "OPENBABEL3_INCLUDE_DIR-NOTFOUND"

Any clue why this is happening?
Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants