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

MSVC compile error: MolHash scoped enum cannot be redeclared as unscoped #2752

Closed
mcs07 opened this issue Oct 31, 2019 · 3 comments · Fixed by #2824
Closed

MSVC compile error: MolHash scoped enum cannot be redeclared as unscoped #2752

mcs07 opened this issue Oct 31, 2019 · 3 comments · Fixed by #2824
Labels
Milestone

Comments

@mcs07
Copy link
Contributor

mcs07 commented Oct 31, 2019

In preparation for updating the conda-forge recipe, I just attempted to build RDKit on Windows using the Visual Studio compiler version that is used by conda-forge on Azure Pipelines (cmake says MSVC 19.0.24234.1, I believe this is from a VS2017 install with optional extra component VC++ 2015.3 v14).

I get the following error from the new MolHash code:

c:\anaconda\conda-bld\debug_1572451087860\work\code\graphmol\molhash\nmmolhash.h(45): error C3431: 'HashFunction': a scoped enumeration cannot be redeclared as an unscoped enumeration

The RDKit CI on Azure Pipelines (apparently using MSVC 19.16.27034.0) does not seem to have this problem, so I guess it is specific to the older version of the compiler.

Hopefully we could work around this with a patch in the conda-forge recipe? But I haven't been able to figure out how yet.

Configuration:

  • RDKit Version: 2019.09.1
  • Operating system: Windows
@greglandrum
Copy link
Member

@mcs07: I can't test this at the moment, but you might try changing line 45 of nmmolhash.h to:

RDKIT_MOLHASH_EXPORT std::string MolHash(RWMol *mol, HashFunction func);

and line 683 of hashfunctions.cpp to:

std::string MolHash(RWMol *mol, HashFunction func) {

@greglandrum
Copy link
Member

If that works, we can go ahead and make the change on master and fix this for v2019.09.2

@mcs07
Copy link
Contributor Author

mcs07 commented Oct 31, 2019

It works! I'll put in a PR to the conda-forge recipe with this as a temporary patch to update it to 2019.09.1.

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

Successfully merging a pull request may close this issue.

2 participants