Skip to content

Fix includes in arg.cpp and gemma3-cli.cpp #12766

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

Merged
merged 2 commits into from
Apr 5, 2025

Conversation

barracuda156
Copy link
Contributor

Wonder how this was missed. The source uses filesystem, but does not include it.

@barracuda156 barracuda156 changed the title Fix the build: arg.c: add a missing <filesystem> include Fix includes in arg.cpp and gemma3-cli.cpp Apr 5, 2025
@ngxson
Copy link
Collaborator

ngxson commented Apr 5, 2025

I think cinttype is not necessary in gemma3-cli, isn't it ?

@barracuda156
Copy link
Contributor Author

I think cinttype is not necessary in gemma3-cli, isn't it ?

As long as __STDC_FORMAT_MACROS are defined, C header will still work, AFAIK. I changed it to C++ one for style reason, that can be dropped, only __STDC_FORMAT_MACROS are required there.

@ngxson
Copy link
Collaborator

ngxson commented Apr 5, 2025

I mean, the code of this example is the same as all other examples. If you're changing this in one example you should either:

  1. Move this change to a common header, like common.h
  2. Or, apply it to every other files.

@barracuda156
Copy link
Contributor Author

I mean, the code of this example is the same as all other examples.

It is not. It is the only file here which uses PRI* macros, but does not include cinttypes.

LOG("Image encoded in %" PRId64 " ms\n", ggml_time_ms() - t0);

In every other place cinttypes is already included. __STDC_FORMAT_MACROS are not defined, but my compiler is satisfied with just cinttypes, so I did not get errors on other files. But some compilers still need __STDC_FORMAT_MACROS even with cinttypes.

But you are right, identical change should be made in other places as well.

@github-actions github-actions bot added testing Everything test related server ggml changes relating to the ggml tensor library for machine learning labels Apr 5, 2025
ngxson
ngxson previously approved these changes Apr 5, 2025
@ngxson ngxson dismissed their stale review April 5, 2025 14:24

I think _STDC_FORMAT_MACROS should be removed

@barracuda156
Copy link
Contributor Author

@ngxson Ok, I drop them, and change the header in gemma3-cli.cpp to the appropriate one.

@barracuda156
Copy link
Contributor Author

@ngxson @ggerganov Done

@ngxson ngxson merged commit f1e3eb4 into ggml-org:master Apr 5, 2025
51 checks passed
@barracuda156
Copy link
Contributor Author

Thanks for merging!

@barracuda156 barracuda156 deleted the filesystem branch April 5, 2025 15:51
colout pushed a commit to colout/llama.cpp that referenced this pull request Apr 29, 2025
* arg.cpp: add a missing include

* gemma3-cli.cpp: fix cinttypes include
timwu pushed a commit to timwu/llama.cpp that referenced this pull request May 5, 2025
* arg.cpp: add a missing include

* gemma3-cli.cpp: fix cinttypes include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples ggml changes relating to the ggml tensor library for machine learning server testing Everything test related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants