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

Build flags need documentation #104

Closed
kapilt opened this issue Oct 1, 2014 · 15 comments
Closed

Build flags need documentation #104

kapilt opened this issue Oct 1, 2014 · 15 comments

Comments

@kapilt
Copy link

kapilt commented Oct 1, 2014

The Building wiki doc leaves it as exercise for the user to grep the source for all the build flags. Just document them on the building wiki page.

@kapilt
Copy link
Author

kapilt commented Oct 1, 2014

Its also not very common so documenting how to invoke the tooling with the flags would also be useful

@mschoch
Copy link
Contributor

mschoch commented Oct 1, 2014

Yes I agree the documentation could be improved in this area. Until recently the build tags didn't even exist and it was even harder to build/use. One of the reason the build tags are not on the very front page is we're trying to create an experience where they are not needed for first time users. The beer-search example is an example of where we're not meeting that goal yet. There is a separate issue open to address that: blevesearch/beer-search#2

I have updated the Building wiki page to give a bit more detailed information about the flags. Please take a look and see if this meets your needs, or if you have other suggestions.

https://github.com/blevesearch/bleve/wiki/Building

@kapilt
Copy link
Author

kapilt commented Oct 1, 2014

that looks good though i almost think its worthwhile to have a full example for a given platform with ie

A quick walkthrough of a full installation with all optional dependencies on ubuntu 14.04 trusty:

$ sudo apt-get install libleveldb-dev libstemmer-dev libicu-dev svn build-essential
$ go get -u -v  github.com/blevesearch/bleve
$ cd $GOPATH/github.com/blevesearch/bleve/analysis/token_filters/cld2
$ svn co http://cld2.googlecode.com/svn/trunk cld2-read-only
$ cd cld2-read-only/internal/
$ ./compile_libs.sh
$ sudo cp *.so /usr/local/lib
$ go get -u -v -tags all github.com/blevesearch/bleve

@mschoch
Copy link
Contributor

mschoch commented Oct 1, 2014

Thanks, I've added this section as well.

@kapilt
Copy link
Author

kapilt commented Oct 1, 2014

thanks

@kapilt kapilt closed this as completed Oct 1, 2014
@honza
Copy link

honza commented Feb 17, 2015

compile_libs.sh fails on OSX

@mschoch
Copy link
Contributor

mschoch commented Feb 17, 2015

The compile_libs.sh is a part of the CLD2 source not bleve. Though, last time I ran it, it did work for me on OSX. Can you share any errors or output you're getting.

@honza
Copy link

honza commented Feb 17, 2015

Yes, I know — I was just giving you a heads up. The output is:

Warning: None of CFLAGS, CXXFLAGS or CPPFLAGS is set; you probably should enable some options.
ld: unknown option: -soname=libcld2.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: unknown option: -soname=libcld2_full.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@mschoch
Copy link
Contributor

mschoch commented Feb 17, 2015

Did you checkout revision 164 as described in the readme? The text from the output seems to match some changes made to the script in revision 190.

@honza
Copy link

honza commented Feb 17, 2015

Aha! That one I missed. I just read the above instructions. It's now compiled and in /usr/local/lib.

Here is what I get now:

$ go build -tags full
# github.com/blevesearch/bleve/analysis/tokenizers/icu
../../blevesearch/bleve/analysis/tokenizers/icu/boundary.go:17:11: fatal error: 'unicode/utypes.h' file not found
 #include "unicode/utypes.h"
          ^
1 error generated.

@mschoch
Copy link
Contributor

mschoch commented Feb 17, 2015

Do you have ICU installed, with the headers somewhere your compilers expect to find them?

@saljam
Copy link
Contributor

saljam commented Feb 17, 2015

@honza

$ brew icu4c

installed it for me on OS X.

@honza
Copy link

honza commented Feb 17, 2015

@saljam I installed it with homebrew, no luck. Same error. I guess I don't need icu for now.

@mschoch
Copy link
Contributor

mschoch commented Feb 17, 2015

Brew tells me that, 'This formula is keg-only.'

So it may be that it installed everything, but there are no symlinks hooking it up to a place the compiler is looking by default. I'm not exactly sure as I didn't go this route because previously the brew was very out of date, so I just downloaded ICU, built and installed it myself.

If you can find where brew stuffed things, you could try building with CGO_CFLAGS=-I<path_to_icu_headers>

@atomotic
Copy link

atomotic commented Mar 4, 2015

this works for me on osx:

export CGO_LDFLAGS=-L/usr/local/opt/icu4c/lib
export CGO_CFLAGS=-I/usr/local/opt/icu4c/include
go get -u -v -tags full github.com/blevesearch/bleve

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

5 participants