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

Can't compile without mesos headers installed in system root #12

Closed
bretthoerner opened this issue Jul 16, 2014 · 7 comments
Closed

Can't compile without mesos headers installed in system root #12

bretthoerner opened this issue Jul 16, 2014 · 7 comments

Comments

@bretthoerner
Copy link

Compilation seems to assume I have mesos headers installed in /usr/local/include, is it possible to compile with mesos installed elsewhere? This may be more of a Go problem than a mesos-go one, but the folks in #mesos asked me to make a ticket for now.

$ go get github.com/mesosphere/mesos-go/example_framework
# github.com/mesosphere/mesos-go/mesos
.go/src/github.com/mesosphere/mesos-go/mesos/executor_driver.cpp:5:30: fatal error: mesos/executor.hpp: No such file or directory
 #include <mesos/executor.hpp>
                              ^
compilation terminated.
@bretthoerner
Copy link
Author

I guess I should note I've tried a bunch of things to put the includes on a path (from env vars, go cmd args, to using the cgo comment pragmas) with no luck so far.

@yifan-gu
Copy link
Member

yifan-gu commented Aug 2, 2014

Hi @bretthoerner
This is an interesting question! Thanks for reporting! So have you tried to set CGO_CFLAGS already?
Hmm, I will try to do some experiments over the weekend. And give you some feedback.

At the meanwhile, I recommend you use the 'refactor' branch under 'github.com/mesosphere/mesos-go' if you haven't yet.
Which replaced those function pointer stuffs with interfaces.(Though it won't solve your problem).

The native go binding is under development, hopefully we can get rid of the libmesos and cgo soon.

Thanks!

@yifan-gu
Copy link
Member

yifan-gu commented Aug 5, 2014

Hi @bretthoerner
By doing go build -n, I found that the include path is not shown when compiling the cpp files. Then I noticed that when compiling the cpp files, it will use CXXFLAGS instead of CFLAGS.
So I fixed the cgo comment pragmas to replace the CFLAGS with CXXFLAGS at the latest master branch.

Now you can either change the #cgo CXXFLAGS to include the path to your installed mesos or change the environment CGO_CXXFLAGS.

Hope that can help!

@nqn
Copy link
Contributor

nqn commented Nov 11, 2014

@bretthoerner Did you get this working?

@bretthoerner
Copy link
Author

I never did, I used Python and Scala for what I needed at the time.

@fmpwizard
Copy link
Contributor

I run into this issue too but was able to solve it by setting some env variable (from this other ticket:
#40 )

now that I read it again, I ended up doing make install to copy the files to the system folders, but even after that , I had to set this up:

LD_LIBRARY_PATH=/usr/local/lib/

in case it helps here.

@vladimirvivien
Copy link
Contributor

Closing as project no longer depend on c-based api.

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