@@ -19,7 +19,9 @@ set(LLAMA_FMA OFF)
19
19
set (LLAMA_F16C OFF )
20
20
set (CMAKE_CUDA_FLAGS "--verbose" ) #
21
21
set (CMAKE_CUDA_ARCHITECTURES "60;61;70" ) # needed for f16 CUDA intrinsics
22
- set (CUDACXX /usr/local/cuda-12.2/bin/nvcc)
22
+ set (CUDACXX /usr/local/cuda-12.3/bin/nvcc)
23
+ set (CMAKE_CUDA_COMPILER /usr/local/cuda-12.3/bin/nvcc)
24
+ set (CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda-12.3)
23
25
#GGML_USE_CUBLAS
24
26
25
27
#set(CMAKE_EXE_LINKER_FLAGS -pg)
@@ -128,7 +130,7 @@ option(LLAMA_BUILD_SERVER "llama: build server example"
128
130
# Compile flags
129
131
#
130
132
131
- set (CMAKE_CXX_STANDARD 11 )
133
+ set (CMAKE_CXX_STANDARD 17 )
132
134
set (CMAKE_CXX_STANDARD_REQUIRED true )
133
135
set (CMAKE_C_STANDARD 11)
134
136
set (CMAKE_C_STANDARD_REQUIRED true )
@@ -420,14 +422,15 @@ endif()
420
422
421
423
if (LLAMA_ALL_WARNINGS)
422
424
if (NOT MSVC )
423
- set (warning_flags -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function)
425
+ # -Wpedantic
426
+ set (warning_flags -Wall -Wextra -Wcast-qual -Wno-unused-function)
424
427
set (c_flags -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration)
425
- set (cxx_flags -Wmissing-declarations -Wmissing-noreturn)
428
+ set (cxx_flags -Wmissing-declarations -Wmissing-noreturn -fpermissive )
426
429
set (host_cxx_flags "" )
427
430
428
431
if (CMAKE_C_COMPILER_ID MATCHES "Clang" )
429
432
set (warning_flags ${warning_flags} -Wunreachable-code-break -Wunreachable-code-return)
430
- set (host_cxx_flags ${host_cxx_flags} -Wmissing-prototypes -Wextra-semi)
433
+ set (host_cxx_flags ${host_cxx_flags} -Wmissing-prototypes -Wextra-semi -fpermissive )
431
434
432
435
if (
433
436
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8.0) OR
@@ -437,21 +440,21 @@ if (LLAMA_ALL_WARNINGS)
437
440
endif ()
438
441
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" )
439
442
set (c_flags ${c_flags} -Wdouble-promotion)
440
- set (host_cxx_flags ${host_cxx_flags} -Wno-array-bounds)
443
+ set (host_cxx_flags ${host_cxx_flags} -Wno-array-bounds -fpermissive )
441
444
442
445
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.1.0)
443
- set (host_cxx_flags ${host_cxx_flags} -Wno-format-truncation)
446
+ set (host_cxx_flags ${host_cxx_flags} -Wno-format-truncation -fpermissive )
444
447
endif ()
445
448
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1.0)
446
- set (host_cxx_flags ${host_cxx_flags} -Wextra-semi)
449
+ set (host_cxx_flags ${host_cxx_flags} -Wextra-semi -fpermissive )
447
450
endif ()
448
451
endif ()
449
452
else ()
450
453
# todo : msvc
451
454
endif ()
452
455
453
456
set (c_flags ${c_flags} -save-temps --verbose ${warning_flags} )
454
- set (cxx_flags ${cxx_flags} -save-temps --verbose ${warning_flags} )
457
+ set (cxx_flags ${cxx_flags} -fpermissive -save-temps --verbose ${warning_flags} )
455
458
add_compile_options ("$<$<COMPILE_LANGUAGE:C>:${c_flags} >"
456
459
"$<$<COMPILE_LANGUAGE:CXX>:${cxx_flags} >"
457
460
"$<$<COMPILE_LANGUAGE:CXX>:${host_cxx_flags} >" )
@@ -677,13 +680,13 @@ if (GGML_USE_CPU_HBM)
677
680
endif ()
678
681
679
682
add_library (ggml OBJECT
680
- ggml.c
683
+ ggml.cpp
681
684
ggml.h
682
- ggml-alloc.c
685
+ ggml-alloc.cpp
683
686
ggml-alloc.h
684
- ggml-backend.c
687
+ ggml-backend.cpp
685
688
ggml-backend.h
686
- ggml-quants.c
689
+ ggml-quants.cpp
687
690
ggml-quants.h
688
691
${GGML_SOURCES_CUDA} ${GGML_HEADERS_CUDA}
689
692
${GGML_SOURCES_OPENCL} ${GGML_HEADERS_OPENCL}
0 commit comments