Building SourceMod, вопросы

Тема в разделе "Программирование / Скриптинг", создана пользователем SHAREN, 26 янв 2016.

  1. SHAREN

    SHAREN Servers-Info.Ru

    Сообщения:
    203
    Симпатии:
    13
    Решил значит что пора научиться компилировать SourceMod и расширения к нему, чтобы можно было вносить свои правки и вообще иметь возможность что-то сделать.

    решил использовать Linux Mint и компилировать через терминал и gcc

    Старался делать все по инструкции https://wiki.alliedmods.net/Building_sourcemod , но все равно многое не понятно.
    Код:
    python ../configure.py // это получилось 
    сделал без ошибок. т.е. до этого момента вроде как все получилось.
    Структура папок такая.
    папка sourcemod взята отсюда https://github.com/alliedmodders/sourcemod
    в ней папка sourcepawn взята отсюда https://github.com/alliedmodders/sourcepawn
    Код:
    [email protected] ~/GIT $ ls
    ambuild       hl2sdk-bms   hl2sdk-css   hl2sdk-dota      hl2sdk-hl2dm       hl2sdk-l4d   hl2sdk-nucleardawn  hl2sdk-proxy-repo  hl2sdk-tf2     mysql-5.0
    hl2sdk-blade  hl2sdk-csgo  hl2sdk-dods  hl2sdk-episode1  hl2sdk-insurgency  hl2sdk-l4d2  hl2sdk-orangebox    hl2sdk-sdk2013     mmsource-1.10  sourcemod
    [email protected] ~/GIT $ cd sourcemod
    
    
    [email protected] ~/GIT/sourcemod $ ls
    AMBuildScript  bridge  changelog.txt  configure.py  editor      gamedata  plugins          public         README.md   tools         versionlib
    amtl      build   configs        core          extensions  loader    product.version  pushbuild.txt  sourcepawn  translations
    [email protected] ~/GIT/sourcemod $ 
    
    


    В общем при компиляции (ambuild) выдает ошибки.
    Код:
    [email protected] ~/GIT/sourcemod/build $ ambuild
    Spawned taskmaster (pid: 24501)
    Spawned worker (pid: 24506)
    Spawned worker (pid: 24510)
    Spawned worker (pid: 24509)
    Spawned worker (pid: 24507)
    Spawned worker (pid: 24508)
    [24506] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/x86-utils.cpp -o x86_x86_utils.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/x86/x86-utils.cpp:13:0:
    /home/home/GIT/sourcemod/sourcepawn/vm/environment.h:17:54: fatal error: am-utility.h: Нет такого файла или каталога
     #include <am-utility.h> // Replace with am-cxx later.
                                                          ^
    compilation terminated.
    [24509] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/code-stubs-x86.cpp -o x86_code_stubs_x86.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/code-stubs.h:18:0,
                     from /home/home/GIT/sourcemod/sourcepawn/vm/x86/code-stubs-x86.cpp:14:
    /home/home/GIT/sourcemod/sourcepawn/vm/code-allocator.h:18:28: fatal error: am-refcounting.h: Нет такого файла или каталога
     #include <am-refcounting.h>
                                ^
    compilation terminated.
    [24507] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/assembler-x86.cpp -o x86_assembler_x86.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/x86/assembler-x86.cpp:31:0:
    /home/home/GIT/sourcemod/sourcepawn/vm/x86/assembler-x86.h:35:23: fatal error: am-vector.h: Нет такого файла или каталога
     #include <am-vector.h>
                           ^
    compilation terminated.
    [24508] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.cpp -o watchdog_timer.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.cpp:17:0:
    /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.h:22:29: fatal error: am-thread-utils.h: Нет такого файла или каталога
     #include <am-thread-utils.h>
                                 ^
    compilation terminated.
    [24510] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/jit_x86.cpp -o x86_jit_x86.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/x86/jit_x86.cpp:35:0:
    /home/home/GIT/sourcemod/sourcepawn/vm/x86/jit_x86.h:22:23: fatal error: am-vector.h: Нет такого файла или каталога
     #include <am-vector.h>
                           ^
    compilation terminated.
    Build failed.
    
    

    Судя по ошибкам не хватает amtl
    Поэтому устанавливаю в папку sourcemod/public https://github.com/alliedmodders/amtl


    Код:
    [email protected] ~/GIT/sourcemod/build $ ambuild
    Spawned taskmaster (pid: 24758)
    Spawned worker (pid: 24765)
    Spawned worker (pid: 24763)
    Spawned worker (pid: 24767)
    Spawned worker (pid: 24764)
    Spawned worker (pid: 24766)
    [24764] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/assembler-x86.cpp -o x86_assembler_x86.o
    [24765] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/x86-utils.cpp -o x86_x86_utils.o
    [24767] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/code-stubs-x86.cpp -o x86_code_stubs_x86.o
    [24766] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.cpp -o watchdog_timer.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.cpp:17:0:
    /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.h:31:1: error: expected class-name before ‘{’ token
     {
     ^
    In file included from /home/home/GIT/sourcemod/public/amtl/amtl/am-thread-posix.h:43:0,
                     from /home/home/GIT/sourcemod/public/amtl/amtl/am-thread-utils.h:318,
                     from /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.h:22,
                     from /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.cpp:17:
    /home/home/GIT/sourcemod/public/amtl/amtl/am-function.h: In instantiation of ‘ReturnType ke::impl::FuncHolder<T, ReturnType, ArgTypes>::invoke(ArgTypes&& ...) const [with T = sp::WatchdogTimer*; ReturnType = void; ArgTypes = {}]’:
    /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.cpp:165:1:   required from here
    /home/home/GIT/sourcemod/public/amtl/amtl/am-function.h:73:49: error: expression cannot be used as a function
           return obj_(ke::Forward<ArgTypes>(argv)...);
                                                     ^
    /home/home/GIT/sourcemod/public/amtl/amtl/am-function.h:73:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
    cc1plus: error: unrecognized command line option "-Wno-unused-const-variable" [-Werror]
    cc1plus: error: unrecognized command line option "-Wno-implicit-exception-spec-mismatch" [-Werror]
    cc1plus: all warnings being treated as errors
    [24763] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -Wno-invalid-offsetof -Wno-implicit-exception-spec-mismatch -Wno-unused-const-variable -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -fno-rtti -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSOURCEMOD_BUILD -DSM_USE_VERSIONLIB -DSM_GENERATED_BUILD -I /home/home/GIT/sourcemod/public -I /home/home/GIT/sourcemod/build/includes -I /home/home/GIT/sourcemod/versionlib -I /home/home/GIT/sourcemod/public/amtl/amtl -I /home/home/GIT/sourcemod/public/amtl -I /home/home/GIT/sourcemod/sourcepawn/vm -I /home/home/GIT/sourcemod/sourcepawn/third_party -I /home/home/GIT/sourcemod/sourcepawn/include -H -c /home/home/GIT/sourcemod/sourcepawn/vm/x86/jit_x86.cpp -o x86_jit_x86.o
    In file included from /home/home/GIT/sourcemod/sourcepawn/vm/x86/jit_x86.cpp:38:0:
    /home/home/GIT/sourcemod/sourcepawn/vm/watchdog_timer.h:31:1: error: expected class-name before ‘{’ token
     {
     ^
    cc1plus: error: unrecognized command line option "-Wno-unused-const-variable" [-Werror]
    cc1plus: error: unrecognized command line option "-Wno-implicit-exception-spec-mismatch" [-Werror]
    cc1plus: all warnings being treated as errors
    Build failed.
    
    
    


    В итоге ругается на то, как я понял, что #include указывают друг на друга. Скорее всего я сделал что-то не по инструкции, может amtl не туда установил, может ещё что, прошу помочь.

    P.S. ну и вообще можно сказать ничего такого большого на С и С++ не компилировал, т.е. опыта нету.