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

add build instructions #173

Open
nicolasparada opened this issue Nov 16, 2022 · 11 comments
Open

add build instructions #173

nicolasparada opened this issue Nov 16, 2022 · 11 comments

Comments

@nicolasparada
Copy link

nicolasparada commented Nov 16, 2022

Add build instructions since there is no release offering for macos.

The steps I had do do were:

  • Install cpack (cmake)
PATH="/Applications/CMake.app/Contents/bin:$PATH"
  • Update bison
brew install bison
export PATH="$(brew --prefix bison)/bin:$PATH"
git clone https://github.com/fluent/cmetrics.git
git submodule update
git submodule update --init
git submodule foreach git pull origin master
cd build
cmake -DCPACK_GENERATOR=productbuild ..
make
cpack -G productbuild

Then double click on the generated .pkg file.

cmetrics-0.7.0-apple.pkg.zip (Built at 22 January 2024).

@nicolasparada
Copy link
Author

Sorry. That doesn't totally installs it for usage.
Now if you try to use the Go module github.com/calyptia/cmetrics-go it will raise the error:

In file included from ../../go/pkg/mod/github.com/calyptia/cmetrics-go@v0.1.6/cmetrics_darwin.go:9:
/usr/local/include/cmetrics/cmetrics.h:40:10: error: 'cfl/cfl.h' file not found with <angled> include; use "quotes" instead
#include <cfl/cfl.h>
         ^~~~~~~~~~~
         "cfl/cfl.h"
In file included from ../../go/pkg/mod/github.com/calyptia/cmetrics-go@v0.1.6/cmetrics_darwin.go:9:
In file included from /usr/local/include/cmetrics/cmetrics.h:40:
/usr/local/include/cmetrics/cfl/cfl.h:27:10: fatal error: 'cfl/cfl_info.h' file not found
#include <cfl/cfl_info.h>
         ^~~~~~~~~~~~~~~~
2 errors generated.

@cosmo0920
Copy link
Contributor

The missing cfl issue should be fixed by fluent/cfl#24.

@cosmo0920
Copy link
Contributor

@nicolasparada I'd appreciated if you could try out to apply the above patch into bundled cfl. Is this possible to solve your header issue?

@nicolasparada
Copy link
Author

nicolasparada commented Nov 17, 2022

I tried with pulling latest code and a git submodule update --init again and then followed the steps to build it. Installed the generated .pkg and now the error changed to:

# github.com/calyptia/cmetrics-go
In file included from ../../go/pkg/mod/github.com/calyptia/cmetrics-go@v0.1.7/cmetrics_darwin.go:9:
In file included from /usr/local/include/cmetrics/cmetrics.h:40:
In file included from /usr/local/include/cfl/cfl.h:33:
/usr/local/include/cfl/cfl_hash.h:26:10: fatal error: '../../lib/xxhash/xxh3.h' file not found
#include "../../lib/xxhash/xxh3.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@nicolasparada
Copy link
Author

@cosmo0920 Still getting the same error btw.

@cosmo0920
Copy link
Contributor

Try git submodule foreach git pull origin master and then cpack -G productbuild.

@nicolasparada
Copy link
Author

That did the trick. Thanks.

@nicolasparada
Copy link
Author

As a note, I got a warning while running make.

/Users/nicolasparada/code/cmetrics/src/cmt_decode_msgpack.c:998:21: warning: incompatible pointer types assigning to 'struct cmt_counter *' from 'struct counter *' [-Wincompatible-pointer-types]
            counter = (struct counter *) decode_context->map->parent;
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

@gabrielbussolo
Copy link

gabrielbussolo commented Nov 24, 2022

i had same issue, but i could solve following the steps here... cant we have a .pkg like we have the .deb on each release? im ignorant on it but we dont have ir right know bcz we need macos to build it? @cosmo0920 @edsiper

@cosmo0920
Copy link
Contributor

Hmm..., it's reasonable to put macOS installer on releases. But, for now, there is no CI instances for M1 Mac. If we decide to release macOS installers, we have to upload macOS installer for M1/M2 manually....

@nicolasparada
Copy link
Author

Would be nice to have releases for mac. But instructions to manually build will do for now.

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

3 participants