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

Fix memory leaks by removing raw pointers, new allocation and using RAII. #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@ git clone --depth 1 [email protected]:Matter-and-Form/instant-meshes.git

```

1. Update submodules.
2. Update submodules.
```
cd instant-meshes
git submodule update --init --recursive
```

3. Run the build script to build instant-meshes.
3. Native build: Run the native build script.
```
scripts/build-instant-meshes
scripts/build
```

4. Cross compile aarch64 in Raspbian-11 docker container. Run Raspbian-11 docker container with a shared volume to instant-meshes.
4. Cross compile aarch64 build: Run the cross-compile aarch64 build script.
```
docker run -v .:/instant-meshes -it ghcr.io/matter-and-form/debian-bullseye-cc-raspbian-11-aarch64
```
In the docker container, go to the instant-meshes directory and run the build script for aarch64 cross-compile.
```
cd instant-meshes/
scripts/build aarch64
scripts/build-aarch64
```

24 changes: 24 additions & 0 deletions scripts/build-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# The absolute script path.
SCRIPT_PATH="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";

# The path to the instant-meshes repo.
REPO_PATH=$(realpath ${SCRIPT_PATH}/..)

# The debian bullseye cross-compile container.
DOCKER_IMAGE=ghcr.io/matter-and-form/debian-bullseye-cc-raspbian-11-aarch64

# Pull the docker image.
docker pull ${DOCKER_IMAGE}

DOCKER_PATH=/instant-meshes

# We will run the 'build aarch64' script inside the docker container.
DOCKER_COMMAND="${DOCKER_PATH}/scripts/build aarch64"

# Run the build script in the debian bullseye cross-compile container.
docker run -v ${REPO_PATH}:${DOCKER_PATH} ${DOCKER_IMAGE} /bin/bash -c "${DOCKER_COMMAND}"

# Exit with docker run exit value.
exit $?
3 changes: 1 addition & 2 deletions scripts/common
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,4 @@ COMMON_AARCH64_FLAGS=(
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++
-DCMAKE_FIND_ROOT_PATH=/usr/aarch64-linux-gnu
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=arm64)
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER)
Loading