Re: [Rdkit-discuss] minGW fails to build rdkit

2016-12-21 Thread Yingfeng Wang
Paolo,

Could you please let me know the version of your minGW and how you got or
built boost with minGW. I kept getting errors like "duplicate section" with
different size.

Thanks.

Yingfeng

On Tue, Dec 20, 2016 at 10:13 AM, Yingfeng Wang  wrote:

> Paolo,
>
> Thanks. I figure out this problem. The new cmake command is
>
> cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
> -DMSVC_RUNTIME_DLL=C:/Windows/System32/msvcr100.dll
> -DRDK_USE_BOOST_SERIALIZATION=OFF -DBOOST_ROOT=C:/boost
> -DCMAKE_INSTALL_PREFIX=C:/software/RDKit/install_2016_09_2
> -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW
> Makefiles" ..
>
> In comparison of the old command, I removed "" and replaced "\" by "/".
> The same error does not happen. Then I got a new error, "duplicate section"
> with different size when link to my boost library. I searched internet, and
> it looks this is a compiling problem when I build boost using minGW. I will
> update on you if I get some progress.
>
> Again, thank you very much for your help!
>
> Yingfeng
>
> On Tue, Dec 20, 2016 at 5:13 AM, Paolo Tosco  wrote:
>
>> Dear Yingfeng,
>>
>> I can build the latest RDKIt trunk from a MSYS2 shell using the following
>> cmake command:
>>
>> cmake -DEIGEN3_INCLUDE_DIR=/c/build/include/eigen3
>> -DBOOST_LIBRARYDIR=/mingw64/bin -DBOOST_ROOT=/mingw64
>> -DPYTHON_NUMPY_INCLUDE_PATH=/mingw64/include/python2.7
>> -DRDK_USE_BOOST_SERIALIZATION=OFF -G"MSYS Makefiles" ..
>>
>> I had to switch serialization off to avoid a bunch of errors while
>> building FilterCatalog; so far I haven't had time to investigate this
>> further.
>>
>> You should be able to succeed also from a CMD shell using
>> mingw32-make.exe.
>>
>> Make sure you start from a clean build directory before issuing the cmake
>> command.
>>
>> Cheers,
>> p.
>>
>>
>> On 12/20/16 04:47, Yingfeng Wang wrote:
>>
>> I try to use minGW to build rdkit_2016_09_2, which is from the following
>> link.
>>
>> https://github.com/rdkit/rdkit/archive/Release_2016_09_2.zip
>>
>> cmake command is
>>
>> cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
>> -DMSVC_RUNTIME_DLL="C:\Windows\System32\msvcr100.dll"
>>  -DBOOST_ROOT="C:\boost" 
>> -DCMAKE_INSTALL_PREFIX=C:\software\RDKit\install_2016_09_2
>> -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_PYTHON_WRAPPERS=OFF -G "MinGW
>> Makefiles" ..
>>
>> Error happens when running mingw32-make
>> Error message is given as follows.
>>
>> Scanning dependencies of target RDGeneral
>> [ 12%] Building CXX object Code/RDGeneral/CMakeFiles/RDGe
>> neral.dir/Invariant.cpp.obj
>> 'ccache' is not recognized as an internal or external command,
>> operable program or batch file.
>> Code\RDGeneral\CMakeFiles\RDGeneral.dir\build.make:62: recipe for target
>> 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj' failed
>> mingw32-make[2]: *** 
>> [Code/RDGeneral/CMakeFiles/RDGeneral.dir/Invariant.cpp.obj]
>> Error 1
>> CMakeFiles\Makefile2:494: recipe for target 
>> 'Code/RDGeneral/CMakeFiles/RDGeneral.dir/all'
>> failed
>> mingw32-make[1]: *** [Code/RDGeneral/CMakeFiles/RDGeneral.dir/all] Error
>> 2
>> Makefile:159: recipe for target 'all' failed
>> mingw32-make: *** [all] Error 2
>>
>> By the way, the information of compiler is given in the following.
>>
>> C:\software\RDKit\rdkit-Release_2016_09_2\build>g++ -v
>> Reading specs from c:/mingw_win_build/bin/../lib/
>> gcc/i686-w64-mingw32/4.8.3/specs
>> COLLECT_GCC=g++
>> COLLECT_LTO_WRAPPER=c:/mingw_win_build/bin/../libexec/gcc/i6
>> 86-w64-mingw32/4.8.3
>> /lto-wrapper.exe
>> Target: i686-w64-mingw32
>> Configured with: ../gcc-4.8.3/configure --prefix=/opt/windows_32
>> --with-sysroot=/opt/windows_32 --libdir=/opt/windows_32/lib
>> --mandir=/opt/windows_32/man --infodir=/opt/windows_32/info --enable-shared
>> --disable-bootstrap --disable-multilib--with-arch=pentium3
>> --enable-threads=posix --enable-languages=c,c++ --enable-checking=release
>> --enable-libgomp --with-system-zlib 
>> --with-python-dir=/lib/python2.7/site-packages
>> --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp
>> --with-gnu-ld --verbose --enable-java-home 
>> --with-java-home=/opt/windows_32/lib/jvm/jre
>> --with-jvm-root-dir=/opt/windows_32/lib/jvm
>> --with-jvm-jar-dir=/opt/windows_32/lib/jvm/jvm-exports
>> --with-arch-directory=amd64 --with-antlr-jar='/home/adrien
>> /projects/win-builds-1.5/slackware64-current/d/gcc/antlr-*.jar'
>> --disable-java-awt --disable-gtktest --build=x86_64-slackware-linux
>> --host=i686-w64-mingw32 --target=i686-w64-mingw32
>> Thread model: posix
>> gcc version 4.8.3 (GCC)
>>
>> Could you please give me any hints?
>>
>> Thank you very much in advance!
>>
>> Yingfeng
>>
>>
>> --
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from 

