Skip to content

[BUG fix]Building BUG: Fix a building error on windows+ROCm5.7+Cmake #6256

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

Closed
wants to merge 2 commits into from

Conversation

wxf12345
Copy link

[bugfix] building error with Windows+ROCm5.7+Cmake

Bug Description:

environment: Windows11 ROCm5.7 with (AMD 7800XT)

  1. function LOG defined in common/log.h used in ngram-cache.cpp possibly cause the building error on Windows Platform

     Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.obj
     FAILED: common/CMakeFiles/common.dir/ngram-cache.cpp.obj
     llama/llama.cpp/common/./log.h:469:5: error: expected ')'
    
  2. function fprintf used in common/ngram-cache.cpp may cause the same error

function LOG performed well in other obj, but the error raised when building ngram-cache.cpp.obj. Since the function fprintf raise the same error, so I guess that it was caused by ngram-cache related content.
I think removing these logs is a reasonable choice when the exact cause is unknown.

Solve Method:

remove the including of log.h in ngram-cache.cpp
remove the function call LOG in ngram-cache.cpp
remove the function call fprintf in ngram-cache.cpp

Changes to be committed:

modified:   common/ngram-cache.cpp

BUG Detail LOG

[1/57] Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.obj
FAILED: common/CMakeFiles/common.dir/ngram-cache.cpp.obj 
ccache C:\PROGRA~1\AMD\ROCm\5.7\bin\CLANG_~1.EXE -DGGML_CUDA_DMMV_X=32 -DGGML_CUDA_MMV_Y=1 -DGGML_SCHED_MAX_COPIES=4 -DGGML_USE_CUBLAS -DGGML_USE_HIPBLAS -DK_QUANTS_PER_ITERATION=2 -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -IC:/Users/41104/llama/llama.cpp/common/. -IC:/Users/41104/llama/llama.cpp/. -isystem "C:/Program Files/AMD/ROCm/5.7/include" -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=gnu++14 -Wmissing-declarations -Wmissing-noreturn -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi -march=native -MD -MT common/CMakeFiles/common.dir/ngram-cache.cpp.obj -MF common\CMakeFiles\common.dir\ngram-cache.cpp.obj.d -o common/CMakeFiles/common.dir/ngram-cache.cpp.obj -c C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp
In file included from C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp:2:
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:467:5: error: expected ')'
    LOG("01 Hello World to nobody, because logs are disabled!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:467:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:50: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                                 ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:469:5: error: expected ')'
    LOG("02 Hello World to default output, which is \"%s\" ( Yaaay, arguments! )!\n", LOG_STRINGIZE(LOG_TARGET));
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:469:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:56: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                                       ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:284:126: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TEE_TARGET, LOG_TEE_TIMESTAMP_FMT LOG_TEE_FLF_FMT str "%s" LOG_TEE_TIMESTAMP_VAL LOG_TEE_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                                             ^
C:/Users/41104/llama/llama.cpp/common/./log.h:470:5: error: expected ')'
    LOG_TEE("03 Hello World to **both** default output and " LOG_TEE_TARGET_STRING "!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:102: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:470:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:20: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:472:5: error: expected ')'
    LOG("04 Hello World to stderr!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:472:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:56: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                                       ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:284:126: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TEE_TARGET, LOG_TEE_TIMESTAMP_FMT LOG_TEE_FLF_FMT str "%s" LOG_TEE_TIMESTAMP_VAL LOG_TEE_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                                             ^
C:/Users/41104/llama/llama.cpp/common/./log.h:473:5: error: expected ')'
    LOG_TEE("05 Hello World TEE with double printing to stderr prevented!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:102: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:473:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:20: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:475:5: error: expected ')'
    LOG("06 Hello World to default log file!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:475:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:477:5: error: expected ')'
    LOG("07 Hello World to stdout!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:477:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:479:5: error: expected ')'
    LOG("08 Hello World to default log file again!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:479:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:481:5: error: expected ')'
    LOG("09 Hello World _1_ into the void!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:481:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:483:5: error: expected ')'
    LOG("10 Hello World back from the void ( you should not see _1_ in the log or the output )!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:483:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:486:5: error: expected ')'
    LOG("11 Hello World _2_ to nobody, new target was selected but logs are still disabled!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:486:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:488:5: error: expected ')'
    LOG("12 Hello World this time in a new file ( you should not see _2_ in the log or the output )?\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:488:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:490:5: error: expected ')'
    LOG("13 Hello World this time in yet new file?\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:490:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:492:5: error: expected ')'
    LOG("14 Hello World in log with generated filename!\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:492:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:56: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                                       ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:284:126: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TEE_TARGET, LOG_TEE_TIMESTAMP_FMT LOG_TEE_FLF_FMT str "%s" LOG_TEE_TIMESTAMP_VAL LOG_TEE_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                                             ^
C:/Users/41104/llama/llama.cpp/common/./log.h:494:5: error: expected ')'
    LOG_TEE("15 Hello msvc TEE without arguments\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:102: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:494:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:20: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:58: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:284:126: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TEE_TARGET, LOG_TEE_TIMESTAMP_FMT LOG_TEE_FLF_FMT str "%s" LOG_TEE_TIMESTAMP_VAL LOG_TEE_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                                             ^
C:/Users/41104/llama/llama.cpp/common/./log.h:495:5: error: expected ')'
    LOG_TEE("16 Hello msvc TEE with (%d)(%s) arguments\n", 1, "test");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:102: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:495:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:314:31: note: expanded from macro 'LOG_TEE'
    #define LOG_TEE(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "")
                              ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:20: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:323:58: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:284:126: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TEE_TARGET, LOG_TEE_TIMESTAMP_FMT LOG_TEE_FLF_FMT str "%s" LOG_TEE_TIMESTAMP_VAL LOG_TEE_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                                             ^
C:/Users/41104/llama/llama.cpp/common/./log.h:496:5: error: expected ')'
    LOG_TEELN("17 Hello msvc TEELN without arguments\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:323:33: note: expanded from macro 'LOG_TEELN'
    #define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
                                ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:102: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:496:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:323:33: note: expanded from macro 'LOG_TEELN'
    #define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
                                ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:20: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:323:60: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
                                                           ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:284:126: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TEE_TARGET, LOG_TEE_TIMESTAMP_FMT LOG_TEE_FLF_FMT str "%s" LOG_TEE_TIMESTAMP_VAL LOG_TEE_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                                             ^
C:/Users/41104/llama/llama.cpp/common/./log.h:497:5: error: expected ')'
    LOG_TEELN("18 Hello msvc TEELN with (%d)(%s) arguments\n", 1, "test");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:323:33: note: expanded from macro 'LOG_TEELN'
    #define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
                                ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:102: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:497:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:323:33: note: expanded from macro 'LOG_TEELN'
    #define LOG_TEELN(str, ...) LOG_TEE_IMPL("%s" str, "", ##__VA_ARGS__, "\n")
                                ^
C:/Users/41104/llama/llama.cpp/common/./log.h:279:20: note: expanded from macro 'LOG_TEE_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__);                     \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:48: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                               ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                         ^
C:/Users/41104/llama/llama.cpp/common/./log.h:498:5: error: expected ')'
    LOG("19 Hello msvc LOG without arguments\n");
    ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:102: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                                                                                                     ^
C:/Users/41104/llama/llama.cpp/common/./log.h:498:5: note: to match this '('
C:/Users/41104/llama/llama.cpp/common/./log.h:300:27: note: expanded from macro 'LOG'
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                          ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:20: note: expanded from macro 'LOG_IMPL'
            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \
                   ^
C:/Users/41104/llama/llama.cpp/common/./log.h:300:50: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
    #define LOG(str, ...) LOG_IMPL("%s" str, "", ##__VA_ARGS__, "")
                                                 ^
C:/Users/41104/llama/llama.cpp/common/./log.h:251:106: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]

            fprintf(LOG_TARGET, LOG_TIMESTAMP_FMT LOG_FLF_FMT str "%s" LOG_TIMESTAMP_VAL LOG_FLF_VAL "", ##__VA_ARGS__); \

                                                                                                         ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]

46 warnings and 20 errors generated.

ninja: build stopped: subcommand failed.

BUG Detail LOG2 ( fprintf will cause the same error)

[1/57] Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.obj
FAILED: common/CMakeFiles/common.dir/ngram-cache.cpp.obj 
ccache C:\PROGRA~1\AMD\ROCm\5.7\bin\CLANG_~1.EXE -DGGML_CUDA_DMMV_X=32 -DGGML_CUDA_MMV_Y=1 -DGGML_SCHED_MAX_COPIES=4 -DGGML_USE_CUBLAS -DGGML_USE_HIPBLAS -DK_QUANTS_PER_ITERATION=2 -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -IC:/Users/41104/llama/llama.cpp/common/. -IC:/Users/41104/llama/llama.cpp/. -isystem "C:/Program Files/AMD/ROCm/5.7/include" -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=gnu++14 -Wmissing-declarations -Wmissing-noreturn -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi -march=native -MD -MT common/CMakeFiles/common.dir/ngram-cache.cpp.obj -MF common\CMakeFiles\common.dir\ngram-cache.cpp.obj.d -o common/CMakeFiles/common.dir/ngram-cache.cpp.obj -c C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp
C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp:42:41: error: expected ')'
                fprintf(stderr, "%s: %" PRId64 "/%" PRId64 " done, ETA: %02" PRId64 ":%02" PRId64 "\n", __func__, n_done, n_todo, eta_min, eta_s);
                                        ^
C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp:42:24: note: to match this '('
                fprintf(stderr, "%s: %" PRId64 "/%" PRId64 " done, ETA: %02" PRId64 ":%02" PRId64 "\n", __func__, n_done, n_todo, eta_min, eta_s);
                       ^

1 error generated.

ninja: build stopped: subcommand failed.

[bugfix] building error with Windows+ROCm5.7+Cmake

Bug Description:
    function LOG defined in common/log.h  used in ngram-cache.cpp possibly cause the building error on Windows Platform
        Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.obj
        FAILED: common/CMakeFiles/common.dir/ngram-cache.cpp.obj
        llama/llama.cpp/common/./log.h:469:5: error: expected ')'

    function fprintf used in common/ngram-cache.cpp may cause the same error

Solve Method:
    remove the including of log.h in ngram-cache.cpp
    remove the function call LOG in ngram-cache.cpp
    remove the function call fprintf in ngram-cache.cpp

Changes to be committed:
    modified:   common/ngram-cache.cpp
@wxf12345 wxf12345 changed the title Description: Fix a bbuilding erro on windows+ROCm5.7+Cmake [BUG fix]Building BUG: Fix a building error on windows+ROCm5.7+Cmake Mar 23, 2024
@slaren slaren requested a review from JohannesGaessler March 23, 2024 16:03
@JohannesGaessler
Copy link
Collaborator

I observe no compilation issues on Windows (no GPU/CUDA). I don't understand why this is happening. The lines causing issues for LOG should only be called if _MSC_VER is not defined. What happens if you remove only the fprintf call?

@slaren
Copy link
Member

slaren commented Mar 23, 2024

Maybe this is some issue with LOG_NO_FILE_LINE_FUNCTION? Other users of log.h include common.h before, which defines LOG_NO_FILE_LINE_FUNCTION. So maybe including common.h in ngram-cache.cpp would fix it. Ultimately this is an issue with log.h.

For the PRI64d, it needs to include <cstdint>.

@wxf12345
Copy link
Author

I observe no compilation issues on Windows (no GPU/CUDA). I don't understand why this is happening. The lines causing issues for should only be called if is not defined. What happens if you remove only the call?LOG``_MSC_VER``fprintf

If only remove these calls,the error still exists

there is a part of error log, same as list in main description

FAILED: common/CMakeFiles/common.dir/ngram-cache.cpp.obj 
ccache C:\PROGRA~1\AMD\ROCm\5.7\bin\CLANG_~1.EXE -DGGML_CUDA_DMMV_X=32 -DGGML_CUDA_MMV_Y=1 -DGGML_SCHED_MAX_COPIES=4 -DGGML_USE_CUBLAS -DGGML_USE_HIPBLAS -DK_QUANTS_PER_ITERATION=2 -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -IC:/Users/41104/llama/llama.cpp/common/. -IC:/Users/41104/llama/llama.cpp/. -isystem "C:/Program Files/AMD/ROCm/5.7/include" -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -std=gnu++14 -Wmissing-declarations -Wmissing-noreturn -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi -march=native -MD -MT common/CMakeFiles/common.dir/ngram-cache.cpp.obj -MF common\CMakeFiles\common.dir\ngram-cache.cpp.obj.d -o common/CMakeFiles/common.dir/ngram-cache.cpp.obj -c C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp
In file included from C:/Users/41104/llama/llama.cpp/common/ngram-cache.cpp:2:

C:/Users/41104/llama/llama.cpp/common/./log.h:467:5: error: expected ')'
    LOG("01 Hello World to nobody, because logs are disabled!\n");

@wxf12345
Copy link
Author

Maybe this is some issue with ? Other users of include before, which defines . So maybe including in would fix it. Ultimately this is an issue with .LOG_NO_FILE_LINE_FUNCTION``log.h``common.h``LOG_NO_FILE_LINE_FUNCTION``common.h``ngram-cache.cpp``log.h

For the , it needs to include .PRI64d``<cstdint>

I referenced other file(common.h) included log.h , and add a definition #define LOG_NO_FILE_LINE_FUNCTION , then this issue is fixed.
I don't know if defining LOG_NO_FILE_LINE_FUNCTION will have any other impact,so I don't know which method is better for this issue, (add definition) / (remove logs/fprintf),.

@JohannesGaessler
Copy link
Collaborator

@wxf12345 please check whether the version in this PR #6273 works for you.

@wxf12345
Copy link
Author

I have checked the PR #6273 solves this problem on my platform, so I will close this PR.
Thanks for all.

@wxf12345 wxf12345 closed this Mar 24, 2024
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

Successfully merging this pull request may close these issues.

3 participants