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

fatal error: 'google/sparse_hash_map' file not found #27

Open
shreeshl opened this issue Nov 13, 2017 · 5 comments
Open

fatal error: 'google/sparse_hash_map' file not found #27

shreeshl opened this issue Nov 13, 2017 · 5 comments

Comments

@shreeshl
Copy link

I have installed sparsehash without any troubles. While trying to build fast_align getting the following error:

error:/Users/shreesh/Project/fast_align-master/src/hashtables.h:5:10: fatal error: 'google/sparse_hash_map' file
      not found
#include <google/sparse_hash_map>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/fast_align.dir/src/fast_align.cc.o] Error 1
make[1]: *** [CMakeFiles/fast_align.dir/all] Error 2
make: *** [all] Error 2

I tried manually changing the paths in hashtables.h but still couldn't get it to work.

@mcavdar
Copy link

mcavdar commented Feb 13, 2019

Missed sparsehash library in the path.

Set CMAKE_CXX_FLAGS option(in CMakeLists) to:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -O3 -g -I/usr/local/include")
instead of:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -O3 -g")

@Ejaprgmalr
Copy link

Meet the same problem, tried to set the CMAKE_CXX_FLAGS as above. But it doesn't work for me.

@aj7tesh
Copy link

aj7tesh commented Jul 16, 2020

not working for me too? any update?

@JIE-CHI
Copy link

JIE-CHI commented May 16, 2022

fixed the issue as @mcavdar suggested.
Set CMAKE_CXX_FLAGS option to
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -O3 -g -I/usr/local/include", where /usr/local/include should be the path where the SparseHash was found from the output of cmake ../ command.
Clear the cache by deleting the build directory, then start again.

@raphaelmerx
Copy link

Meet the same problem, tried to set the CMAKE_CXX_FLAGS as above. But it doesn't work for me.

On macOS sparsehash might be on another path, e.g. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -O3 -g -I/opt/homebrew/include")

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

No branches or pull requests

6 participants