Skip to content
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

CMake error #37

Open
elch01 opened this issue Dec 31, 2021 · 25 comments
Open

CMake error #37

elch01 opened this issue Dec 31, 2021 · 25 comments

Comments

@elch01
Copy link

elch01 commented Dec 31, 2021

Cmake spits out an error when trying to configure:

-- The C compiler identification is Clang 11.0.1
-- The CXX compiler identification is Clang 11.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:18 (cmake_policy):
  The OLD behavior for policy CMP0005 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.


CMake Deprecation Warning at CMakeLists.txt:20 (cmake_policy):
  The OLD behavior for policy CMP0043 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.


-- Detected 64-bit platform
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL library: /usr/lib/x86_64-linux-gnu/libmariadb.so
-- Found MySQL headers: /usr/include/mariadb
-- Found MySQL executable: /usr/bin/mysql
-- Found Readline library: /usr/lib/x86_64-linux-gnu/libreadline.so
-- Include dir is: /usr/include
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.8") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (libdw) does
  not match the name of the calling package (Backward).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/macros/FindBackward.cmake:57 (find_package_handle_standard_args)
  CMakeLists.txt:70 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) 
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (libbfd)
  does not match the name of the calling package (Backward).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/macros/FindBackward.cmake:68 (find_package_handle_standard_args)
  CMakeLists.txt:70 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) 
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (libdwarf)
  does not match the name of the calling package (Backward).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/macros/FindBackward.cmake:83 (find_package_handle_standard_args)
  CMakeLists.txt:70 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR) 
-- Found Backward: /home/debian/LegionCore-7.3.5/cmake/macros  
-- WARNING - Missing repository tags - you may need to pull tags with git fetch -t
-- WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)

* LegionCore
* LegionCore

* Build world/auth       : Yes (default)
* Build with scripts     : Yes (default)
* Build core w/PCH       : Yes (default)
* Build scripts w/PCH    : Yes (default)
* Show compile-warnings  : No  (default)
* Use coreside debug     : No  (default)
* Show source tree       : Yes - "hierarchical"

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:240 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  cmake/macros/FindBoost.cmake:206 (find_package)
  dep/boost/CMakeLists.txt:29 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:240 (if):
  if given arguments:

    "ALL" "IN_LIST" "Boost_FIND_COMPONENTS"

  Unknown arguments specified
Call Stack (most recent call first):
  cmake/macros/FindBoost.cmake:206 (find_package)
  dep/boost/CMakeLists.txt:29 (find_package)

Installed packages:

apt-get install git clang cmake make gcc g++ libmariadb-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mariadb-server p7zip default-libmysqlclient-dev
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100

Running on Debian 11
Any packages im missing?
Also the wiki links are dead, so i used:
https://trinitycore.info/en/install/requirements/linux

@dufernst
Copy link
Owner

dufernst commented Jan 2, 2022

Try installing the requirements from:
https://trinitycore.atlassian.net/wiki/spaces/tc/pages/10977288/Linux+Requirements
if that works, I'll update the link in the README :)

@elch01
Copy link
Author

elch01 commented Jan 3, 2022

Yes, now i get through the cmake configuration.
But now make spits out an error:

[  6%] Linking CXX static library libcasc.a
[  6%] Built target casc
Scanning dependencies of target revision_data.h
-- WARNING - Missing repository tags - you may need to pull tags with git fetch -t
-- WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)
[  6%] Built target revision_data.h
Scanning dependencies of target commonPCH.cpp_dephelp
[  7%] Building CXX object src/common/CMakeFiles/commonPCH.cpp_dephelp.dir/PrecompiledHeaders/commonPCH.cpp.o
[  7%] Building CXX object dep/protobuf/CMakeFiles/protobuf.dir/src/google/protobuf/extension_set_heavy.cc.o
In file included from /home/user/LegionCore-7.3.5/src/common/PrecompiledHeaders/commonPCH.cpp:1:
In file included from /home/user/LegionCore-7.3.5/src/common/PrecompiledHeaders/commonPCH.h:7:
/home/user/LegionCore-7.3.5/src/common/Logging/Log.h:127:18: error: use of class
      template 'boost::asio::strand' requires template arguments
    boost::asio::strand* _strand;
                 ^
/usr/include/boost/asio/strand.hpp:29:7: note: template is declared here
class strand
      ^
1 error generated.
make[2]: *** [src/common/CMakeFiles/commonPCH.cpp_dephelp.dir/build.make:63: src/common/CMakeFiles/commonPCH.cpp_dephelp.dir/PrecompiledHeaders/commonPCH.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:936: src/common/CMakeFiles/commonPCH.cpp_dephelp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

@dufernst
Copy link
Owner

dufernst commented Jan 3, 2022

You are using a version of BOOST > 1.65.
For this core BOOST 1.64 is recommended, hopefully that is enough of a hint for you to sort things out on your end :)

At some point in the future I might add support for new BOOST versions by cherry-picking:
TrinityCore/TrinityCore@dfd2660

@elch01
Copy link
Author

elch01 commented Jan 4, 2022

