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

[WIKI] Ubuntu 24.04 compilation instruction #982

Closed
2 of 5 tasks
gesior opened this issue Dec 5, 2024 · 2 comments
Closed
2 of 5 tasks

[WIKI] Ubuntu 24.04 compilation instruction #982

gesior opened this issue Dec 5, 2024 · 2 comments
Labels
Status: Pending Test This PR or Issue requires more testing Type: Enhancement New feature or request

Comments

@gesior
Copy link
Contributor

gesior commented Dec 5, 2024

Priority

Enhancement

Area

  • Data
  • Source
  • Docker
  • Other

What is missing?

I'm working on Docker build (it does not work now). I tried to compile OTC on Ubuntu 24.04 and in official instruction are some steps that are not needed on Ubuntu 24.04 (replace g++ and cmake with newest version):
https://github.com/mehah/otclient/wiki/Compiling-on-Ubuntu-24.04

All commands I had to run to compile on Ubuntu 24.04:
linux (when I finish work on Docker, I will test if all these packages are required):

sudo apt update && sudo apt dist-upgrade -y
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build libglew-dev libx11-dev ccache linux-headers-$(uname -r) -y

vcpkg:

cd ~
git clone https://github.com/microsoft/vcpkg
cd vcpkg/
./bootstrap-vcpkg.sh

Download client files:

cd ~
git clone --depth 1 https://github.com/mehah/otclient.git

Compile:

cd otclient/
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release
cmake --build linux-release

Code of Conduct

  • I agree to follow this project's Code of Conduct
@github-actions github-actions bot added Status: Pending Test This PR or Issue requires more testing Type: Enhancement New feature or request labels Dec 5, 2024
@eemarwell
Copy link

I've builded using Dockerfile and it worked properly.

@majestyotbr majestyotbr closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
@gesior
Copy link
Contributor Author

gesior commented Dec 14, 2024

I've builded using Dockerfile and it worked properly.

I've found out why it failed on my PC on step:

RUN vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') \
	&& echo "vcpkg commit ID: $vcpkgCommitId" \
	&& git clone https://github.com/Microsoft/vcpkg.git \
	&& cd vcpkg \
	&& git checkout $vcpkgCommitId \
	&& ./bootstrap-vcpkg.sh

with error:

0.378 vcpkg commit ID: c82f74667287d3dc386bce81e44964370c91a289
0.387 Cloning into 'vcpkg'...
7.840 error: pathspec 'c82f74667287d3dc386bce81e44964370c91a289?' did not match any file(s) known to git

It's because I've clone OTC repo on Windows with auto-replace LF -> CRLF, which somehow made function $(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') add new-line character to commit hash variable, which git shows in error as ? at end of commit hash.


I will work on other Dockerfile issue: Windows compilation files are not excluded in .dockerignore, which makes docker copy up to 17 GB (transferring context: 16.75GB) of 'context' into docker container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Test This PR or Issue requires more testing Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants