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

Installation in Freebsd (Jail) #71

Open
tmerten opened this issue May 3, 2021 · 4 comments
Open

Installation in Freebsd (Jail) #71

tmerten opened this issue May 3, 2021 · 4 comments

Comments

@tmerten
Copy link

tmerten commented May 3, 2021

Hi there,

I am trying to go get go-face on freebsd 1202000 (well, it is used as a dependency in photoview but I guess that does not matter).

  • First I tried to install dlib via a pkg install dlib-cpp which installs version 19.21_1 in /usr/local.
  • Second I built it myself from master, which also installed fine to /usr/local.

However, in both cases I am getting the following:

go get github.com/Kagami/go-face
# github.com/Kagami/go-face
classify.cc:2:10: fatal error: 'dlib/graph_utils.h' file not found

Maybe somebody has an idea. Unfortunately my go experience is in the range zero + search engine.
(This pointed me to #19 but I could not solve anything from there...)

@jacquesh
Copy link

I ran into this same issue while building something else which depends on go-face. I don't know if cgo is meant to use pkg-config (or similar) somehow automatically but really all that was missing was the specification of where the includes and libs are.

Manually adding -I/usr/local/include to the CXXFLAGS comment and adding -L/usr/local/lib to the LDFLAGS comment in face.go got it compiling for me, although I expect that is not the intended workflow.

@tmerten
Copy link
Author

tmerten commented Jun 27, 2021

@jacquesh : thanks, that worked for me, too.

@siavashs
Copy link

siavashs commented Aug 3, 2022

For anyone hitting the same issue, using the following env works without needing to modify any source files.
Here I was building photoview which uses go-face as a dependency:

env CGO_CFLAGS="-I/usr/local/include/" CGO_CXXFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib" go build -v -o photoview .

Since FreeBSD installs all extra libraries in /usr/local it would make sense to add the above flags to CGO in go package on FreeBSD by default for better user experience.
I'll check if it's possible and open a PR for the go package.

@hukl
Copy link

hukl commented Apr 23, 2023

Thanks for the env line - that just saved me a lot of time!

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

4 participants