Seems like Boost 1.64 is not available on debian through APT, and 1.62 does not work using stretch.
i will try to compile and older version.
Boost version changelog

EDIT:
That did not work:

Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

@dufernst
Copy link
Owner

dufernst commented Jan 5, 2022

Hmmm anything else in terms of error logs?
Maybe reconfiguring with cmake from scratch?

@elch01
Copy link
Author

elch01 commented Jan 5, 2022

Here's the full log from my latest attempt (After a full reinstall and reconfiguration of Debian 9)
https://pastebin.com/Wes7Kisw

@dufernst
Copy link
Owner

dufernst commented Jan 5, 2022

Could you upgrade CMake to version 3.9 or higher :)?
I will fix the CMake file to make that requirement explicit.

Another solution you could use if you don't want to upgrade CMake is to not compile the tools by adding the following to your CMake command:
-DTOOLS=0
Most tools are broken anyway, so you are not missing out on much.

@elch01
Copy link
Author

elch01 commented Jan 5, 2022

Oh, i though -DTOOLS was required to get the map extractor toolset?
But i've upgraded cmake to busters 3.13 release.
Lets see if it works.

@dufernst
Copy link
Owner

dufernst commented Jan 5, 2022

Unfortunately the tools in this repo seem to output data in a different way than what the core is expecting.
Instead look at the following on how to get the required data:
https://github.com/dufernst/LegionCore-7.3.5#data-files

@elch01
Copy link
Author

elch01 commented Jan 5, 2022

Ah, reading comprehension.
I missed that.

@dufernst
Copy link
Owner

dufernst commented Jan 5, 2022

No worries, I was also surprised that the extractors didn't seem to result in the same data as the data you can download @ the provided url. But don't have the time to research that further :|

@elch01
Copy link
Author

elch01 commented Jan 5, 2022

Nope, upgrading cmake did not work.

@dufernst
Copy link
Owner

dufernst commented Jan 5, 2022

Well at least then -DTOOLS=0 should work.
Do you mind sharing the cmake output again?

@elch01
Copy link
Author

elch01 commented Jan 6, 2022

Here's the CMAKE log

user@legion:~/LegionCore-7.3.5/build$ cmake ../ -DCMAKE_INSTALL_PREFIX=/home/user/server -DTOOLS=0
CMake Deprecation Warning at CMakeLists.txt:18 (cmake_policy):
  The OLD behavior for policy CMP0005 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.


CMake Deprecation Warning at CMakeLists.txt:20 (cmake_policy):
  The OLD behavior for policy CMP0043 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.


-- Detected 64-bit platform
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: Enabled c++11 support
-- GCC: Enabled C99 support
-- GCC: SSE2 flags forced
-- GCC: All warnings disabled
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL library: /usr/lib/x86_64-linux-gnu/libmariadbclient.so
-- Found MySQL headers: /usr/include/mysql
-- Found MySQL executable: /usr/bin/mysql
-- Found Readline library: /usr/lib/x86_64-linux-gnu/libreadline.so
-- Include dir is: /usr/include
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) 
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) 
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR) 
-- WARNING - Missing repository tags - you may need to pull tags with git fetch -t
-- WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)

* LegionCore
* LegionCore

* Build world/auth       : Yes (default)
* Build with scripts     : Yes (default)
* Build core w/PCH       : Yes (default)
* Build scripts w/PCH    : Yes (default)
* Show compile-warnings  : No  (default)
* Use coreside debug     : No  (default)
* Show source tree       : Yes - "hierarchical"

-- Boost version: 1.64.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   program_options
--   iostreams
--   regex
-- Performing Test boost_filesystem_copy_links_without_NO_SCOPED_ENUM
-- Performing Test boost_filesystem_copy_links_without_NO_SCOPED_ENUM - Success
-- Found OpenSSL library: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
-- Found OpenSSL headers: /usr/include
-- Found Readline library: /usr/lib/x86_64-linux-gnu/libreadline.so
-- Include dir is: /usr/include
-- SCRIPT PREPARATIONS
--   -> Prepared: Spells
--   -> Prepared: Commands
--   -> Prepared: BrawlersGuild
--   -> Prepared: BattlePay
--   -> Prepared: Custom
--   -> Prepared: Kalimdor
--   -> Prepared: Maelstrom
--   -> Prepared: Northrend
--   -> Prepared: OutdoorPvP
--   -> Prepared: Outland
--   -> Prepared: PetBattle
--   -> Prepared: World
--   -> Prepared: Draenor
--   -> Prepared: EasternKingdoms
--   -> Prepared: Legion
--   -> Prepared: Outland
--   -> Prepared: Pandaria
--   -> Prepared: Scenario
--   -> Prepared: Maelstrom
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/LegionCore-7.3.5/build
user@legion:~/LegionCore-7.3.5/build$ 

@dufernst
Copy link
Owner

dufernst commented Jan 6, 2022

Thanks, looks like it properly enable C++17 this time, so confused as to why it would not work.
But I guess for now everything is sorted out :)?

