diff --git a/pages/advanced-algorithms/install-mage.mdx b/pages/advanced-algorithms/install-mage.mdx index 9ee1ef209..cd94b1904 100644 --- a/pages/advanced-algorithms/install-mage.mdx +++ b/pages/advanced-algorithms/install-mage.mdx @@ -90,7 +90,7 @@ sudo apt-get update && sudo apt-get install -y \ git \ pkg-config \ uuid-dev \ - libxmlsec1-dev xmlsec1 \ + xmlsec1 \ --no-install-recommends ``` @@ -106,7 +106,7 @@ git clone --recurse-submodules https://github.com/memgraph/mage.git && cd mage Download and install the [Memgraph Toolchain](https://memgraph.com/docs/getting-started/build-memgraph-from-source#toolchain-installation-procedure): ```bash -curl -L https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-ubuntu-24.04-amd64.tar.gz -o toolchain.tar.gz +curl -L https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-ubuntu-24.04-amd64.tar.gz -o toolchain.tar.gz sudo tar xzvfm toolchain.tar.gz -C /opt ``` @@ -125,8 +125,8 @@ curl https://sh.rustup.rs -sSf | sh -s -- -y export PATH="/root/.cargo/bin:${PATH}" python3 -m pip install -r python/requirements.txt python3 -m pip install -r cpp/memgraph/src/auth/reference_modules/requirements.txt -python3 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-2.3.0+cpu.html -python3 -m pip install dgl -f https://data.dgl.ai/wheels/torch-2.3/repo.html +python3 -m pip install torch-sparse torch-cluster torch-spline-conv torch-geometric torch-scatter -f https://data.pyg.org/whl/torch-2.6.0+cpu.html +python3 -m pip install dgl -f https://data.dgl.ai/wheels/torch-2.6/repo.html ``` {

Run the `setup` script

} @@ -134,7 +134,7 @@ python3 -m pip install dgl -f https://data.dgl.ai/wheels/torch-2.3/repo.html Run the following command: ```shell -source /opt/toolchain-v6/activate +source /opt/toolchain-v7/activate python3 setup build sudo cp -r dist/* /usr/lib/memgraph/query_modules ``` diff --git a/pages/getting-started/build-memgraph-from-source.mdx b/pages/getting-started/build-memgraph-from-source.mdx index 2adad95a6..031b94f12 100644 --- a/pages/getting-started/build-memgraph-from-source.mdx +++ b/pages/getting-started/build-memgraph-from-source.mdx @@ -27,10 +27,6 @@ If you are using Mac M1 or above, please check our [MacOS Lima Compilation Guide](https://www.notion.so/MacOS-Lima-Compilation-Guide-eae1e9dcef5740579c5a41075b8f499b?pvs=21) first. -ARM build instructions are located at [Building Memgraph for ARM64 -CPU](https://www.notion.so/Building-Memgraph-for-ARM64-CPU-a73d243c3c7c4daa94cb574ca8ff9516?pvs=21) -document. - ## Obtaining the Source Code @@ -44,16 +40,22 @@ git clone git@github.com:memgraph/memgraph.git The above will create a `memgraph` directory and put all source code there. -## Downloading the dependencies - -Before you can compile Memgraph, you first need to download its dependencies - In your terminal, position yourself in the obtained memgraph directory. ```bash cd memgraph ``` +There are three different methods for building Memgraph: + +1. Using the `build.sh` script (Recommended) +2. Manually with `conan` and `cmake` (Advanced) +3. Docker (ideal for building on unsupported systems) + +## Downloading the dependencies (required by methods 1 and 2) + +Before you can compile Memgraph, you first need to download its dependencies. + Building Memgraph depends on some system-wide packages. The installation scripts can be found under `environment/os/`. The directory contains a dependencies management script for each supported operating system. @@ -69,11 +71,11 @@ not necessary for the toolchain but are required by Memgraph. - Based on your OS, version and architecture, execute appropriate scripts (e.g., on **Debian 11**, NOTE: the following commands/scripts are located under [memgraph repository](https://github.com/memgraph/memgraph/tree/master/environment/os): + Based on your OS, version and architecture, execute appropriate scripts (e.g., on **Debian 12**, NOTE: the following commands/scripts are located under [memgraph repository](https://github.com/memgraph/memgraph/tree/master/environment/os): ```bash - sudo ./environment/os/debian-11.sh install TOOLCHAIN_RUN_DEPS - sudo ./environment/os/debian-11.sh install MEMGRAPH_BUILD_DEPS + sudo ./environment/os/debian-12.sh install TOOLCHAIN_RUN_DEPS + sudo ./environment/os/debian-12.sh install MEMGRAPH_BUILD_DEPS ``` For ARM look for `-arm` in the script name (e.g., on Ubuntu 24.04 with Apple M processor): @@ -86,7 +88,7 @@ not necessary for the toolchain but are required by Memgraph. Once everything is installed, you can proceed to the compilation. -## Compiling +## Toolchain installation procedure (required by methods 1 and 2) Memgraph is compiled using our own custom toolchain that can be obtained from the toolchain repository. All our tools used in the development of Memgraph are @@ -106,20 +108,20 @@ You should read the [Toolchain](https://www.notion.so/Toolchain-37c37c84382149a58d09b2ccfcb410d7?pvs=21) to install the appropriate toolchain for your distribution. -### Toolchain installation procedure - Download the toolchain for your operating system from one of the following links: -- [CentOS 9](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-centos-9-x86_64.tar.gz) -- [CentOS 10](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-centos-10-x86_64.tar.gz) -- [Debian 11 (x86_64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-debian-11-amd64.tar.gz) -- [Debian 11 (arm64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-debian-11-arm64.tar.gz) -- [Debian 12 (x86_64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-debian-12-amd64.tar.gz) -- [Debian 12 (arm64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-debian-12-arm64.tar.gz) -- [Fedora 41 (x86_64)](https://s3.eu-west-1.amazonaws.com/download.memgraph.com/memgraph/v3.1.1/fedora-41/memgraph-3.1.1_1-1.x86_64.rpm) -- [Ubuntu 22.04 (x86_64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-ubuntu-22.04-amd64.tar.gz) -- [Ubuntu 24.04 (x86_64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-ubuntu-24.04-amd64.tar.gz) -- [Ubuntu 24.04 (arm64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v6/toolchain-v6-binaries-ubuntu-24.04-arm64.tar.gz) +- [CentOS 9](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-centos-9-x86_64.tar.gz) +- [CentOS 10](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-centos-10-x86_64.tar.gz) +- [Debian 11 (x86_64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-debian-12-amd64.tar.gz) +- [Debian 11 (arm64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-debian-12-arm64.tar.gz) +- [Debian 12 (x86_64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-debian-13-amd64.tar.gz) +- [Debian 12 (arm64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-debian-13-arm64.tar.gz) +- [Fedora 41 (x86_64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-fedora-42-x86_64.tar.gz) +- [Fedora 41 (arm64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-fedora-42-aarch64.tar.gz) +- [Rocky Linux 10 (x86_64)](https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-rocky-10-x86_64.tar.gz) +- [Ubuntu 22.04 (x86_64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-ubuntu-22.04-amd64.tar.gz) +- [Ubuntu 24.04 (x86_64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-ubuntu-24.04-amd64.tar.gz) +- [Ubuntu 24.04 (arm64)](https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/toolchain-v7/toolchain-v7-binaries-ubuntu-24.04-arm64.tar.gz) Extract the toolchain with the following command: @@ -130,98 +132,152 @@ sudo tar xzvfm {{toolchain-archive}}.tar.gz -C /opt After you have installed the toolchain, you should read the instructions for the -toolchain in the toolchain install directory (`/opt/toolchain-v6/README.md`) +toolchain in the toolchain install directory (`/opt/toolchain-v7/README.md`) and install dependencies that are necessary to run the toolchain. If you have not already installed toolchain dependencies, please check and -install required toolchain runtime dependencies by executing - -```bash -sudo ./environment/os/install_deps.sh check TOOLCHAIN_RUN_DEPS -sudo ./environment/os/install_deps.sh install TOOLCHAIN_RUN_DEPS -``` +install required toolchain runtime dependencies as in the section above. - Based on your OS, version and architecture, execute appropriate scripts (e.g., on Debian 11, NOTE: the following commands/scripts are located under [memgraph repository](https://github.com/memgraph/memgraph)): +If you put the toolchain on some other path, it’s possible to say to the `cmake` +the root is there, that is done by [setting `MG_TOOLCHAIN_ROOT` environment +variable](https://www.notion.so/If-you-put-toolchain-on-some-other-path-it-s-possible-to-say-to-the-cmake-there-the-root-is-that-s-e45311092e9a454eb73c720bf9ef04c1?pvs=21). - ```bash - sudo ./environment/os/debian-11.sh check TOOLCHAIN_RUN_DEPS - sudo ./environment/os/debian-11.sh install TOOLCHAIN_RUN_DEPS - ``` - - For ARM look for `-arm` in script name (e.g. on Ubuntu 24.04 with Apple M processor): - - ```bash - sudo ./environment/os/ubuntu-24.04-arm.sh check TOOLCHAIN_RUN_DEPS - sudo ./environment/os/ubuntu-24.04-arm.sh install TOOLCHAIN_RUN_DEPS - ``` - +That’s also useful where you have different versions of libraries under system +compare to what the Memgraph build process needs. + + + +## Using the `build.sh` script -When you want to compile Memgraph, you should activate the toolchain using the -prepared toolchain activation script that is also described in the toolchain -`README`. +This method should be the easiest way to build Memgraph directly on a compatible host system. -You must activate the toolchain every time you want to compile Memgraph: +Calling the script with no arguments will build everything, including tests, for the `Release` build type: ```bash -source /opt/toolchain-v6/activate +./build.sh ``` -In case you need to deactivate the toolchain, you can run: +Optionally you can specify target and build types, e.g. ```bash -deactivate +./build.sh --target memgraph --build-type Debug ``` - +where the build type can be `Release` (default), `Debug` or `RelWithDebInfo`. -If you put the toolchain on some other path, it’s possible to say to the `cmake` -the root is there, that is done by [setting `MG_TOOLCHAIN_ROOT` environment -variable](https://www.notion.so/If-you-put-toolchain-on-some-other-path-it-s-possible-to-say-to-the-cmake-there-the-root-is-that-s-e45311092e9a454eb73c720bf9ef04c1?pvs=21). -That’s also useful where you have different versions of libraries under system -compare to what the Memgraph build process needs. +Other cmake options can be passed as well, e.g. to disable testing: - +```bash +./build.sh --target memgraph --build-type Release -DMG_ENABLE_TESTING=OFF +``` + +The resulting binary will be in the `build/` directory. + +## Using `conan` and `cmake` -## Installing Memgraph dependencies +This approach offers greater flexibility and granular control over the build process. +While it performs the same operations as the `build.sh` script, it gives you direct access +to configure individual build parameters and dependencies. -In addition to the system-wide dependencies, Memgraph requires certain libraries -to be built locally. The proper setup of these libraries should be checked by -running the `init` script: +To build Memgraph using this method, follow these steps: +1. Create a Python virtual environment and install `conan`: +```bash +python3 -m venv env +source env/bin/activate +pip install conan +conan profile detect +``` + +2. Run the init script to fetch other libs required for the build: ```bash ./init ``` - +3. Install conan dependencies: +```bash +export MG_TOOLCHAIN_ROOT=/opt/toolchain-v7 +conan install . --build=missing -pr ./memgraph_template_profile -s build_type=Release +source build/generators/conanbuild.sh +``` -Make sure to activate the toolchain before the `./init` command. +4. Configure the project with cmake - note that the name of the preset depends on the build type set in the previous step: +```bash +cmake --preset conan-release +``` + +5. Build the project (this will build everything, including tests): +```bash +cmake --build --preset conan-release -j$(nproc) +``` + +6. Or for a specific target (e.g. Memgraph binary): +```bash +cmake --build --preset conan-release --target memgraph -j$(nproc) +``` - -With all of the dependencies installed and the build environment set-up, you -need to configure the build system. To do that, execute the following: +## Using Docker + +Start by setting the environment variables for the desired OS, architecture, and build type: ```bash -mkdir -p build -cd build -cmake .. +export OS="ubuntu-24.04" +export ARCH="amd" # or arm +export BUILD_TYPE="Release" +export TOOLCHAIN="v7" ``` -If only Memgraph binary is required you can run build using: +Next, pull the appropriate Docker image for the build, e.g.: -```jsx -make -j$(nproc) memgraph +```bash +docker pull memgraph/mgbuild:v7_ubuntu-24.04 ``` -If you need to compile the whole project (e.g., unit tests) run: +Available image tags can be found [here](https://hub.docker.com/r/memgraph/mgbuild/tags). + +Then spin up the container: ```bash -make -j$(nproc) +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os $OS \ + --arch $ARCH \ + --build-type $BUILD_TYPE \ + run +``` + +Then build Memgraph: +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os $OS \ + --arch $ARCH \ + --build-type $BUILD_TYPE \ + build-memgraph +``` + +Run Memgraph inside the container (the name of the container will look something like `mgbuild_v7_ubuntu-24.04`): +```bash +# find the name of the container +docker ps + +# run Memgraph +docker exec -i mgbuild_v7_ubuntu-24.04 bash -c "cd /home/mg/memgraph && ./build/memgraph" +``` + +Stop the container: +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os $OS \ + --arch $ARCH \ + stop --remove ``` ## Running Memgraph @@ -232,8 +288,20 @@ After the compilation, verify that Memgraph works: ./memgraph --version ``` -The unit tests can be run using +The unit tests can be run using: ```bash ctest -R unit -j$(nproc) ``` + +Or in Docker: + +```bash +./release/package/mgbuild.sh \ + --toolchain $TOOLCHAIN \ + --os $OS \ + --arch $ARCH \ + --enterprise-license $MEMGRAPH_ENTERPRISE_LICENSE \ + --organization-name $MEMGRAPH_ORGANIZATION_NAME \ + test-memgraph unit +``` diff --git a/pages/getting-started/install-memgraph.mdx b/pages/getting-started/install-memgraph.mdx index 2f468fba1..70cf61d1f 100644 --- a/pages/getting-started/install-memgraph.mdx +++ b/pages/getting-started/install-memgraph.mdx @@ -83,7 +83,7 @@ installation options and pick the preferred one. href="/getting-started/install-memgraph/wsl" /> diff --git a/pages/getting-started/install-memgraph/debian.mdx b/pages/getting-started/install-memgraph/debian.mdx index 33faf1e46..f1b392cef 100644 --- a/pages/getting-started/install-memgraph/debian.mdx +++ b/pages/getting-started/install-memgraph/debian.mdx @@ -9,7 +9,7 @@ import CodeSnippet from '/components/code-snippet/CodeSnippet' # Install Memgraph on Debian -Install and run Memgraph on Debian 11 or Debian 12. +Install and run Memgraph on Debian 12 or Debian 13. Newer versions of Memgraph might not be backward diff --git a/pages/getting-started/install-memgraph/fedora.mdx b/pages/getting-started/install-memgraph/fedora.mdx index 230cb65f7..89c828ed5 100644 --- a/pages/getting-started/install-memgraph/fedora.mdx +++ b/pages/getting-started/install-memgraph/fedora.mdx @@ -10,7 +10,7 @@ import CodeSnippet from '/components/code-snippet/CodeSnippet' # Install Memgraph on Fedora from RPM package Install and run Memgraph from a RPM package on: - - **Fedora 41** + - **Fedora 42** Newer versions of Memgraph might not be backward @@ -32,9 +32,9 @@ You can also use [direct download links](/getting-started/install-memgraph/direct-download-links) to get the latest Memgraph packages. -For example, for Fedora 39: +For example, for Fedora 42: - + @@ -50,7 +50,7 @@ After downloading the Memgraph RPM package, you can install it by issuing the following command: ``` console -sudo dnf install -y ./memgraph-3.1.1_1-1.x86_64.rpm +sudo dnf install -y ./memgraph-3.7.0_1-1.x86_64.rpm ``` If you run into any troubles while installing Memgraph, contact us on diff --git a/pages/getting-started/install-memgraph/rocky.mdx b/pages/getting-started/install-memgraph/rocky.mdx index 045ad9073..a0ff55afd 100644 --- a/pages/getting-started/install-memgraph/rocky.mdx +++ b/pages/getting-started/install-memgraph/rocky.mdx @@ -9,15 +9,9 @@ import CodeSnippet from '/components/code-snippet/CodeSnippet' # Install Memgraph on Rocky from RPM package - -The last released Memgraph RPM package for Rocky was for version 3.0.0. If you -require a package for a newer version, please [open an -issue](https://github.com/memgraph/memgraph/issues) on the Memgraph GitHub -repository. - Install and run Memgraph from a RPM package on: - - **Rocky 9.3** + - **Rocky 10** Newer versions of Memgraph might not be backward @@ -41,7 +35,7 @@ latest Memgraph packages. For example: - + @@ -57,7 +51,7 @@ After downloading the Memgraph RPM package, you can install it by issuing the following command: ``` -sudo dnf install -y ./memgraph-3.0.0_1-1.x86_64.rpm +sudo dnf install -y ./memgraph-3.7.0_1-1.x86_64.rpm ``` If you run into any troubles while installing Memgraph, contact us on