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

2016-12-20 Thread Paul Emsley
On 20/12/16 15:13, 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.
>
>

I would try disabling ccache.

Paul.



--
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


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

2016-12-20 Thread Yingfeng Wang
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/
> RDGeneral.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/
> i686-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 Colfax.
> Order your platform today.http://sdm.link/intel
>
>
>
> ___
> Rdkit-discuss mailing 
> listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
>
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based 

Re: [Rdkit-discuss] multiline legend in MolsToGridImage

2016-12-20 Thread Pavel Polishchuk

Thank you, that helped!
I noticed that I need to substantially increase the height of the image 
to make the second line visible. If I'll want to draw more lined I 
should increase the height further.


Pavel.

On 12/20/2016 03:14 PM, Peter Gedeck wrote:

Hello,

I thought we had removed all of these by now. I'll open an issue and 
fix the code.


Best,

Peter


On Tue, Dec 20, 2016 at 6:01 AM David Hall > wrote:


The replace and split methods were removed from the string module
in python3. You can replace the code as follows:

s = s.replace('\r\n', '\n')
s = s.replace('\n\r', '\n')
s = s.replace('\r', '\n')
lines = s.split('\n')


On Tue, Dec 20, 2016 at 2:45 AM, Pavel Polishchuk
> wrote:

Hi,

I try to print multiline legends for molecules in a grid and
use the following code from notebook

  from rdkit import Chem
  from rdkit.Chem import Draw
  # from rdkit.Chem.Draw import IPythonConsole

  mols = [Chem.MolFromSmiles(s) for s in ["CCC", "C"]]
  legends = ["1\nCCC", "2\nC"]
  Draw.MolsToGridImage(mols, molsPerRow=5,
subImgSize=(200,200), legends=legends)

  it returns error: AttributeError: module 'string' has no
attribute 'replace'(full stack is below)

  If I uncomment IPythonConsole import then it returns the
picture with labels, but with spaces instead of new line symbols.

  What can I do in this situation? RDKit 2016.03.2

Kind regards,
Pavel.



---
AttributeError Traceback (most recent call 
last)
  in() 1 mols = [Chem.MolFromSmiles(s) for 
s in ["CCC",
"C"]]2 legends = ["1\nCCC", "2\nC"]> 3p =
Draw.MolsToGridImage(mols, molsPerRow=5, subImgSize=(200,200),

legends=legends)/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/Chem/Draw/__init__.py
in MolsToGridImage(mols, molsPerRow, subImgSize, legends,
highlightAtomLists, useSVG, **kwargs) 387 else:388 return
_MolsToGridImage(mols,molsPerRow=molsPerRow,subImgSize=subImgSize,
--> 389legends=legends, highlightAtomLists=highlightAtomLists,
**kwargs) 390 391 def ReactionToImage(rxn,

subImgSize=(200,200),**kwargs):/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/Chem/Draw/__init__.py
in _MolsToGridImage(mols, molsPerRow, subImgSize, legends,
highlightAtomLists, **kwargs) 334
highlights=highlightAtomLists[i]335 if mol is not None:-->
336img =
_moltoimg(mol,subImgSize,highlights,legends[i],**kwargs)337
res.paste(img,(col*subImgSize[0],row*subImgSize[1]))338 return

res/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/Chem/Draw/__init__.py
in _moltoimg(mol, sz, highlights, legend, **kwargs) 302 if not
hasattr(rdMolDraw2D,'MolDraw2DCairo'):303 img =
MolToImage(mol,sz,legend=legend,highlightAtoms=highlights, -->
304**kwargs) 305 else:306 nmol =

rdMolDraw2D.PrepareMolForDrawing(mol,kekulize=kwargs.get('kekulize',True))/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/Chem/Draw/__init__.py
in MolToImage(mol, size, kekulize, wedgeBonds, fitImage,
options, canvas, **kwargs) 132 #
color=(0,0,1),fill=False,stroke=True)133
font=Font(face='sans',size=12)-->
134canvas.addCanvasText(legend,pos,font)135 136 if

kwargs.get('returnCanvas',False):/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/Chem/Draw/spingCanvas.py
in addCanvasText(self, text, pos, font, color, **kwargs) 72
labelP = pos[0]-txtWidth/2+offset,pos[1]+txtHeight/273 color =
convertColor(color)--->
74self.canvas.drawString(text,labelP[0],labelP[1],font,color=color)75
return (bw,bh,offset)76

/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/sping/PIL/pidPIL.py
in drawString(self, s, x, y, font, color, angle, **kwargs) 313
if '\n' in s or '\r' in s:314 self.drawMultiLineString(s, x,y,
font, color, angle, --> 315**kwargs) 316 return317 if not
font: font =

self.defaultFont/home/pavel/anaconda3/envs/my-rdkit-env/lib/python3.5/site-packages/rdkit/sping/pid.py
in drawMultiLineString(self, s, x, y, font, color, angle,
**kwargs) 393 dy = h * math.cos(angle*math.pi/180.0)394 dx = h
* math.sin(angle*math.pi/180.0)--> 395s = string.replace(s,
'\r\n', '\n')396 s = string.replace(s, '\n\r', '\n')397 s =
string.replace(s, '\r', '\n')AttributeError: module 'string'
has no attribute 'replace'



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

2016-12-20 Thread Paolo Tosco

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/RDGeneral.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/i686-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 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


--
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