lscpu | grep popcnt
# output nothing if not support.
# if support: Flags: ... popcnt ...
4. 测试
(rdkit_dev) [jcyang@k168:build]$ cd /tmp/
(rdkit_dev) [jcyang@k168:tmp]$ python
Python 3.7.9 | packaged by conda-forge | (default, Dec 9 2020, 21:08:20)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from rdkit import Chem
>>> from rdkit import DataStructs
>>> from rdkit.Chem import AllChem
>>>
>>> m = Chem.MolFromSmiles('CC')
>>> fp = AllChem.GetMorganFingerprintAsBitVect(m, 2)
>>>
>>> # This function will fail with "Illegal instruction" if not support `popcnt`.
>>> DataStructs.TanimotoSimilarity(fp,fp)
1.0
>>> print("Okay, this machine supports TanimotoSimilarity.")
Okay, this machine supports TanimotoSimilarity.
>>> exit()
(rdkit_dev) [jcyang@k168:tmp]$
1. 安装miniconda
2. 安装依赖
参考:https://www.rdkit.org/docs/Install.html#linux-x86-64-python-3-environment
3. 编译
参考:https://github.com/conda-forge/rdkit-feedstock/blob/master/recipe/build.sh
如果机器太老不支持POPCNT, 请使用
-D RDK_OPTIMIZE_POPCNT=OFF
。Check if the machine supports
popcnt
4. 测试