Код: Выделить всё
cmake_minimum_required(VERSION 3.28)
project(Compiler)
set(CMAKE_CXX_STANDARD 17) include_directories("D:\\DEVELOPMENT\\LLVM\\llvm-project\\llvm\\include")
add_executable(Compiler
lexer.yy.cpp
parser.tab.hpp
Ast.hpp
Symbol.hpp
Symbol.cpp
parser.tab.cpp
Ast.cpp )
Код: Выделить всё
#include "llvm/IR/IntrinsicEnums.inc"
#include "llvm/IR/Attributes.inc"
Код: Выделить всё
====================[ Build | Compiler | Debug
]================================
D:\DEVELOPMENT\CLion\bin\cmake\win\x64\bin\cmake.exe --build C:\Users\20786\Desktop\C++\CompilerPrinciple\ExperimentEdition\cmake-build-debug --target Compiler -j 14
[1/4] Building CXX object CMakeFiles/Compiler.dir/Ast.cpp.obj
FAILED: CMakeFiles/Compiler.dir/Ast.cpp.obj
D:\DEVELOPMENT\mingw64\bin\c++.exe -ID:/DEVELOPMENT/LLVM/llvm-project/llvm/include -g -fdiagnostics-color=always -MD -MT CMakeFiles/Compiler.dir/Ast.cpp.obj -MF CMakeFiles\Compiler.dir\Ast.cpp.obj.d -o CMakeFiles/Compiler.dir/Ast.cpp.obj -c C:/Users/20786/Desktop/C++/CompilerPrinciple/ExperimentEdition/Ast.cpp
In file included from D:/DEVELOPMENT/LLVM/llvm-project/llvm/include/llvm/IR/Module.h:22,
from C:/Users/20786/Desktop/C++/CompilerPrinciple/ExperimentEdition/Ast.cpp:7:
D:/DEVELOPMENT/LLVM/llvm-project/llvm/include/llvm/IR/Attributes.h:89:14: fatal error: llvm/IR/Attributes.inc: No such file or directory
89 | #include "llvm/IR/Attributes.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Код: Выделить всё
cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE="Release"
Код: Выделить всё
> CMake Deprecation Warning at
> D:/DEVELOPMENT/LLVM/llvm-project/cmake/Modules/CMakePolicy.cmake:6
> (cmake_policy): The OLD behavior for policy CMP0114 will be removed
> from a future version of CMake.
>
> The cmake-policies(7) manual explains that the OLD behaviors of all
> policies are deprecated and that a policy should be set to OLD only
> under specific short-term circumstances. Projects should be ported
> to the NEW behavior and not rely on setting a policy to OLD. Call
> Stack (most recent call first): CMakeLists.txt:6 (include)
>
>
> CMake Deprecation Warning at
> D:/DEVELOPMENT/LLVM/llvm-project/cmake/Modules/CMakePolicy.cmake:11
> (cmake_policy): The OLD behavior for policy CMP0116 will be removed
> from a future version of CMake.
>
> The cmake-policies(7) manual explains that the OLD behaviors of all
> policies are deprecated and that a policy should be set to OLD only
> under specific short-term circumstances. Projects should be ported
> to the NEW behavior and not rely on setting a policy to OLD. Call
> Stack (most recent call first): CMakeLists.txt:6 (include)
>
>
> -- The C compiler identification is GNU 13.2.0
> -- The CXX compiler identification is GNU 13.2.0
> -- The ASM compiler identification is GNU
> -- Found assembler: D:/DEVELOPMENT/mingw64/bin/gcc.exe
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: D:/DEVELOPMENT/mingw64/bin/gcc.exe - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Check for working CXX compiler: D:/DEVELOPMENT/mingw64/bin/c++.exe - skipped
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Found Python3: C:/DEVELOPMENT/Python3/python.exe (found suitable version "3.11.2", minimum required is "3.8") found components:
> Interpreter
> -- Looking for dlfcn.h
> -- Looking for dlfcn.h - not found
> -- Looking for errno.h
> -- Looking for errno.h - found
> -- Looking for fcntl.h
> -- Looking for fcntl.h - found
> -- Looking for link.h
> -- Looking for link.h - not found
> -- Looking for malloc/malloc.h
> -- Looking for malloc/malloc.h - not found
> -- Looking for signal.h
> -- Looking for signal.h - found
> -- Looking for sys/ioctl.h
> -- Looking for sys/ioctl.h - not found
> -- Looking for sys/mman.h
> -- Looking for sys/mman.h - not found
> -- Looking for sys/param.h
> -- Looking for sys/param.h - found
> -- Looking for sys/resource.h
> -- Looking for sys/resource.h - not found
> -- Looking for sys/stat.h
> -- Looking for sys/stat.h - found
> -- Looking for sys/time.h
> -- Looking for sys/time.h - found
> -- Looking for sys/types.h
> -- Looking for sys/types.h - found
> -- Looking for sysexits.h
> -- Looking for sysexits.h - not found
> -- Looking for termios.h
> -- Looking for termios.h - not found
> -- Looking for unistd.h
> -- Looking for unistd.h - found
> -- Looking for valgrind/valgrind.h
> -- Looking for valgrind/valgrind.h - not found
> -- Looking for fenv.h
> -- Looking for fenv.h - found
> -- Looking for FE_ALL_EXCEPT
> -- Looking for FE_ALL_EXCEPT - found
> -- Looking for FE_INEXACT
> -- Looking for FE_INEXACT - found
> -- Performing Test HAVE_BUILTIN_THREAD_POINTER
> -- Performing Test HAVE_BUILTIN_THREAD_POINTER - Failed
> -- Looking for mach/mach.h
> -- Looking for mach/mach.h - not found
> -- Looking for CrashReporterClient.h
> -- Looking for CrashReporterClient.h - not found
> -- Looking for pfm_initialize in pfm
> -- Looking for pfm_initialize in pfm - not found
> -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
> -- Looking for arc4random
> -- Looking for arc4random - not found
> -- Looking for backtrace
> -- Looking for backtrace - not found
> -- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
> -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
> -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
> -- Looking for __register_frame
> -- Looking for __register_frame - not found
> -- Looking for __deregister_frame
> -- Looking for __deregister_frame - not found
> -- Looking for __unw_add_dynamic_fde
> -- Looking for __unw_add_dynamic_fde - not found
> -- Looking for _Unwind_Backtrace
> -- Looking for _Unwind_Backtrace - found
> -- Looking for getpagesize
> -- Looking for getpagesize - not found
> -- Looking for sysconf
> -- Looking for sysconf - not found
> -- Looking for getrusage
> -- Looking for getrusage - not found
> -- Looking for setrlimit
> -- Looking for setrlimit - not found
> -- Looking for isatty
> -- Looking for isatty - found
> -- Looking for futimens
> -- Looking for futimens - not found
> -- Looking for futimes
> -- Looking for futimes - not found
> -- Looking for sigaltstack
> -- Looking for sigaltstack - not found
> -- Looking for mallctl
> -- Looking for mallctl - not found
> -- Looking for mallinfo
> -- Looking for mallinfo - not found
> -- Looking for mallinfo2
> -- Looking for mallinfo2 - not found
> -- Looking for malloc_zone_statistics
> -- Looking for malloc_zone_statistics - not found
> -- Looking for getrlimit
> -- Looking for getrlimit - not found
> -- Looking for posix_spawn
> -- Looking for posix_spawn - not found
> -- Looking for pread
> -- Looking for pread - not found
> -- Looking for sbrk
> -- Looking for sbrk - not found
> -- Looking for strerror_r
> -- Looking for strerror_r - not found
> -- Looking for strerror_s
> -- Looking for strerror_s - found
> -- Looking for setenv
> -- Looking for setenv - not found
> -- Looking for _chsize_s
> -- Looking for _chsize_s - found
> -- Looking for _alloca
> -- Looking for _alloca - not found
> -- Looking for __alloca
> -- Looking for __alloca - found
> -- Looking for __chkstk
> -- Looking for __chkstk - not found
> -- Looking for __chkstk_ms
> -- Looking for __chkstk_ms - not found
> -- Looking for ___chkstk
> -- Looking for ___chkstk - found
> -- Looking for ___chkstk_ms
> -- Looking for ___chkstk_ms - found
> -- Looking for __ashldi3
> -- Looking for __ashldi3 - not found
> -- Looking for __ashrdi3
> -- Looking for __ashrdi3 - not found
> -- Looking for __divdi3
> -- Looking for __divdi3 - not found
> -- Looking for __fixdfdi
> -- Looking for __fixdfdi - not found
> -- Looking for __fixsfdi
> -- Looking for __fixsfdi - not found
> -- Looking for __floatdidf
> -- Looking for __floatdidf - not found
> -- Looking for __lshrdi3
> -- Looking for __lshrdi3 - not found
> -- Looking for __moddi3
> -- Looking for __moddi3 - not found
> -- Looking for __udivdi3
> -- Looking for __udivdi3 - not found
> -- Looking for __umoddi3
> -- Looking for __umoddi3 - not found
> -- Looking for __main
> -- Looking for __main - found
> -- Looking for __cmpdi2
> -- Looking for __cmpdi2 - not found
> -- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
> -- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
> -- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
> -- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Failed
> -- Looking for __GLIBC__
> -- Looking for __GLIBC__ - not found
> -- Looking for proc_pid_rusage
> -- Looking for proc_pid_rusage - not found
> -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
> -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
> -- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
> -- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
> -- Performing Test LLVM_HAS_ATOMICS
> -- Performing Test LLVM_HAS_ATOMICS - Success
> -- LLVM host triple: x86_64-w64-windows-gnu
> -- Native target architecture is X86
> -- Threads enabled.
> -- Doxygen disabled.
> -- Ninja version: 1.11.1
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
> -- OCaml bindings disabled.
> -- Could NOT find Python module pygments
> -- Could NOT find Python module pygments.lexers.c_cpp
> -- Could NOT find Python module yaml
> -- LLVM default target triple: x86_64-w64-windows-gnu
> -- Performing Test C_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG
> -- Performing Test C_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG - Failed
> -- Performing Test CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG
> -- Performing Test CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG - Failed
> -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
> -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
> -- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
> -- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
> -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
> -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
> -- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
> -- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
> -- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
> -- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
> -- Looking for os_signpost_interval_begin
> -- Looking for os_signpost_interval_begin - not found
> -- Performing Test HAS_WERROR_GLOBAL_CTORS
> -- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
> -- Looking for __x86_64__
> -- Looking for __x86_64__ - found
> -- Found Git: C:/DEVELOPMENT/Git/cmd/git.exe (found version "2.39.1.windows.1")
> -- LLVMHello ignored -- Loadable modules not supported on this platform.
> -- Looking for logf128
> -- Looking for logf128 - not found
> -- Targeting AArch64
> -- Targeting AMDGPU
> -- Targeting ARM
> -- Targeting AVR
> -- Targeting BPF
> -- Targeting Hexagon
> -- Targeting Lanai
> -- Targeting LoongArch
> -- Targeting Mips
> -- Targeting MSP430
> -- Targeting NVPTX
> -- Targeting PowerPC
> -- Targeting RISCV
> -- Targeting Sparc
> -- Targeting SystemZ
> -- Targeting VE
> -- Targeting WebAssembly
> -- Targeting X86
> -- Targeting XCore
> -- BugpointPasses ignored -- Loadable modules not supported on this platform.
> -- Google Benchmark version: v0.0.0, normalized to 0.0.0
> -- Looking for shm_open in rt
> -- Looking for shm_open in rt - not found
> -- Performing Test HAVE_CXX_FLAG_WALL
> -- Performing Test HAVE_CXX_FLAG_WALL - Success
> -- Performing Test HAVE_CXX_FLAG_WEXTRA
> -- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
> -- Performing Test HAVE_CXX_FLAG_WSHADOW
> -- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
> -- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
> -- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
> -- Performing Test HAVE_CXX_FLAG_WOLD_STYLE_CAST
> -- Performing Test HAVE_CXX_FLAG_WOLD_STYLE_CAST - Success
> -- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE
> -- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE - Success
> -- Performing Test HAVE_CXX_FLAG_PEDANTIC
> -- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
> -- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
> -- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
> -- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
> -- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
> -- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
> -- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
> -- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
> -- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success
> -- Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS
> -- Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS - Success
> -- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
> -- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
> -- Performing Test HAVE_CXX_FLAG_WD654
> -- Performing Test HAVE_CXX_FLAG_WD654 - Failed
> -- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
> -- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
> -- Performing Test HAVE_CXX_FLAG_COVERAGE
> -- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
> -- Compiling and running to test HAVE_GNU_POSIX_REGEX
> -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
> -- Compiling and running to test HAVE_POSIX_REGEX
> -- Performing Test HAVE_POSIX_REGEX -- failed to compile CMake Warning at
> D:/DEVELOPMENT/LLVM/llvm-project/third-party/benchmark/CMakeLists.txt:319
> (message): Using std::regex with exceptions disabled is not fully
> supported
>
>
> -- Compiling and running to test HAVE_STEADY_CLOCK
> -- Performing Test HAVE_STEADY_CLOCK -- success
> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
> -- Check if compiler accepts -pthread
> -- Check if compiler accepts -pthread - yes
> -- Found Threads: TRUE
> -- Compiling and running to test HAVE_PTHREAD_AFFINITY
> -- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
> -- Configuring done (35.8s)
> -- Generating done (3.2s)
> -- Build files have been written to: D:/DEVELOPMENT/LLVM/llvm-project/build
Я действительно понятия не имею, что делать дальше, кто-нибудь знает, как это исправить? спасибо большое!
Подробнее здесь: https://stackoverflow.com/questions/786 ... iler-using