c# - 尝试使用来自 bp-kelley/rdkit-csharp 的 build.bat 为 RDKit 构建 C# 包装器

标签 c# visual-studio cmake nuget rdkit

我正在尝试为 RDKit 构建 C# 包装器,但一直在努力取得进展。我尝试了两条路线:

注意这个问题很长而且没有帮助。长话短说使用 NuGet(请参阅下面的答案)。


尝试一

来自 RDKit/Code/JavaWrappers/csharp_wrapper 的文档

第一个在https://github.com/rdkit/rdkit中找到.

在 ./Code/JavaWrappers/csharp_wrapper 中有带有构建指令的 C# 包装器,位于:https://github.com/rdkit/rdkit/tree/master/Code/JavaWrappers/csharp_wrapper

我第一次尝试编译包装器涉及手动尝试构建它们。遵循此自述文件:https://github.com/rdkit/rdkit/blob/master/Code/JavaWrappers/csharp_wrapper/README

To build on Windows:

Since cmake doesn't know anything about C#, there's an unfortunate manual step involved in this.

  • Make sure that the cmake configuration variable RDK_BUILD_SWIG_CSHARP_WRAPPER is set to ON.
  • Run cmake to generate the solution file and open it in Visual Studio.
  • Select the option to add an existing project and add $RDBASE/Code/JavaWrappers/csharp_wrapper/RDKit2DotNet.csproj
  • Right click on the added project (named RDKit2DotNet) and add a dependency to RDKFuncs (this is the project that creates the C++ dll that the C# project needs)
  • Build the RDKit2DotNet project.

Your bin directory ($RDBASE/Code/JavaWrappers/csharp_wrapper/bin/Release if you did a release build) now contains two DLLs: - RDKFuncs.dll is the C++ dll containing the RDKit functionality - RDKit2DotNet.dll contains the C# wrapper. To use the wrappers in your own projects, you should copy both dlls into your project directory and add a reference to RDKit2DotNet.dll

The directory RDKitCSharpTest contains a sample test project and some code that makes very basic use of the wrapper functionality.

为了让 cmake 运行,我更新了 CMakeLists.txt 以告诉它如何找到 swig 并设置 RDK_BUILD_SWIG_CSHARP_WRAPPER ON,如下所示:

cmake_minimum_required(VERSION 3.14)
project (GraphMolCSharp)

set(SWIG_FOUND TRUE) # This has been added
set(SWIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # This has been added
set(SWIG_EXECUTABLE swig.exe) # This has been added
set(SWIG_VERSION 4.0) # This has been added

find_package (SWIG) # This has been added
include (UseSWIG) # This has been added

include_directories( ${RDKit_ExternalDir} )

SET(RDK_BUILD_SWIG_CSHARP_WRAPPER ON) # This has been added

# find the gmcs executables on non-windows systems:
if(NOT WIN32)
  find_program(GMCS_EXE gmcs)
  if (NOT GMCS_EXE)
    MESSAGE ("gmcs (executable) is not found. Please add it to PATH and rerun cmake.")
    MESSAGE(FATAL_ERROR "Cannot find required executable gmcs")
  endif (NOT GMCS_EXE)
endif(NOT WIN32)


SET_SOURCE_FILES_PROPERTIES(GraphMolCSharp.i PROPERTIES CPLUSPLUS ON )

# Setup a few variables for environment-specific things
if(WIN32)
  ADD_DEFINITIONS("/W3 /wd4716 /bigobj")
  SET(PATH_SEP ";")
  SET(COPY_CMD xcopy ${COPY_SOURCE} ${COPY_DEST} /Y /I)
else()
  SET(PATH_SEP ":")
  SET(COPY_CMD cp -p ${COPY_SOURCE} ${COPY_DEST})
endif()

# Coax SWIG into playing nicely with Apple environments
if(APPLE)
  SET(CMAKE_SIZEOF_VOID_P 4)
endif(APPLE)

if(CMAKE_SIZEOF_VOID_P MATCHES 4)
  SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap")
else()
  if (WIN32)
    SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64" "-DSWIGWIN")
  else()
      SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64")
  endif()
endif()
SET(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_SOURCE_DIR}/swig_csharp )

if(RDK_BUILD_INCHI_SUPPORT)
  SET(CMAKE_SWIG_FLAGS "-DRDK_BUILD_INCHI_SUPPORT" ${CMAKE_SWIG_FLAGS} )
endif()
if(RDK_BUILD_AVALON_SUPPORT)
  SET(CMAKE_SWIG_FLAGS "-DRDK_BUILD_AVALON_SUPPORT" ${CMAKE_SWIG_FLAGS} )
endif()

FILE(GLOB SWIG_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../*.i")

# we added all source files, now remove the ones that we're not supporting in this build:
if(NOT RDK_BUILD_AVALON_SUPPORT)
LIST(REMOVE_ITEM SWIG_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../AvalonLib.i")
endif()

if(NOT RDK_BUILD_INCHI_SUPPORT)
LIST(REMOVE_ITEM SWIG_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../Inchi.i")
endif()

SET(SWIG_MODULE_RDKFuncs_EXTRA_DEPS ${SWIG_SRC_FILES} )

SWIG_ADD_LIBRARY(RDKFuncs TYPE MODULE LANGUAGE CSharp SOURCES GraphMolCSharp.i )


# it doesnt seem like the threading libs should need to be here, but
# as of Oct 2012 using boost 1.51 under at least ubuntu 12.04 we get a
# link error if they aren't there.
SWIG_LINK_LIBRARIES(RDKFuncs ${RDKit_Wrapper_Libs}
      ${RDKit_THREAD_LIBS} )

INSTALL(TARGETS RDKFuncs
        DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} )


if(NOT WIN32)
   # code adapted from the wrapper code for
   # GDCM: http://gdcm.svn.sf.net/viewvc/gdcm/trunk/Wrapping/Java/CMakeLists.txt?view=markup
   ADD_CUSTOM_COMMAND(
     OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/RDKit2DotNet.dll

     COMMAND ${CMAKE_COMMAND} -E make_directory swig_csharp

     ## 1. run this custom command only after swig has been run.
     COMMAND ${GMCS_EXE} -out:RDKit2DotNet.dll -t:library "swig_csharp/*.cs"
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     DEPENDS "${swig_generated_file_fullname}"
   )
   ADD_CUSTOM_TARGET(RDKFuncsDLL ALL
     DEPENDS RDKFuncs ${CMAKE_CURRENT_SOURCE_DIR}/RDKit2DotNet.dll
     COMMENT "building mono dll"
   )
endif(NOT WIN32)

这会创建许多新文件和一个名为 GraphMolCSharp.sln.sln 文件。 然后我就可以按照 README 中的其余步骤进行操作。我打开了 GraphMolCSharp.sln 并添加了 RDKit2DotNet.csproj 作为项目并添加了 RDKfuncs 作为构建依赖项。但是构建它在 Visual Studio 中出现了很多错误,首先是:

Could not copy the file "D:\Desktop\rdkit-master\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was not found.   RDKit2DotNet            

然后出现很多Unable to find x错误。

如果有人可以就我可能做错的任何事情提供一些指导,请告诉我。


尝试二

第二个使用此处的 build.bat:https://github.com/bp-kelley/rdkit-csharp

开始我跑:

git clone https://github.com/bp-kelley/rdkit-csharp.git
git clone https://github.com/rdkit/rdkit.git
cd rdkit-csharp

然后我更新了 build.bat 以使用 Visual Studio 16 2019,如下所示。

第 95 行:cmake -G "Visual Studio 16 2019"-A x64 ...

第 111 行:cmake -G "Visual Studio 16 2019"...

如果有人能够提供调试以下输出的帮助,我将不胜感激。

我不得不取消以下行:

Downloading: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe to \Desktop\Build\rdkit-csharp\nuget.exe
^CTerminate batch job (Y/N)? n

但已将 nuget.exe 复制到预期位置。

这是运行 build.bat 的大部分输出

**PS D:\Desktop\Build> git clone https://github.com/bp-kelley/rdkit-csharp.git
>> git clone https://github.com/rdkit/rdkit.git
>> cd rdkit-csharp
Cloning into 'rdkit-csharp'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 64 (delta 5), reused 7 (delta 3), pack-reused 52
Unpacking objects: 100% (64/64), done.
Cloning into 'rdkit'...
remote: Enumerating objects: 83, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 61097 (delta 34), reused 38 (delta 22), pack-reused 61014
Receiving objects: 100% (61097/61097), 148.64 MiB | 8.96 MiB/s, done.
Resolving deltas: 100% (46291/46291), done.
Checking out files: 100% (3478/3478), done.
PS D:\Desktop\Build\rdkit-csharp> .\build.bat

///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////

D:\Desktop\Build\rdkit-csharp>call get_nuget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
Downloading: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe to \Desktop\Build\rdkit-csharp\nuget.exe
^CTerminate batch job (Y/N)? n
Running cmake...
Feeds used:
  C:\Users\Sarco\.nuget\packages\
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Attempting to gather dependency information for package 'boost-vc140.1.69.0' with respect to project 'D:\Desktop\Build\rdkit-csharp\Nuget.Local', targeting 'Any,Version=v0.0'

///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////

Build started 11/05/2019 09:36:17.
     1>Project "D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj" on node 1 (Build target(s)).
     1>D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj(32,3): error MSB4019: The imported project "D:\Microsoft
       .Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the fi
       le exists on disk.
     1>Done Building Project "D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj" (Build target(s)) -- FAILED.

Build FAILED.

       "D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj" (Build target) (1) ->
         D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj(32,3): error MSB4019: The imported project "D:\Microso
       ft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the
       file exists on disk.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.14

D:\Desktop\Build\rdkit-csharp\build64>copy Code\JavaWrappers\csharp_wrapper\Release\RDKFuncs.dll Code\JavaWrappers\csharp_wrapper
The system cannot find the path specified.

D:\Desktop\Build\rdkit-csharp\build64>copy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj Code\JavaWrappers\csharp_wrapper
        1 file(s) copied.

D:\Desktop\Build\rdkit-csharp\build64>robocopy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp Code\JavaWrappers\csharp_wrapper\swig_csharp /E

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : 11 May 2019 09:36:17
   Source : D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
     Dest : D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\swig_csharp\

    Files : *.*

  Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

2019/05/11 09:36:17 ERROR 2 (0x00000002) Accessing Source Directory D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
The system cannot find the file specified.

D:\Desktop\Build\rdkit-csharp\build64>copy D:\Desktop\Build\rdkit-csharp\\RDKit.cs  Code\JavaWrappers\csharp_wrapper\swig_csharp\RDKit.cs
The system cannot find the path specified.
        0 file(s) copied.

D:\Desktop\Build\rdkit-csharp\build64>msbuild "Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" /m /p:Configuration=Release /maxcpucount:4 /t:Build /p:Platform=AnyCPU
Microsoft (R) Build Engine version 4.7.3056.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 11/05/2019 09:36:18.
     1>Project "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" on node 1 (
       Build target(s)).
     1>PrepareForBuild:
         Creating directory "bin\Release\".
         Creating directory "obj\Release\".
       GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect t
       o the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prom
         pt /warn:4 /define:TRACE /highentropyva- /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Fra
         mework\.NETFramework\v4.0\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micros
         oft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microso
         ft\Framework\.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micro
         soft\Framework\.NETFramework\v4.0\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Refere
         nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Refe
         rence Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Referen
         ce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Refere
         nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /opti
         mize+ /out:obj\Release\RDKit2DotNet.dll /target:library /utf8output
     1>CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_
       wrapper\RDKit2DotNet.csproj]
     1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy th
       e file "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was not
       found. [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]
     1>Done Building Project "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.cspro
       j" (Build target(s)) -- FAILED.

Build FAILED.

       "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
       ->
       (CoreCompile target) ->
         CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\cshar
       p_wrapper\RDKit2DotNet.csproj]


       "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
       ->
       (_CopyOutOfDateSourceItemsToOutputDirectoryAlways target) ->
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy
       the file "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was no
       t found. [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.63

///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////

-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found Catch2 source in D:/Desktop/Build/rdkit/External/catch/catch
CATCH: D:/Desktop/Build/rdkit/External/catch/catch/single_include
-- Could NOT find InChI in system locations (missing: INCHI_LIBRARY INCHI_INCLUDE_DIR)
CUSTOM_INCHI_PATH = D:/Desktop/Build/rdkit/External/INCHI-API
-- Found InChI software locally
-- Boost version: 1.69.0

-- Looking for pthread.h
///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////

 in D:/Desktop/Build/rdkit/External/CoordGen/maeparser
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.69.0

  Boost include path:
  D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include

  Could not find the following Boost libraries:

          boost_system
          boost_iostreams

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  External/CoordGen/CMakeLists.txt:39 (find_package)


-- coordgen include dir set as coordgen_INCLUDE_DIRS-NOTFOUND
-- coordgen libraries set as 'coordgen_LIBRARIES-NOTFOUND'
-- coordgen templates file set as 'coordgen_TEMPLATE_FILE-NOTFOUND'
-- Could NOT find coordgen (missing: coordgen_INCLUDE_DIRS coordgen_LIBRARIES coordgen_TEMPLATE_FILE)
-- Found coordgenlibs source in D:/Desktop/Build/rdkit/External/CoordGen/coordgen
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.69.0

  Boost include path:
  D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include

  Could not find the following Boost libraries:

          boost_system
          boost_iostreams

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  Code/RDStreams/CMakeLists.txt:4 (find_package)


-- Could NOT find Boost
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.69.0

  Boost include path:
  D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include


  Could not find the following Boost libraries:

          boost_system
          boost_iostreams

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  Code/GraphMol/FileParsers/CMakeLists.txt:7 (find_package)


-- Could NOT find Boost
== Making EnumerateLibrary without boost Serialization support
== Making FilterCatalog without boost Serialization support
-- Found PythonInterp: D:/Program Files/Python36-32/python.exe (found version "3.6.3")
== Updating Filters.cpp from pains file
== Done updating pains files
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Found Cairo: D:/Desktop/Build/rdkit-csharp/Nuget.Local/cairo.1.12.18.0/build/native/include
== Making SubstructLibrary without boost Serialization support
-- Found RapidJSON source in D:/Desktop/Build/rdkit/External
-- Found SWIG: C:/swig/swig.exe (found version "4.0.0")
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.69.0

  Boost include path:
  D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include


  Could not find the following Boost libraries:

          boost_system
          boost_iostreams

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  Code/JavaWrappers/CMakeLists.txt:43 (find_package)


-- Could NOT find Boost
SUFFIX:
JAVA_LIBS: AvalonLib;avalon_clib;RDInchiLib;Inchi;RGroupDecomposition;SubstructLibrary;MolStandardize;FilterCatalog;Catalogs;FMCS;MolDraw2D;FileParsers;SmilesParse;Depictor;SubstructMatch;ChemReactions;Fingerprints;ChemTransforms;Subgraphs;GraphMol;DataStructs;Trajectory;Descriptors;PartialCharges;MolTransforms;DistGeomHelpers;DistGeometry;ForceFieldHelpers;ForceField;EigenSolvers;Optimizer;MolAlign;Alignment;SimDivPickers;RDGeometryLib;RDStreams;RDGeneral
CMake Warning (dev) at D:/Program Files/CMake/share/cmake-3.14/Modules/UseSWIG.cmake:600 (message):
  Policy CMP0078 is not set: UseSWIG generates standard target names.  Run
  "cmake --help-policy CMP0078" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

Call Stack (most recent call first):
  Code/JavaWrappers/csharp_wrapper/CMakeLists.txt:63 (SWIG_ADD_LIBRARY)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at D:/Program Files/CMake/share/cmake-3.14/Modules/UseSWIG.cmake:460 (message):
  Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
  flag.  Run "cmake --help-policy CMP0086" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  D:/Program Files/CMake/share/cmake-3.14/Modules/UseSWIG.cmake:695 (SWIG_ADD_SOURCE_TO_MODULE)
  Code/JavaWrappers/csharp_wrapper/CMakeLists.txt:63 (SWIG_ADD_LIBRARY)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "D:/Desktop/Build/rdkit-csharp/build32/CMakeFiles/CMakeOutput.log".
See also "D:/Desktop/Build/rdkit-csharp/build32/CMakeFiles/CMakeError.log".

D:\Desktop\Build\rdkit-csharp\build32>msbuild "ALL_BUILD.vcxproj" /m /p:PlatformTarget=x86 /p:Configuration=Release /maxcpucount:4 /t:Build
Microsoft (R) Build Engine version 4.7.3056.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj

D:\Desktop\Build\rdkit-csharp\build32>copy Code\JavaWrappers\csharp_wrapper\Release\RDKFuncs.dll Code\JavaWrappers\csharp_wrapper
The system cannot find the path specified.

D:\Desktop\Build\rdkit-csharp\build32>copy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj Code\JavaWrappers\csharp_wrapper
        1 file(s) copied.

D:\Desktop\Build\rdkit-csharp\build32>robocopy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp Code\JavaWrappers\csharp_wrapper\swig_csharp /E

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : 11 May 2019 09:36:36
   Source : D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
     Dest : D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\swig_csharp\

    Files : *.*

  Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

2019/05/11 09:36:36 ERROR 2 (0x00000002) Accessing Source Directory D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
The system cannot find the file specified.

D:\Desktop\Build\rdkit-csharp\build32>copy D:\Desktop\Build\rdkit-csharp\\RDKit.cs  Code\JavaWrappers\csharp_wrapper\swig_csharp\RDKit.cs
The system cannot find the path specified.
        0 file(s) copied.

D:\Desktop\Build\rdkit-csharp\build32>msbuild "Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" /m /p:Configuration=Release /maxcpucount:4 /t:Build /p:Platform=AnyCPU
Microsoft (R) Build Engine version 4.7.3056.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 11/05/2019 09:36:36.
     1>Project "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" on node 1 (
       Build target(s)).
     1>PrepareForBuild:
         Creating directory "bin\Release\".
         Creating directory "obj\Release\".
       GenerateTargetFrameworkMonikerAttribute:
       Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect t
       o the input files.
       CoreCompile:
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prom
         pt /warn:4 /define:TRACE /highentropyva- /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Fra
         mework\.NETFramework\v4.0\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micros
         oft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microso
         ft\Framework\.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micro
         soft\Framework\.NETFramework\v4.0\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Refere
         nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Refe
         rence Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Referen
         ce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Refere
         nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /opti
         mize+ /out:obj\Release\RDKit2DotNet.dll /target:library /utf8output
     1>CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_
       wrapper\RDKit2DotNet.csproj]
     1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy th
       e file "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was not
       found. [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]
     1>Done Building Project "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.cspro
       j" (Build target(s)) -- FAILED.

Build FAILED.

       "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
       ->
       (CoreCompile target) ->
         CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\cshar
       p_wrapper\RDKit2DotNet.csproj]


       "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
       ->
       (_CopyOutOfDateSourceItemsToOutputDirectoryAlways target) ->
         C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy
       the file "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was no
       t found. [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]

    1 Warning(s)**

最佳答案

从未管理过手动编译 RDKit DotNet Wrapper。

但是我确实找到了一个旧版本的 NuGet 包,它满足了我的需要:

https://www.nuget.org/packages/RDKit2DotNet/2017.9.1-alpha1

安装包 RDKit2DotNet -版本 2017.9.1-alpha1

更新

现在有一个可以完美运行的更新版本:

https://www.nuget.org/packages/RDKit.DotNetWrap/

安装包 RDKit.DotNetWrap -版本 0.2019033.1

关于c# - 尝试使用来自 bp-kelley/rdkit-csharp 的 build.bat 为 RDKit 构建 C# 包装器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56088910/

相关文章:

无法将 BLAS 库与 Clion 2016.1.2 和 Fedora 22 链接,获取 undefined reference

c# - 用户控制按钮点击事件

c# - C Sharp 的 andengine

visual-studio - 找不到docker容器

python - 使用python支持错误编译opencv

linux - 使用 -fPIC 重新编译 makefile

c# - 未发现 NUnit v3 单元测试 - "Discover test finished: 0 found"

c# - 是否有任何附加组件/扩展可以让我在 Visual Studio 中使用 F12 存储过程?

visual-studio - 是否有用于在解决方案资源管理器中重命名文件的 Visual Studio 键盘快捷键?

css - 如何删除 Visual Studio "Error List"面板中不必要的 Less 错误