[Rdkit-discuss] Bug in AllChem.EmbedMultipleConfs pruning?

2016-12-21 Thread JW Feng
Hi,

I am using AllChem.EmbedMultipleConfs to generate conformers.  I noticed
that conformers in the result set are very similar to each other.  I wrote
a test script to calculate RMS for the conformers and may have found a
bug.  Looks like AllChem.EmbedMultipleConfs is calculating RMS using all
atoms, including Hs, when pruning.  The documents says pruning is based on
heavy atoms RMS.

Attached is my test script and an input file that illustrates the problem.
In this script, 50 conformers are generated and pruneRmsThresh is 0.5.
Pairwise RMS between conformers are >0.5 when H atoms are included.
Pairwise RMS are <0.5 for many conformers when only heavy atoms are
included.

Thanks,

JW
___
JW Feng, Ph.D.
Denali Therapeutics Inc.
151 Oyster Point Blvd, 2nd Floor, South San Francisco, CA 94080 | (650)
270-0628


21843_confs_output.sdf
Description: Binary data


21843_input.sdf
Description: Binary data
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
import sys
import os
import argparse
from rdkit import Chem
from rdkit.Chem import AllChem

# check to see if there are invalid properties
def main(argv=None):
parser = argparse.ArgumentParser()

# optional requirements, "required=True" makes it NOT optional
parser.add_argument("-in", dest="infile", required=True, help="input file")
parser.add_argument("-out", dest="outfile", required=True, help="output file")
parser.add_argument("-rmsd", dest="prune_rmsd", type=float, default=0.5,
help="RMSD criteria for generating unique confomers."
 " default=0.5")
parser.add_argument("-confs", dest="confs", type=int, default=50, help="number of confs to generate, default=50")
args = None
try:
args = parser.parse_args(argv)
except:
# useful parser functions
parser.print_help()
sys.stderr.write("Input parameters were incorrect, please check help messages\n")
return 2

suppl = Chem.ForwardSDMolSupplier(args.infile)
sd_writer = Chem.SDWriter(args.outfile)

for mol in suppl:
if mol is None:
print("skipping mol", file=sys.stderr)
continue

mol = Chem.AddHs(mol)
#EmbedMultipleConfs((Mol) mol[, (int) numConfs = 10[, (int) maxAttempts = 0[, (int) randomSeed = -1[, (bool)
#  clearConfs = True[, (bool) useRandomCoords = False[, (float) boxSizeMult = 2.0[, (bool) randNegEig = True[, (int)
#  numZeroFail = 1[, (float) pruneRmsThresh = -1.0[, (dict) coordMap = {}[, (float) forceTol = 0.001[, (bool)
#  ignoreSmoothingFailures = False[, (bool) enforceChirality = True[, (int) numThreads = 1[, (bool)
#  useExpTorsionAnglePrefs = False[, (bool) useBasicKnowledge = False[, (bool) printExpTorsionAngles = False
# ]) -> _vecti:
conf_ids = AllChem.EmbedMultipleConfs(mol, numConfs=args.confs, maxAttempts=500, pruneRmsThresh=args.prune_rmsd,
  randomSeed=1, numThreads=0, enforceChirality=True,
  useExpTorsionAnglePrefs=True, useBasicKnowledge=True)
# calculate RMSD between conformers, all should be greater than args.prune_rmsd

