Dear Steven,
did you try to open the file in binary mode on the Windows build ans see
if it makes a difference? It does not make any difference on Linux and
OS X, but it will change how newlines are handled on Windows. I suspect
that's where the problem might be. Please get back to me, later I'll try
and reproduce the problem.
Cheers,
p.
On 04/27/16 17:04, Steven Combs wrote:
Hi!
I am writing in c++ and loading an sdf file. This works perfectly for
an osx build, but when I try to load the same file with the windows
build of the program, I get errors and crashing (note: no errors in
either the osx or linux build). I have attached the sdf file as well.
The errors I get are:
[11:57:17] ERROR: Cannot convert to int on line 24
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 51
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 71
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 100
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert to int on line 138
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Cannot convert 1 8 to int on line 171
[11:57:17] ERROR: moving to the begining of the next molecule
[11:57:17] ERROR: Counts line too short: '$$$$' on line231
[11:57:17] ERROR: moving to the begining of the next molecule
Here is the relevant code snippet:
void load_sdf( std::string const & filename, utility::vector1<
::RDKit::ROMolOP> & mol_vector, bool removeHs) {
utility::io::izstream data( filename);
if ( ! data.good() ) {
TR.Error<< "ERROR: Cannot open fragment file '" << filename<< "'"
<< std::endl;
utility_exit_with_message("Cannot open fragment file
"+filename);
}
::RDKit::SDMolSupplier supplier( &data(), /*takeOwnership=*/ false,
/*sanitize=*/ true, removeHs); // Yes, pointer to std::istream - that's what
RDKit wants
while( ! supplier.atEnd() ) {
::RDKit::ROMolOP mol( supplier.next() );
if( mol) {
mol_vector.push_back( mol);
}
}
}
Regards,
Steven Combs
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss