• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling [otservbr] compiling on ubuntu 20.04

Mjmackan

Mapper ~ Writer
Premium User
Joined
Jul 18, 2009
Messages
1,424
Solutions
15
Reaction score
176
Location
Sweden
Are there any somewhat good tutorials for how to compile otservbr in ubuntu enviroment?

I have downloaded pretty much any package there is but nothing seems to change, everytime i try to: "cmake .." this error pops:
Code:
CMake Error at src/CMakeLists.txt:88 (find_package):
  Could not find a package configuration file provided by "cryptopp" with any
  of the following names:

    cryptoppConfig.cmake
    cryptopp-config.cmake

  Add the installation prefix of "cryptopp" to CMAKE_PREFIX_PATH or set
  "cryptopp_DIR" to a directory containing one of the above files.  If
  "cryptopp" provides a separate development package or SDK, be sure it has
  been installed.
 
Solution
UPDATE: Updated to temp-fix issue with vcpkg update to libmariadb
UPDATE2: These instructions are correct, but it seems you also need to get this package - to do this run sudo apt install libcrypto++-dev
UPDATE3: My PR fixing the libmariadb issue has been accepted - I've updated the instructions below to match

If you have done a whole lot of stuff that you don't really understand and won't be able to explain to anybody, I suggest you start from a fresh install of Ubuntu 20.04 and follow the steps below exactly.

Compiling otservbr-global on Ubuntu 20.04 as at 32df826

$ sudo apt update
$ sudo apt-get update
$ sudo apt upgrade
$ sudo apt-get install git cmake build-essential libluajit-5.1-dev...
UPDATE: Updated to temp-fix issue with vcpkg update to libmariadb
UPDATE2: These instructions are correct, but it seems you also need to get this package - to do this run sudo apt install libcrypto++-dev
UPDATE3: My PR fixing the libmariadb issue has been accepted - I've updated the instructions below to match

If you have done a whole lot of stuff that you don't really understand and won't be able to explain to anybody, I suggest you start from a fresh install of Ubuntu 20.04 and follow the steps below exactly.

Compiling otservbr-global on Ubuntu 20.04 as at 32df826

$ sudo apt update
$ sudo apt-get update
$ sudo apt upgrade
$ sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config
$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg
$ ./bootstrap-vcpkg.sh
$ cd ..
$ git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git
$ cd otservbr-global
$ git checkout main
$ mkdir build && cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
$ make -j`nproc`

Note: The cmake step will take a long time to complete as it will handle all remaining dependencies automatically.
 
Last edited:
Solution
For otservbr on clean Ubuntu 20.04:
Code:
apt-get update
apt-get -y install tzdata
apt-get install -y git cmake build-essential libluajit-5.1-dev zip ca-certificates curl zip unzip tar pkg-config yasm autoconf ninja-build
cd /home/ && git clone https://github.com/microsoft/vcpkg && cd vcpkg && ./bootstrap-vcpkg.sh
cd /home/vcpkg/ && ./vcpkg --triplet x64-linux install boost-asio boost-filesystem boost-iostreams boost-lockfree boost-system boost-variant cryptopp curl jsoncpp libmariadb pugixml spdlog
cd /home/ && git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git && cd otservbr-global && git checkout main
cd /home/otservbr-global/ && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
cd /home/otservbr-global/build/ && make -j 16

EDIT:
Changed otservbr-global branch name from 'develop' to 'main'.
 
Last edited:
UPDATE: Updated to temp-fix issue with vcpkg update to libmariadb

If you have done a whole lot of stuff that you don't really understand and won't be able to explain to anybody, I suggest you start from a fresh install of Ubuntu 20.04 and follow the steps below exactly.

Compiling otservbr-global on Ubuntu 20.04 as at 32df826

$ sudo apt update
$ sudo apt-get update
$ sudo apt upgrade
$ sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config
$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg
$ git checkout f33d743a757fc50da77a2bd3a4cf5d55c4f5e02f
$ ./bootstrap-vcpkg.sh
$ cd ..
$ git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git
$ cd otservbr-global
$ git checkout main
$ mkdir build && cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
$ make -j`nproc`

Note: The cmake step will take a long time to complete as it will handle all remaining dependencies automatically.
This is how I proceeded first time, now done twice. Still same issue. (Yes with a clean Ubuntu installation)

For otservbr on clean Ubuntu 20.04:
Code:
apt-get update
apt-get -y install tzdata
apt-get install -y git cmake build-essential libluajit-5.1-dev zip ca-certificates curl zip unzip tar pkg-config yasm autoconf
cd /home/ && git clone https://github.com/microsoft/vcpkg && cd vcpkg && ./bootstrap-vcpkg.sh
cd /home/vcpkg/ && ./vcpkg --triplet x64-linux install boost-asio boost-filesystem boost-iostreams boost-lockfree boost-system boost-variant cryptopp curl jsoncpp libmariadb pugixml spdlog
cd /home/ && git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git && cd otservbr-global && git checkout develop
cd /home/otservbr-global/ && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
cd /home/otservbr-global/build/ && make -j 16
I'm looking through this atm.
 
Last edited:
UPDATE: Updated to temp-fix issue with vcpkg update to libmariadb
UPDATE2: These instructions are correct, but it seems you also need to get this package - to do this run sudo apt install libcrypto++-dev

If you have done a whole lot of stuff that you don't really understand and won't be able to explain to anybody, I suggest you start from a fresh install of Ubuntu 20.04 and follow the steps below exactly.

Compiling otservbr-global on Ubuntu 20.04 as at 32df826

$ sudo apt update
$ sudo apt-get update
$ sudo apt upgrade
$ sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config
$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg
$ git checkout f33d743a757fc50da77a2bd3a4cf5d55c4f5e02f
$ ./bootstrap-vcpkg.sh
$ cd ..
$ git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git
$ cd otservbr-global
$ git checkout main
$ mkdir build && cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
$ make -j`nproc`

Note: The cmake step will take a long time to complete as it will handle all remaining dependencies automatically.
Stuck at: cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
Error: (And i just typed cd /home/otservbr-global/ aaand it states:
root@164-132-112-***:/home/otservbr-global#)

CMake Error: The source directory "/home" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
For otservbr on clean Ubuntu 20.04:
Code:
apt-get update
apt-get -y install tzdata
apt-get install -y git cmake build-essential libluajit-5.1-dev zip ca-certificates curl zip unzip tar pkg-config yasm autoconf
cd /home/ && git clone https://github.com/microsoft/vcpkg && cd vcpkg && ./bootstrap-vcpkg.sh
cd /home/vcpkg/ && ./vcpkg --triplet x64-linux install boost-asio boost-filesystem boost-iostreams boost-lockfree boost-system boost-variant cryptopp curl jsoncpp libmariadb pugixml spdlog
cd /home/ && git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git && cd otservbr-global && git checkout develop
cd /home/otservbr-global/ && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
cd /home/otservbr-global/build/ && make -j 16
First error at:
cd /home/ && git clone --depth 1 GitHub - opentibiabr/otservbr-global: Repository for otservbr-global datapack. Source code: https://github.com/opentibiabr/canary (https://github.com/opentibiabr/otservbr-global.git) && cd otservbr-global && git checkout develop
Error:
error: pathspec 'develop' did not match any file(s) known to git
Then stuck at:
cd /home/otservbr-global/ && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
Error:
CMake Error at /home/vcpkg/scripts/buildsystems/vcpkg.cmake:831 (message):
vcpkg install failed. See logs for more information:
/home/otservbr-global/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:90 (include)
CMakeLists.txt:26 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
 
You seem to not be following my instructions quite in order and Gesior's instructions are a little outdated.

Regarding my instructions and your error:
When you run the cmake command, you need to be inside the build folder, not inside the otservbr-global folder. If you follow the instructions carefully, they ensure you are in the right folder when you use the command.

Regarding Gesior's instructions and your error:
The correct "branch" is no longer called develop but is instead called main. You can see this reflected in my instructions.
If you want to try and use Gesior's instructions instead, you can change the line that says git checkout develop to git checkout main
I have not reviewed the rest of what Gesior's instructions are doing, but a quick glance seems it does essentially exactly the same but with less cmake/vcpkg automation.

Gesior's instructions will also likely fail to compile due to the recent vcpkg libmariadb changes, unless/until otservbr patch their cmake to include the libmariadb-client option. You'll need to use the git checkout f33d743a757fc50da77a2bd3a4cf5d55c4f5e02f line from my instructions while you are inside the vcpkg folder to fix this for now. Don't forget to run ./bootstrap-vcpkg.sh too.
EDIT: My PR was accepted and now the typical instructions will work again. I'll update my original post to match.
 
Last edited:
EDIT: My PR was accepted and now the typical instructions will work again. I'll update my original post to match.
Changed branch 'develop' to 'main' and it compiled on Ubuntu 20.04 today. I will update by blog post on evening.

Code:
CMake Error at src/CMakeLists.txt:88 (find_package):
  Could not find a package configuration file provided by "cryptopp" with any
  of the following names:

    cryptoppConfig.cmake
    cryptopp-config.cmake

  Add the installation prefix of "cryptopp" to CMAKE_PREFIX_PATH or set
  "cryptopp_DIR" to a directory containing one of the above files.  If
  "cryptopp" provides a separate development package or SDK, be sure it has
  been installed.
If you get this error message, it means that you try to compile with cmake ... It would work on TFS, but otservbr-global uses vcpkg to manage C++ libraries. First you need to install vcpkg and required libraries. Then you need to execute cmake with parameter. Something like cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..

EDIT:
This error about 'cryptopp' also appear when you try to compile on machine with ARM processor (Raspberry Pi / Oracle Cloud Ampere)
 
Last edited:
UPDATE: Updated to temp-fix issue with vcpkg update to libmariadb
UPDATE2: These instructions are correct, but it seems you also need to get this package - to do this run sudo apt install libcrypto++-dev
UPDATE3: My PR fixing the libmariadb issue has been accepted - I've updated the instructions below to match

If you have done a whole lot of stuff that you don't really understand and won't be able to explain to anybody, I suggest you start from a fresh install of Ubuntu 20.04 and follow the steps below exactly.

Compiling otservbr-global on Ubuntu 20.04 as at 32df826

$ sudo apt update
$ sudo apt-get update
$ sudo apt upgrade
$ sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config
$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg
$ ./bootstrap-vcpkg.sh
$ cd ..
$ git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git
$ cd otservbr-global
$ git checkout main
$ mkdir build && cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
$ make -j`nproc`

Note: The cmake step will take a long time to complete as it will handle all remaining dependencies automatically.

Still having issues when trying to 'make', getting this error:

/usr/bin/ld: cannot find -llibmariadb
/usr/bin/ld: cannot find -lmariadbclient
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/otbr.dir/build.make:1362: bin/otbr] Error 1
make[1]: *** [CMakeFiles/Makefile2:94: src/CMakeFiles/otbr.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
 
That error you are experiencing now is due to having outdated otservbr files, or at least having ran the cmake of the old otservbr files and therefore installed a version of libmariadb without the required mariadbclient option. If you do a fresh install of your OS and go through all the steps again, it'll likely work.
Assuming you don't want to do everything again, you can try this:
- Navigate to your vcpkg directory
./vcpkg remove libmariadb
./vcpkg install libmariadb[mariadbclient]

Good luck
 
That error you are experiencing now is due to having outdated otservbr files, or at least having ran the cmake of the old otservbr files and therefore installed a version of libmariadb without the required mariadbclient option. If you do a fresh install of your OS and go through all the steps again, it'll likely work.
Assuming you don't want to do everything again, you can try this:
- Navigate to your vcpkg directory
./vcpkg remove libmariadb
./vcpkg install libmariadb[mariadbclient]

Good luck
Didn't fix it, maybe its wrong dir? no clue. The updated otservbr still works to compile but when exchanging sources this same error pops up.
I successfully installed the new dbmaria but still same error.

/usr/bin/ld: cannot find -llibmariadb
/usr/bin/ld: cannot find -lmariadbclient
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/otbr.dir/build.make:1362: bin/otbr] Error 1
make[1]: *** [CMakeFiles/Makefile2:94: src/CMakeFiles/otbr.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
otsmanager@*-*--:~/otservbr-global/build$ cd ..
otsmanager@*-*--:~/otservbr-global$ cd ..
otsmanager@*-*--:~$ cd vcpkg
otsmanager@*-*--:~/vcpkg$ ./vcpkg remove libmariadb
The following packages are not installed, so not removed:
libmariadb:x64-linux
Package libmariadb:x64-linux is not installed
otsmanager@*-*--:~/vcpkg$
 
Last edited:
For those who are having this problem when compiling, just do the following:
go inside the folder: ./vcpk

and inside it run this command:
C++:
export VCPKG_FORCE_SYSTEM_BINARIES=1

and try to compile again!
for me it solved.

Version: Ubuntu 20.04
 
Lua:
cd /home/vcpkg/ && ./vcpkg --triplet arm64-linux install boost-asio boost-filesystem boost-iostreams boost-lockfree boost-system boost-variant cryptopp curl jsoncpp libmariadb pugixml spdlog

Error:

C++:
The package boost is compatible with built-in CMake targets:

    find_package(Boost REQUIRED [COMPONENTS <libs>...])
    target_link_libraries(main PRIVATE Boost::boost Boost::<lib1> Boost::<lib2> ...)

The package cryptopp provides CMake targets:

    find_package(cryptopp CONFIG REQUIRED)
    target_link_libraries(main PRIVATE cryptopp-static)

The package curl provides CMake targets:

    find_package(CURL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE CURL::libcurl)

The package jsoncpp provides CMake targets:

    find_package(jsoncpp CONFIG REQUIRED)
    target_link_libraries(main PRIVATE jsoncpp_object jsoncpp_static JsonCpp::JsonCpp)

The package libmariadb provides CMake targets:

    find_package(unofficial-libmariadb CONFIG REQUIRED)
    target_link_libraries(main PRIVATE unofficial::libmariadb)

The package pugixml provides CMake targets:

    find_package(pugixml CONFIG REQUIRED)
    target_link_libraries(main PRIVATE pugixml pugixml::static pugixml::pugixml)

The package spdlog provides CMake targets:

    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog spdlog::spdlog_header_only)
 