sys.stderr.write("RMSD calculated over all atoms, including H\n")
for id1 in conf_ids:
for id2 in conf_ids:
if id1 != id2:
#rms = AllChem.GetBestRMS(mol, mol, id1, id2, maps)
rms = AllChem.GetConformerRMS(mol, id1, id2)
if rms < args.prune_rmsd:
sys.stderr.write("RMSD between conf %d and %d: %.2f\n" % (id1, id2, rms))
break

sys.stderr.write("RMSD calculated over heavy atoms\n")
mol = AllChem.RemoveHs(mol)
for id1 in conf_ids:
for id2 in conf_ids:
if id1 != id2:
#rms = AllChem.GetBestRMS(mol, mol, id1, id2, maps)
rms = AllChem.GetConformerRMS(mol, id1, id2)
if rms < args.prune_rmsd:
sys.stderr.write("Heavy atom RMSD between conf %d and %d: %.2f\n" % (id1, id2, rms))
break

for id in conf_ids:
sd_writer.write(mol, confId=id)
sys.stderr.write("Generated %d conformers\n" % len(conf_ids))

if __name__ == "__main__":
# Let main()'s return value specify the exit status.
sys.exit(main())--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net

[Rdkit-discuss] Re: conda / Windows update to 2016.09 release gives error

2016-12-21 Thread Matthew Swain

I've also encountered this problem with the 2016.09.2 windows packages on the 
rdkit conda channel. It looks like somehow the RDConfig patch in the conda 
recipe hasn't been applied properly in the published packages.

The original lines in the rdkit are:

    condaDir += ['share', 'RDKit']
    _share = os.path.join(*condaDir)

The conda recipe has a Windows-specific patch to change this to:

    condaDir += ['Library','share','RDKit']
    _share = os.path.sep.join(condaDir)

Which looks fine (although the second line doesn't really need changing?). But 
in the published packages it is:

    condaDir += ['share', 'RDKit', 'RDKit']
    _share = os.path.join(condaDir)

This causes the AttributeError because it incorrectly passes a list to 
os.path.join, with no asterisk for unpacking the list into *args. The first 
line is also incorrect.

I built the package myself from the recipe, and didn't see this issue.

Matt

On Dec 09, 2016, at 05:05 PM, Curt Fischer  wrote:

I'm not sure of the source of the problem with the conda 2016.09 release on my 
Windows box, but I was able to revert to a 2016.03 release with a conda install 
-c rmg rdkit=2016.03*

conda couldn't seem to solve the specifications automagically, but after I 
uninstalled boost and did the above command, it identified the proper boost to 
install along with the 2016.03 rdkit.

I now have a functioning rdkit again, but would still be interested in hearing 
from anyone that experiences a similar problem.

On Thu, Dec 8, 2016 at 9:27 AM, Curt Fischer  wrote:
To update rdkit to the September release, I recently did a 

conda install -f --channel https://conda.anaconda.org/rdkit rdkit

on my Windows box, and everything seemed to update fine.  

However now, when I try from rdkit import Chem, I get the disturbing error 
message below.

Is this a sign that my particular installation got borked somehow, and I maybe 
I should reinstall everything again?  Or is this perchance a known issue with 
the 2016.09 release?  If the latter, how do I roll back to the old release 
using conda?  I tried a conda install --channel 
https://conda.anaconda.org/rdkit rdkit=2016.03.4 but that didn't seem to do it.

Thanks all for any help!

Curt

---
AttributeErrorTraceback (most recent call last)
 in ()
> 1 from rdkit import Chem

C:\Anaconda2\lib\site-packages\rdkit\Chem\__init__.py in ()
17 """
18 from rdkit import rdBase
---> 19 from rdkit import RDConfig
20 
21 from rdkit import DataStructs


C:\Anaconda2\lib\site-packages\rdkit\RDConfig.py in ()
31 condaDir[0] = os.path.sep
32   condaDir += ['share', 'RDKit', 'RDKit']
---> 33   _share = os.path.join(condaDir)
34   RDDataDir = os.path.join(_share, 'Data')
35   RDDocsDir = os.path.join(_share, 'Docs')

C:\Anaconda2\lib\ntpath.pyc in join(path, *paths)
63 def join(path, *paths):
64 """Join two or more pathname components, inserting "\\" as needed."""
---> 65 result_drive, result_path = splitdrive(path)
66 for p in paths:
67 p_drive, p_path = splitdrive(p)

C:\Anaconda2\lib\ntpath.pyc in splitdrive(p)
   114 """
   115 if len(p) > 1:
--> 116 normp = p.replace(altsep, sep)
   117 if (normp[0:2] == sep*2) and (normp[2:3] != sep):
   118 # is a UNC path:

AttributeError: 'list' object has no attribute 'replace'

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss