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

How to build and Install this project in WSL2 Ubuntu 24.04 on Windows 11 #59

Open
deepbiolab opened this issue Dec 4, 2024 · 0 comments

Comments

@deepbiolab
Copy link

deepbiolab commented Dec 4, 2024

Backgroud of this issue

While working on this project, I encountered several challenges when attempting to set it up and compile it in a WSL2 Ubuntu 24.04 environment. These issues included dependency conflicts, build errors, and missing configurations. After researching and experimenting with different approaches, I was able to successfully resolve these problems and achieve a working setup.

The purpose of sharing my method is to help others who might face similar difficulties. By documenting the steps I followed and the solutions I applied, I aim to save time for others and provide a clear path for setting up this project in a similar development environment. Below's steps came from my project readme, for details please read this link

Build

This project use CMake as its build system and has been tested on WSL Ubuntu 24.04. Therefore, the following procedures primarily focus on Windows 11 Subsystem for Linux (WSL) with Ubuntu. However, they may also work for users of Ubuntu Desktop or Ubuntu Server. If you don't have a WSL Ubuntu System, using below command to create one.

  • Create a new WSL Ubuntu Instance (open as administrator)

    # in Windows PowerShell
    wsl --install Ubuntu-24.04

Prerequisites

We need to install the project dependencies and including the IO2D library before building project. Since installing IO2D library can be difficult, please stick with the procedures as below.

Dependencies

After WSL Ubuntu installed, install below basic packages in it

sudo apt update
sudo apt install -y build-essential
sudo apt install -y cmake
sudo apt install -y git
sudo apt install -y gcc g++
sudo apt install -y pkg-config

make sure versions:

  • cmake version > 3.14
  • g++ version > 7

Packages

sudo apt install -y libcairo2-dev
sudo apt install -y libgraphicsmagick1-dev
sudo apt install -y libpng-dev

Compile io2d

Then compile and install io2d:

cd ~
git clone --recurse-submodules https://github.com/cpp-io2d/P0267_RefImpl

# Update original svgpp to latest
cd P0267_RefImpl/P0267_RefImpl/Samples/svg/external
rm -rf svgpp
git clone --recurse-submodules https://github.com/svgpp/svgpp.git

# Update catch.hpp file
cd ~/P0267_RefImpl/P0267_RefImpl/Tests/Catch2/single_include/
rm catch.hpp
wget https://raw.githubusercontent.com/potassco/libpotassco/2003fc8a4fd0e9b1435108b05a8ac36706b14bd3/tests/catch.hpp

# Compile io2d
cd ~/P0267_RefImpl
mkdir Debug && cd Debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
make
sudo make install

Compile

At that point the project code should be compliable and run:

Note: When cloning this project, be sure to use the --recurse-submodules flag. Using HTTPS:

# Compile project
cd ~/projects/
git clone https://github.com/udacity/CppND-Route-Planning-Project.git --recurse-submodules
cd CppND-Route-Planning-Project
mkdir build && cd build
cmake -DTESTING="AStarSearch" ..
make
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

1 participant