UPDATE: Updated to temp-fix issue with vcpkg update to libmariadb
UPDATE2: These instructions are correct, but it seems you also need to get this package - to do this run sudo apt install libcrypto++-dev
UPDATE3: My PR fixing the libmariadb issue has been accepted - I've updated the instructions below to match

If you have done a whole lot of stuff that you don't really understand and won't be able to explain to anybody, I suggest you start from a fresh install of Ubuntu 20.04 and follow the steps below exactly.

Compiling otservbr-global on Ubuntu 20.04 as at 32df826

$ sudo apt update
$ sudo apt-get update
$ sudo apt upgrade
$ sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config
$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg
$ ./bootstrap-vcpkg.sh
$ cd ..
$ git clone --depth 1 https://github.com/opentibiabr/otservbr-global.git
$ cd otservbr-global
$ git checkout main
$ mkdir build && cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
$ make -j`nproc`

Note: The cmake step will take a long time to complete as it will handle all remaining dependencies automatically.
EDIT: Since posting I had a look through winscp and noticed that the files from the source weren't all there. I've added them in and it's currently running. Will post when it's done with an outcome.
EDIT 2: Seems to have worked fine. I had to add the cmake and src folder into the otservbr-global folder. Also had to add CMakeLists.txt, CMakeSettings.json and vcpkg.json files into the otservbr-global folder. Not sure if this is due to an update since this fix was originally posted, or if it's because I did it in root, but figured I'd post this here in case anyone else follows this step by step and has the same issue.

----------------------------------------------------------------------------------------------------------------------------------------------------

Hey mate, followed all steps exactly from a fresh 20.4 install and given the error below


Resolving deltas: 100% (2407/2407), done.
root@troy:~# cd otservbr-global
root@troy:~/otservbr-global# git checkout main
Already on 'main'
Your branch is up to date with 'origin/main'.
root@troy:~/otservbr-global# mkdir build && cd build
root@troy:~/otservbr-global/build# cmake -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scri pts/buildsystems/vcpkg.cmake ..
CMake Error: The source directory "/root/otservbr-global" does not appear to con tain CMakeLists.txt.



Any ideas? Using a dedicated hosted server so I need to request each time I need a fresh install. Would really prefer not to bother them again. Can assure you every step was followed, exactly. Nothing skipped.

Cheers
 
Last edited:
Back
Top