@elch01
Copy link
Author

elch01 commented Jan 6, 2022

Not quite haha 😄
Latest make run:
https://pastebin.com/gQ9bbvw5

@dufernst
Copy link
Owner

dufernst commented Jan 6, 2022

I think you are linking against the wrong boost version, not the 1.64 manual install you did?
Is the BOOST_LIB or BOOST_LIBRARY, or whatever it is called, set to your own lib directory? It should do so automatically if you have used BOOST_ROOT to set CMake to pick up on your own boost version.

@elch01
Copy link
Author

elch01 commented Jan 6, 2022

image
This is the guide ive followed to update boost, not sure if its correct.

@dufernst
Copy link
Owner

dufernst commented Jan 6, 2022

Can you make sure the boost regex library has actually been compiled?
The output of ./b2 should tell you that.

@elch01
Copy link
Author

elch01 commented Jan 6, 2022

Seems like it?

user@legion:~/boost_1_64_0$ ./b2
Performing configuration checks

    - 32-bit                   : no  (cached)
    - 64-bit                   : yes (cached)
    - arm                      : no  (cached)
    - mips1                    : no  (cached)
    - power                    : no  (cached)
    - sparc                    : no  (cached)
    - x86                      : yes (cached)

Building the Boost C++ Libraries.


    - symlinks supported       : yes (cached)
    - C++11 mutex              : yes (cached)
    - lockfree boost::atomic_flag : yes (cached)
    - Boost.Config Feature Check: cxx11_auto_declarations : yes (cached)
    - Boost.Config Feature Check: cxx11_constexpr : yes (cached)
    - Boost.Config Feature Check: cxx11_defaulted_functions : yes (cached)
    - Boost.Config Feature Check: cxx11_final : yes (cached)
    - Boost.Config Feature Check: cxx11_hdr_mutex : yes (cached)
    - Boost.Config Feature Check: cxx11_hdr_tuple : yes (cached)
    - Boost.Config Feature Check: cxx11_lambdas : yes (cached)
    - Boost.Config Feature Check: cxx11_noexcept : yes (cached)
    - Boost.Config Feature Check: cxx11_nullptr : yes (cached)
    - Boost.Config Feature Check: cxx11_rvalue_references : yes (cached)
    - Boost.Config Feature Check: cxx11_template_aliases : yes (cached)
    - Boost.Config Feature Check: cxx11_thread_local : yes (cached)
    - Boost.Config Feature Check: cxx11_variadic_templates : yes (cached)
    - has_icu builds           : yes (cached)
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
    - zlib                     : yes (cached)
    - bzip2                    : yes (cached)
    - iconv (libc)             : yes (cached)
    - icu                      : yes (cached)
    - native-atomic-int32-supported : yes (cached)
    - native-syslog-supported  : yes (cached)
    - pthread-supports-robust-mutexes : yes (cached)
    - compiler-supports-visibility : yes (cached)
    - compiler-supports-ssse3  : yes (cached)
    - compiler-supports-avx2   : yes (cached)
    - gcc visibility           : yes (cached)
    - long double support      : yes (cached)
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
    - zlib                     : yes (cached)
    - bzip2                    : yes (cached)

Component configuration:

    - atomic                   : building
    - chrono                   : building
    - container                : building
    - context                  : building
    - coroutine                : building
    - coroutine2               : building
    - date_time                : building
    - exception                : building
    - fiber                    : building
    - filesystem               : building
    - graph                    : building
    - graph_parallel           : building
    - iostreams                : building
    - locale                   : building
    - log                      : building
    - math                     : building
    - metaparse                : building
    - mpi                      : building
    - program_options          : building
    - python                   : building
    - random                   : building
    - regex                    : building
    - serialization            : building
    - signals                  : building
    - system                   : building
    - test                     : building
    - thread                   : building
    - timer                    : building
    - type_erasure             : building
    - wave                     : building

...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...found 14460 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/user/boost_1_64_0

The following directory should be added to linker library paths:

    /home/user/boost_1_64_0/stage/lib

And sudo . /b2 install should add them to my libs

@dufernst
Copy link
Owner

dufernst commented Jan 6, 2022

Everything you did sounds correct, I don't see based on this where it is going wrong.
But based on the errors I think it is save to say that for some reason the linking is happening against the wrong boost libs (at least for regex).

@elch01
Copy link
Author

elch01 commented Jan 6, 2022

I will try using RHEL, see if that makes any difference

@elch01
Copy link
Author

elch01 commented Jan 6, 2022

Yup compiles just perfectly on Centos, so its seems like there are some issues with the requirements for debian related distros.
Edit:
-DTOOLS=1 works to complie by commenting out add_subdirectory(web_api) in src/tools/CMakeLists.txt

@dufernst
Copy link
Owner

dufernst commented Jan 6, 2022

Yeah, but that is the only tool that does work :D
But you have it working now on debian as well or still just Centos?

@elch01
Copy link
Author

elch01 commented Jan 7, 2022

No, i have not gotten it to work on debian so just centos for now :)

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

No branches or pull requests

2 participants