diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fd5bee..6613604 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,9 +7,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
find_package(SparseHash)
if(SPARSEHASH_FOUND)
add_definitions(-DHAVE_SPARSEHASH)
+ include_directories(${SPARSEHASH_INCLUDE_DIR})
endif(SPARSEHASH_FOUND)
-find_package(OpenMP QUIET)
+find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif(OPENMP_FOUND)
diff --git a/README.md b/README.md
index 5f1d0ec..e4329ff 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,22 @@ These can be symmetrized using the included `atools` command using a variety of
./atools -i forward.align -j reverse.align -c grow-diag-final-and
+
+## Compiling for windows
+
+To build 64-bit binaries with libsparsehash on Windows using Visual Studio 2017, the following recipe works:
+
+
+ cd d:\src
+ git clone https://github.com/clab/fast_align.git
+ git clone https://github.com/sparsehash/sparsehash.git
+ cd d:\src\fast_align
+ mkdir build64
+ cd build64
+ cmake -G "Visual Studio 15 2017 Win64" -D SPARSEHASH_INCLUDE_DIR=d:\src\sparsehash\src ..
+ cmake --build build64 --config Release
+
+
## Output
`fast_align` produces outputs in the widely-used `i-j` “Pharaoh format,” where a pair `i-j` indicates that the ith word (zero-indexed) of the left language (by convention, the *source* language) is aligned to the jth word of the right sentence (by convention, the *target* language). For example, a good alignment of the above German–English corpus would be:
diff --git a/src/atools.cc b/src/atools.cc
index ef8967f..628994f 100644
--- a/src/atools.cc
+++ b/src/atools.cc
@@ -6,7 +6,11 @@
#include
#include