Hi,

I have a couple of plugins (DLLs) that are based on RDKit. To minimize deployment issues I build the DLLs with /MT instead of the default /MD so the MSVC runtime libraries will be linked statically into the DLL. And so I won't have to worry about the presence or absence of MSVC runtime DLLs on the target system.

I had to hack a little to get RDKit to build with a static runtime and link it correctly to boost. I am fine with hacking it, as I might be the only one building it this way. But if there is already a way to make cmake build RDKit with a static runtime I'd love to hear about it.

RDKit source files in C:\RDKit_2014_09_1\. InChI sources downloaded. Using boost binaries from http://sourceforge.net/projects/boost/files/boost-binaries/. Doing a 32-bit build.

   set RDBASE=C:\RDKit_2014_09_1
   set PATH=%PATH%;%RDBASE%\lib;c:\local\boost_1_57_0\lib32-msvc-10.0
   cd C:\RDKit_2014_09_1\build
   *# Add to cmake command line: -DBoost_USE_STATIC_LIBS=ON and
   -DBoost_USE_STATIC_RUNTIME=ON**
   *cmake -DBOOST_ROOT=C:/local/boost_1_57_0/
   *-DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON*
   -DRDK_BUILD_PYTHON_WRAPPERS= -DRDK_BUILD_INCHI_SUPPORT=ON -G"Visual
   Studio 10" ..
   # Switch to a Cygwin prompt.
   cd /cygdrive/C/RDKit_2014_09_1/build/
   *# Force compiler to compile with /MT instead of /MD in Release builds.
   *find . -name "*.vcxproj" -type f -exec sed -i
   "s/<RuntimeLibrary>MultiThreadedDLL/<RuntimeLibrary>MultiThreaded/"
   '{}' \;
   *# Remove the BOOST_ALL_DYN_LINK define which will otherwise cause a
   link error in boost's auto_link.hpp.
   *find . -name "*.vcxproj" -type f -exec sed -i
   "s/BOOST_ALL_DYN_LINK;//" '{}' \;

   # Switch back to DOS prompt to build.
   c:/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe /m:4
   /p:Configuration=Release INSTALL.vcxproj


Cheers
-- Jan Holst Jensen
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to