Building on windows (ICU install)


#1

Are there any windows users out there using visual studio? What sorts of steps did you take to get the repository to build?

I’m struggling a bit with how to get ICU on my windows PC. Any suggestions?

I love the idea of a text analytics library for C++.

Thanks!


ICU binaries not found Windows VS 2017 cmake
#2

If you have MSVC 2017 and you use the develop branch, things should compile for you. We run this configuration under CI now.

Have a look here: https://github.com/meta-toolkit/meta/blob/develop/.appveyor.yml#L35-L46, which should give you some direction for how to get the dependent libraries set up. (Note that you don’t need to use the Ninja generator; we just do this in CI because it’s faster than MSBuild).

Essentially, you’ll want to download the pre-compiled libraries for ICU from their website and use -DICU_ROOT=WhereverYouExtractedThem in your cmake invocation. You’ll also need to either build zlib from scratch (what we do in CI) or have pre-built binaries for it and use -DZLIB_ROOT=WhereverYouBuiltZlib as well.


#3

Thanks for the quick reply! I used the cmake-gui and added those two options as you suggested.

Everything seems to be working now!

Interestingly, I only needed to add the ZLIB option when compiling in 64 bit. It worked fine without having to explicitly point to the folder when compiling 32.

Thanks again!

Quick notes on how to install for other windows users:

  1. Clone the development branch of the repository to your local drive. (Make sure all the files have cloned.) Github for desktop is pretty helpful for this.
  2. Install zlib at gnuwin32.sourceforge.net/packages/zlib.htm
  3. Download the ICU components and unzip them somewhere icu4c-59_1-Win64-MSVC2015.zip or something like that.
  4. Download and install cmake-gui https://cmake.org/download/
  5. Make sure you have windows visual studio '17.
  6. Run cmake-gui and open the \meta\ folder you cloned to. Then choose a folder to compile to.
  7. Add two additional arguments (Add Item…) both of which are path arguments.
    7a) ZLIB_ROOT = C:\Program Files (something)\GnuWin32\ or something like that
    7b) ICU_ROOT = the top level of the ICU folder (should have subfolders like lib64)
  8. Hit configure, then generate, then open project.
  9. You should be golden at this point.