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

Error building on OSX -- fatal error: 'snappy-c.h' file not found #6

Closed
tleyden opened this issue Aug 20, 2014 · 7 comments
Closed

Comments

@tleyden
Copy link
Contributor

tleyden commented Aug 20, 2014

Steps to build:

$ brew install cmake
$ brew install snappy # note, I didn't use "sudo", does that make a difference?
$ git clone <repo>
$ cd forestdb && mkdir build && cd build && cmake ../

Cmake output: https://gist.github.com/tleyden/555a6ea565f768c739f3

When I ran make all, I got an error:

[ 27%] Building CXX object CMakeFiles/docio_test.dir/src/docio.cc.o
/Users/tleyden/DevLibraries/forestdb/src/docio.cc:26:10: fatal error: 'snappy-c.h' file not found
#include "snappy-c.h"
         ^
1 error generated.
make[2]: *** [CMakeFiles/docio_test.dir/src/docio.cc.o] Error 1
make[1]: *** [CMakeFiles/docio_test.dir/all] Error 2
make: *** [all] Error 2

Full make all output: https://gist.github.com/tleyden/86c926a85adfd9d175da

I do have snappy-c.h in my /usr/local/Cellar dir:

$ find /usr/local/Cellar -iname "*snappy*"
/usr/local/Cellar/snappy
/usr/local/Cellar/snappy/1.1.1/include/snappy-c.h
....

but it doesn't seem to be found during the compilation. Is my brew misconfigured or do I need to do another step?

@ajres
Copy link

ajres commented Aug 20, 2014

I repeated these steps, I only diverged with make, I used :

sudo make
sudo make install
sudo make all

All completed without error

@snej
Copy link
Contributor

snej commented Aug 20, 2014

You should file issues in Jira ... Couchbase Server project, ForestDB component.

@mschoch
Copy link

mschoch commented Aug 20, 2014

If we don't want issues filed here, we should disable them in the settings for this project.

@tleyden
Copy link
Contributor Author

tleyden commented Aug 20, 2014

Oh ok. I'm going to close this out anyway, because @ajres tried it and it worked fine for him.

@tleyden tleyden closed this as completed Aug 20, 2014
@josiahjohnston
Copy link

I ran into this same issue, and didn't find a solution posted anywhere. A search led me to this page, so I'm posting my quick fix here.

My quick fix was up environment variables to pass all the library & header paths that I needed (in my case, both openssl & snappy installed from homebrew). If there's a standard way of making homebrew link those to the standard include & lib directories, that might be a better solution.

export LDFLAGS="-L/usr/local/opt/openssl/lib -L/usr/local/opt/snappy/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include -I/usr/local/opt/snappy/include"

@hisundar
Copy link
Contributor

Yup, those look good. Thanks so much @josiahjohnston !

@cantoniazzi
Copy link

Thanks @josiahjohnston your tips works to me. 🥇

ns-codereview pushed a commit that referenced this issue Aug 19, 2021
As reported by ASan:

    ==25822==ERROR: LeakSanitizer: detected memory leaks

    Direct leak of 721424 byte(s) in 11 object(s) allocated from:
	#0 0xffff9f6d18bc in malloc (/opt/gcc-10.2.0/lib64/libasan.so.6+0x9d8bc)
	#1 0x4b0284 in hash_init ../forestdb/src/hash.cc:32
	#2 0x40e254 in _fname_create ../forestdb/src/blockcache.cc:806
	#3 0x410698 in bcache_write ../forestdb/src/blockcache.cc:1063
	#4 0x457dc8 in filemgr_read ../forestdb/src/filemgr.cc:2147
	#5 0x4474d4 in _docio_read_through_buffer(docio_handle*, unsigned long, err_log_callback*, bool) ../forestdb/src/docio.cc:711
	#6 0x4474d4 in _docio_read_length ../forestdb/src/docio.cc:803
	#7 0x44c8c0 in docio_read_doc ../forestdb/src/docio.cc:1242
	#8 0x4d6a3c in fdb_kvs_header_read ../forestdb/src/kv_instance.cc:1142
	#9 0x485b94 in _fdb_open ../forestdb/src/forestdb.cc:2076
	#10 0x4adfbc in _fdb_recover_compaction(_fdb_kvs_handle*, char const*) ../forestdb/src/forestdb.cc:585
	#11 0x4869ac in _fdb_open ../forestdb/src/forestdb.cc:2237
	#12 0x486f74 in fdb_open ../forestdb/src/forestdb.cc:848
	#13 0x525da0 in compact_rename_to_original_test() ../forestdb/tests/functional/compact_functional_test.cc:525
	#14 0x546878 in main ../forestdb/tests/functional/compact_functional_test.cc:3904
	#15 0xffff9e4e2ce0 in __libc_start_main (/lib64/libc.so.6+0x1fce0)
	#16 0x404c4c  (/home/couchbase/server/build/forestdb/tests/functional/compact_functional_test+0x404c4c)

    Direct leak of 721424 byte(s) in 11 object(s) allocated from:
	#0 0xffff9f6d18bc in malloc (/opt/gcc-10.2.0/lib64/libasan.so.6+0x9d8bc)
	#1 0x4b0284 in hash_init ../forestdb/src/hash.cc:32
	#2 0x40e254 in _fname_create ../forestdb/src/blockcache.cc:806
	#3 0x410698 in bcache_write ../forestdb/src/blockcache.cc:1063
	#4 0x457dc8 in filemgr_read ../forestdb/src/filemgr.cc:2147
	#5 0x4474d4 in _docio_read_through_buffer(docio_handle*, unsigned long, err_log_callback*, bool) ../forestdb/src/docio.cc:711
	#6 0x4474d4 in _docio_read_length ../forestdb/src/docio.cc:803
	#7 0x44c8c0 in docio_read_doc ../forestdb/src/docio.cc:1242
	#8 0x4d6a3c in fdb_kvs_header_read ../forestdb/src/kv_instance.cc:1142
	#9 0x485b94 in _fdb_open ../forestdb/src/forestdb.cc:2076
	#10 0x486f74 in fdb_open ../forestdb/src/forestdb.cc:848
	#11 0x524460 in compaction_delete_old_test() ../forestdb/tests/functional/compact_functional_test.cc:345
	#12 0x546874 in main ../forestdb/tests/functional/compact_functional_test.cc:3903
	#13 0xffff9e4e2ce0 in __libc_start_main (/lib64/libc.so.6+0x1fce0)
	#14 0x404c4c  (/home/couchbase/server/build/forestdb/tests/functional/compact_functional_test+0x404c4c)

Change-Id: I6179654af9da764d4ceed04fb2702ca84f43c874
Reviewed-on: http://review.couchbase.org/c/forestdb/+/159308
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
greensky00 added a commit to greensky00/forestdb that referenced this issue Sep 5, 2023
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

7 participants