diff --git a/README.md b/README.md index 5cadbbe..cbcf5ad 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,33 @@ ## CFPQ_PyAlgo The CFPQ_PyAlgo is a repository for developing, testing and evaluating solvers for -Formal-Language-Constrained Path Problems, such as Context-Free Path Queries and Regular Path Queries. +Formal-Language-Constrained Path Problems, such as Context-Free Path Queries (CFPQ) and Regular Path Queries (RPQ). -All algorithms are based on the [GraphBLAS](http://graphblas.org/index.php?title=Graph_BLAS_Forum) framework that allows to represent graphs as matrices +All algorithms are based on the [GraphBLAS](http://graphblas.org) framework that allows to represent graphs as matrices and work with them in terms of linear algebra. ## Installation -First of all you need to clone repository with its submodules: -```bash -git clone --recurse-submodules -b murav/optimize-matrix https://github.com/JetBrains-Research/CFPQ_PyAlgo.git -cd CFPQ_PyAlgo/ -git submodule init -git submodule update -``` -Then the easiest way to get started is to use Docker. An alternative is to install everything directly. - -### Using Docker -The first way to start is to use Docker: - -```bash -# build docker image -docker build --tag cfpq_py_algo . - -# run docker container -docker run --rm -it -v ${PWD}:/CFPQ_PyAlgo cfpq_py_algo bash -``` -After it, you can develop everything locally and run tests and benchmarks inside the container. -Also, you can use PyCharm Professional and [configure an interpreter using Docker](https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html). - -### Direct install -The other way is to install everything into your local Python 3.9 interpreter or virtual environment. - -First of all you need to install [pygraphblas](https://github.com/michelp/pygraphblas) package. -```bash -pip3 install pygraphblas==5.1.8.0 -``` -Secondly you need to install `cfpq_data_devtools` package and other requirements: - -```bash -cd deps/CFPQ_Data -pip3 install -r requirements.txt -python3 setup.py install --user - -cd ../../ -pip3 install pygraphblas==5.1.8.0 # optional (needed for legacy algorithms and their tests) -pip3 install -r requirements.txt -``` -To check if the installation was successful you can run simple tests -```bash -python3 -m pytest test -v -m "CI" -``` +For the installation instructions, refer to [docs/install.md](docs/install.md). ## CLI -CFPQ_Algo provides a command line interface for running +CFPQ_PyAlgo provides a command line interface for running all-pairs CFPQ solver with relation query semantics. -See [cfpq_cli/README](cfpq_cli/README.md) for more details. +For more details, refer to [docs/cli.md](docs/cli.md). ## Evaluation -CFPQ_PyAlgo provides scripts for performing evaluating performance -of various CFPQ solvers (icluding third-party ones). +CFPQ_PyAlgo provides scripts for evaluating performance +of various CFPQ solvers (including third-party ones). -See [cfpq_eval/README](cfpq_eval/README.md) for more details. +For more details, refer to [docs/eval.md](docs/eval.md). ## Project structure -The global project structure is the following: +The global project structure is the following. ``` -├── cfpq_algo - new optimized CFPQ algorithm implementations +├── cfpq_algo - FastMatrixCFPQ and MatrixCFPQ algorithms implementations ├── cfpq_cli - scripts for running CFPQ algorithms ├── cfpq_eval - scripts for evaluating performance of various CFPQ solvers (icluding third-party ones) ├── cfpq_matrix - matrix wrappers that improve performance of operations with matrices diff --git a/cfpq_cli/README.md b/cfpq_cli/README.md index ff8aa8d..fa7d03f 100644 --- a/cfpq_cli/README.md +++ b/cfpq_cli/README.md @@ -1,106 +1,7 @@ -# CFPQ_CLI +## CFPQ CLI The `cfpq_cli` module provides a Command Line Interface (CLI) for solving -Context-Free Language Reachability (CFL-r) problem for all vertex pairs +[the Context-Free Language Reachability (CFL-r) problem](../docs/clfr_problem) for all vertex pairs in a graph with respect to a specified context-free grammar. -## Getting Started - -Ensure the CFPQ_PyAlgo project is properly set up on your system before using the CLI. -Setup instructions are available in the project's main [README](../README.md). - -## Usage - -### Running the Script - -For detailed information on script options, execute the following command: - -```bash -cd .. # Should be run from CFPQ_PyAlgo project root directory -python3 -m cfpq_cli.run_all_pairs_cflr --help -``` - -The basic command usage is as follows: - -``` -python3 -m cfpq_cli.run_all_pairs_cflr [OPTIONS] ALGORITHM GRAPH GRAMMAR -``` - -- `ALGORITHM` selects the algorithm. The available options are `IncrementalAllPairsCFLReachabilityMatrix` and `NonIncrementalAllPairsCFLReachabilityMatrix`. -- `GRAPH` specifies the path to the graph file. -- `GRAMMAR` indicates the path to the grammar file. - -#### Optional Arguments - -- `--time-limit TIME_LIMIT` sets the maximum execution time in seconds. -- `--out OUT` specifies the output file for saving vertex pairs. -- `--disable-optimize-block-matrix` disables the optimization of block matrices. -- `--disable-optimize-empty` disables the optimization for empty matrices. -- `--disable-lazy-add` disables lazy addition optimization. -- `--disable-optimize-format` disables optimization of matrix formats. - -### Example - -To solve the CFL-R problem using an incremental algorithm with a 60-second time limit for -[indexed_tree.g](../test/pocr_data/indexed_an_bn/indexed_tree.g) and -[an_bn_indexed.cnf](../test/pocr_data/indexed_an_bn/an_bn_indexed.cnf) and get results in -[results.txt](../results.txt) execute: - -```bash -cd .. # Should be run from CFPQ_PyAlgo project root directory -python3 -m cfpq_cli.run_all_pairs_cflr \ - IncrementalAllPairsCFLReachabilityMatrix \ - test/pocr_data/indexed_an_bn/indexed_tree.g \ - test/pocr_data/indexed_an_bn/an_bn_indexed.cnf \ - --time-limit 60 \ - --out results.txt -``` - -### Grammar Format - -The grammar file should be formatted with each production rule on a separate line, adhering to the following schema: - -``` - [RIGHT_SYMBOL_1] [RIGHT_SYMBOL_2] -``` - -- ``: the symbol on the left-hand side of a production rule. -- `` and ``: the symbols on the right-hand side of the production rule, each of them is optional. -- The symbols must be separated by whitespace. -- The last two line specify the start symbol in the format - ``` - Count: - - ``` - -#### Example -``` -S AS_i b_i -AS_i a_i S -S c - -Count: -S -``` - -### Graph Format - -The graph file should represent edges using the format: - -``` - [LABEL_INDEX] -``` - -- `` and ``: specify the source and destination nodes of an edge. -- ``: the label associated with the edge. -- `[LABEL_INDEX]`: an optional index for labels with subscripts, indicating the subscript value. -- The symbols must be separated by whitespace -- Labels with subscripts must end with "\_i". For example, an edge $1 \xrightarrow{x_10} 2$ is denoted by `1 2 x_i 10`. - -#### Example -``` -1 2 a_i 1 -2 3 b_i 1 -2 4 b_i 2 -1 5 c -``` +For more details, refer to [docs/cli.md](../docs/cli.md). diff --git a/cfpq_eval/README.md b/cfpq_eval/README.md index ad40fbf..f92a918 100644 --- a/cfpq_eval/README.md +++ b/cfpq_eval/README.md @@ -1,98 +1,6 @@ -# CFPQ Evaluation +## CFPQ Evaluator -The `cfpq_eval` module evaluates performance of various CFPQ solvers, -integrating with both CFPQ_PyAlgo itself and third-party tools. +The `cfpq_eval` module is responsible for evaluating performance of various Context-Free Path Querying (CFPQ) solvers, +including both CFPQ_PyAlgo itself and third-party tools. -## Setting up the environment - -Build and run a Docker container for evaluation using [Dockerfile-all-tools](../Dockerfile-all-tools). - -Build Docker image: -```bash -cd .. # Should be run from CFPQ_PyAlgo project root directory - -# Load base image -wget -O pearl.tar.gz https://figshare.com/ndownloader/files/42214812 -docker load --input pearl.tar.gz -rm pearl.tar.gz - -# Build eval image -docker build -f Dockerfile-all-tools -t cfpq/py_algo_eval . -``` - -Run Docker container: -```bash -docker run -it cfpq/py_algo_eval bash -``` - -## Running the Script - -For detailed information on evaluation script options, execute the following command: - -```bash -cd .. # Should be run from CFPQ_PyAlgo project root directory -python3 -m cfpq_eval.eval_all_pairs_cflr --help -``` - -The basic command usage is as follows: - -``` -# Should be run in cfpq_eval Docker container -python3 -m cfpq_eval.eval_all_pairs_cflr algo_config.csv data_config.csv results_path [--rounds ROUNDS] [--timeout TIMEOUT] -``` - -- `algo_config.csv` specifies algorithm configurations (e.g. `configs/algo/fast_matrix_cfpq.csv`). -- `data_config.csv` specifies the dataset (e.g. `configs/data/small_examples.csv`). -- `results_path` specifies path for saving raw results. -- `--rounds` sets run times per config (default is 1). -- `--timeout` limits each configuration's execution time in seconds (optional). - -## Configuration Files - -### Premade Configurations - -The CFPQ_eval Docker image includes premade configurations located in the `/py_algo/configs` folder. -### Algorithm Configuration - -The `algo_config.csv` outlines algorithms and settings. Supported algorithms: - -- `IncrementalAllPairsCFLReachabilityMatrix` -- `NonIncrementalAllPairsCFLReachabilityMatrix` -- `pocr` -- `pearl` -- `graspan` -- `gigascale` - -For Matrix-based algorithms options described in [cfpq_cli/README](../cfpq_cli/README.md) -can be used to alter the behaviour. - -#### Example - -``` -algo_name,algo_settings -"Matrix (some optimizations disabled)",IncrementalAllPairsCFLReachabilityMatrix --disable-optimize-empty --disable-lazy-add -"pocr",pocr -``` - -### Data Configuration - -The `data_config.csv` pairs graph and grammar files, -referenced files should be in format described in [cfpq_cli/README](../cfpq_cli/README.md). - -#### Example - -``` -graph_path,grammar_path -data/graphs/aa/leela.g,data/grammars/aa.cnf -data/graphs/java/eclipse.g,data/grammars/java_points_to.cnf -``` - -## Interpreting Results - -Raw data is saved to `results_path`, while quick summary including mean execution time, -memory usage, and output size are rendered in standard output stream. - -## Custom Tools Integration - -Custom CFPQ solvers can be evaluated by implementing `AllPairsCflrToolRunner` interface -and updating `run_appropriate_all_pairs_cflr_tool()` function. +For more details, refer to [docs/eval.md](../docs/eval.md). diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..d916b59 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,10 @@ +## CFPQ_PyAlgo Documentation + +This folder contains documentation for CFPQ_PyAlgo project. + +## Contents + +- [Solver installation](install.md) +- [Solver usage](cli.md) +- [Performance evaluator installation](eval_install.md) +- [Performance evaluator usage](eval.md) \ No newline at end of file diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 0000000..20033d9 --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,106 @@ +## CFPQ CLI + +This document explains how to use the Context-Free Path Query (CFPQ) solver +via the command line interface (CLI). + +For installation instructions, refer to [install.md](install.md). + +## Running the Tool + +For detailed information on the tool's options, execute the following command. + +```bash +# Ensure we're in the project root directory +cd $(git rev-parse --show-toplevel) + +python3 -m cfpq_cli.run_all_pairs_cflr --help +``` + +The basic command usage is as follows. + +``` +python3 -m cfpq_cli.run_all_pairs_cflr [OPTIONS] ALGORITHM GRAPH GRAMMAR +``` + +### Required Arguments + +- `ALGORITHM` specifies the algorithm to use. The available options are `IncrementalAllPairsCFLReachabilityMatrix` and `NonIncrementalAllPairsCFLReachabilityMatrix`. +- `GRAPH` specifies the path to the [graph file](#graph-format). +- `GRAMMAR` specifies the path to the [grammar file](#grammar-format). + +### Optional Arguments + +- `--time-limit TIME_LIMIT` sets the maximum execution time in seconds. +- `--out OUT` specifies the output file for saving vertex pairs. +- `--disable-optimize-block-matrix` disables optimization involving block matrix operations. +- `--disable-optimize-empty` disables optimization for operations with empty matrices. +- `--disable-lazy-add` disables lazy (symbolic) addition optimization. +- `--disable-optimize-format` disables matrix format optimization. + +## Example + +To solve the all-pairs relation-semantics CFPQ problem using an incremental algorithm with a 60-second time limit for +[indexed_tree.g](../test/pocr_data/indexed_an_bn/indexed_tree.g) graph and +[an_bn_indexed.cnf](../test/pocr_data/indexed_an_bn/an_bn_indexed.cnf) grammar and save results to +[results.txt](../results.txt) execute the following command. + +```bash +# Ensure we're in the project root directory +cd $(git rev-parse --show-toplevel) + +python3 -m cfpq_cli.run_all_pairs_cflr \ + IncrementalAllPairsCFLReachabilityMatrix \ + test/pocr_data/indexed_an_bn/indexed_tree.g \ + test/pocr_data/indexed_an_bn/an_bn_indexed.cnf \ + --time-limit 60 \ + --out results.txt +``` + +## Grammar Format + +The grammar file should be formatted with each production rule on a separate line, adhering to the following schema. + +``` + [RIGHT_SYMBOL_1] [RIGHT_SYMBOL_2] +``` + +- `` is the symbol on the left-hand side of a production rule. +- `[RIGHT_SYMBOL_1]` and `[RIGHT_SYMBOL_2]` are the symbols on the right-hand side of the production rule, each of them is optional. +- Symbols must be separated by whitespace. +- The last two lines specify the start symbol in the following format. + ``` + Count: + + ``` + +### Example +``` +S AS_i b_i +AS_i a_i S +S c + +Count: +S +``` + +## Graph Format + +Each line of the graph file should represent an edge, adhering to the following format. + +``` + [LABEL_INDEX] +``` + +- `` and `` are source and destination nodes of an edge. +- `` is the label associated with the edge. +- `[LABEL_INDEX]` is an optional index for labels with subscripts, indicating the subscript value. +- Symbols must be separated by whitespace +- Labels with subscripts must end with "\_i". For example, an edge $1 \xrightarrow{x_10} 2$ is denoted as `1 2 x_i 10`. + +### Example +``` +1 2 a_i 1 +2 3 b_i 1 +2 4 b_i 2 +1 5 c +``` diff --git a/docs/eval.md b/docs/eval.md new file mode 100644 index 0000000..5d92264 --- /dev/null +++ b/docs/eval.md @@ -0,0 +1,111 @@ +## CFPQ Evaluator + +This document explains how to use `CFPQ_eval` to evaluate the performance of various Context-Free Path Querying (CFPQ) +solvers, including both the `CFPQ_PyAlgo` solver and third-party tools. + +To install the `CFPQ_eval` tool, refer to [eval_install.md](eval_install.md). + +## Running the Tool + +For detailed information on the evaluator options, execute the following command. + +```bash +# Ensure we're in the project root directory +cd $(git rev-parse --show-toplevel) + +python3 -m cfpq_eval.eval_all_pairs_cflr --help +``` + +The basic command usage is as follows. +Note that this command should be run in [the cfpq/py_algo_eval Docker container](eval_install.md). + +``` +python3 -m cfpq_eval.eval_all_pairs_cflr algo_config.csv data_config.csv results_path [--rounds ROUNDS] [--timeout TIMEOUT] +``` + +- `algo_config.csv` specifies algorithm configurations (e.g. `configs/algo/fast_matrix.csv`); +- `data_config.csv` specifies the dataset (e.g. `configs/data/small_examples.csv`); +- `results_path` specifies the path for saving raw results; +- `--rounds` specifies the number of reruns (default is 1); +- `--timeout` specifies the maximum number of seconds a single CFPQ tool invocation can take (optional). + +## Configuration Files + +### Premade Configurations + +The `CFPQ_eval` Docker image includes premade configurations located in the `/py_algo/configs` folder. + +### Algorithm Configuration + +The `algo_config.csv` configuration should list algorithms and their settings. + +Supported algorithms: + +- `IncrementalAllPairsCFLReachabilityMatrix` (this tool) +- `NonIncrementalAllPairsCFLReachabilityMatrix` (this tool) +- [`pocr`](https://github.com/kisslune/POCR) +- [`pearl`](https://figshare.com/articles/dataset/ASE_2023_artifact/23702271) +- [`graspan`](https://github.com/Graspan/Graspan-C) +- [`gigascale`](https://bitbucket.org/jensdietrich/gigascale-pointsto-oopsla2015/src) +- [`kotgll`](https://github.com/vadyushkins/kotgll) + +For Matrix-based algorithms, options described in [cli.md](cli.md) +can be used to change the performance. + +Here's an algorithm configuration example: +``` +algo_name,algo_settings +"Matrix (some optimizations disabled)",IncrementalAllPairsCFLReachabilityMatrix --disable-optimize-empty --disable-lazy-add +"pocr",pocr +``` + +### Data Configuration + +The `data_config.csv` configuration pairs graph and grammar files. +The referenced files should be in the format described in [cli.md](cli.md). +The paths must be relative to the `CFPQ_PyAlgo` root directory. + +Here's a data configuration example: +``` +graph_path,grammar_path +data/graphs/aa/leela.g,data/grammars/aa.cnf +data/graphs/java/eclipse.g,data/grammars/java_points_to.cnf +``` + +## Interpreting Results + +During evaluation, raw data is printed to `stdout` and saved to the folder specified by `results_path`. + +After the evaluation, summary tables, including mean execution time, +memory usage, and output size, will be printed to `stdout`. + +Here's an example of a mean execution time summary table: +``` +============================================ TIME, SEC (grammar 'c_alias') ============================================ +| graph | fast matrix | fast matrix | matrix cfpq | pearl | pocr | kotgll | gigascale | graspan | +| | cfpq | cfpq (no | | | | | | | +| | | grammar | | | | | | | +| | | rewrite) | | | | | | | +|:---------|:--------------|:--------------|:--------------|:--------|:----------|:---------|:------------|:----------| +| init | 1.2 ± 3% | 2.9 | 7.0 ± 1% | - | 85 | 23 ± 6% | - | 16 ± 14% | +| mm | 1.3 ± 2% | 3.1 | 7.5 | - | 89 ± 1% | 25 ± 3% | - | 16 ± 5% | +| block | 1.7 ± 2% | 4.1 | 11 ± 1% | - | 123 | 34 ± 3% | - | 21 ± 2% | +| ipc | 1.7 ± 4% | 4.0 | 10 ± 1% | - | 121 ± 1% | 34 ± 1% | - | 21 ± 3% | +| lib | 1.7 ± 2% | 4.0 | 11 ± 1% | - | 123 ± 1% | 34 ± 1% | - | 21 ± 3% | +| arch | 1.7 ± 3% | 4.1 | 11 ± 1% | - | 123 ± 1% | 34 ± 5% | - | 22 ± 10% | +| crypto | 1.7 ± 3% | 4.2 | 11 ± 1% | - | 125 ± 1% | 34 ± 2% | - | 22 ± 8% | +| security | 1.8 ± 4% | 4.4 | 11 ± 1% | - | 129 ± 1% | 35 ± 5% | - | 22 ± 5% | +| sound | 2.0 ± 2% | 5.0 | 12 | - | 140 ± 1% | 38 ± 5% | - | 24 ± 11% | +| fs | 2.5 ± 2% | 6.9 | 17 | - | 230 ± 1% | 53 ± 1% | - | 34 ± 3% | +| net | 2.6 ± 3% | 7.4 | 20 | - | 221 ± 1% | 52 ± 1% | - | 35 ± 2% | +| drivers | 3.9 ± 2% | 12 ± 1% | 28 ± 1% | - | 755 ± 1% | 92 ± 3% | - | 69 ± 3% | +| kernel | 6.1 ± 2% | 13 | 43 | - | 387 ± 1% | 118 ± 2% | - | 69 ± 3% | +| apache | 6.5 ± 1% | 26 ± 1% | 84 | - | OOT | OOM | - | 601 ± 2% | +| postgre | 10 ± 1% | 36 ± 1% | 104 | - | 5398 ± 1% | OOM | - | 427 ± 4% | +======================================================================================================================= +``` + +## Custom Tools Integration + +Custom CFPQ solvers can be evaluated by implementing the `AllPairsCflrToolRunner` interface +and updating the `run_appropriate_all_pairs_cflr_tool()` function. diff --git a/docs/eval_install.md b/docs/eval_install.md new file mode 100644 index 0000000..d62820c --- /dev/null +++ b/docs/eval_install.md @@ -0,0 +1,72 @@ +## Evaluator Installation + +This document describes how to install the CFPQ_PyAlgo evaluator, +a tool for evaluating the performance of various CFPQ solvers. + +There are two ways to install the CFPQ_PyAlgo evaluator. +Choose one based on whether you need a stable or development version. + +**NOTE**: Some third-party tools are only available for x64 CPU architecture, +so you can only use the evaluator on that architecture. +For other CPU architectures, you can still use CFPQ_PyAlgo without the performance evaluator +(see [install.md](install.md)). + +### Pre-Built Docker Image + +This is the fastest way to install any stable CFPQ_PyAlgo evaluator version. + +
+ Instructions + + 1. Download the [image from DockerHub](https://hub.docker.com/r/cfpq/py_algo_eval). + If needed, replace the `latest` tag with a desired version. + ```bash + docker pull cfpq/py_algo_eval:latest + ``` + + 2. Run the container. + ```bash + docker run -it cfpq/py_algo_eval:latest + ``` + + 3. Refer to [eval.md](eval.md) for further usage instructions. + +
+ +### Docker Image from Sources + +This is the way to install the CFPQ_PyAlgo evaluator from sources. + +
+ Instructions + + 1. Clone the repository with its submodules. + ```bash + git clone --recurse-submodules -b murav/optimize-matrix https://github.com/JetBrains-Research/CFPQ_PyAlgo.git + cd CFPQ_PyAlgo/ + git submodule init + git submodule update + ``` + + 2. Build the Docker image. + ```bash + # Ensure we're in the project root directory + cd $(git rev-parse --show-toplevel) + + # Load base image + wget -O pearl.tar.gz https://figshare.com/ndownloader/files/42214812 + docker load --input pearl.tar.gz + rm pearl.tar.gz + + # Build the eval image + docker build -f Dockerfile-all-tools -t cfpq/py_algo_eval:from-source . + ``` + + 3. Run the container. + ```bash + docker run -it cfpq/py_algo_eval:from-source + ``` + + 4. Refer to [eval.md](eval.md) for further usage instructions. + +
diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..0762094 --- /dev/null +++ b/docs/install.md @@ -0,0 +1,110 @@ +## Installation + +This document describes how to install CFPQ_PyAlgo for regular use. + +To compare the CFPQ_PyAlgo performance with that of third-party CFPQ solvers, +you need a separate evaluation installation that includes third-party solvers and datasets +(see [eval_install.md](eval_install.md)). + +There are three ways to install CFPQ_PyAlgo. +Choose one based on whether you need a stable or development version and whether you prefer to use Docker. + +### Pre-Built Docker Images + +This is the fastest way to install any stable CFPQ_PyAlgo version. + +
+ Instructions + + 1. Download the [image from DockerHub](https://hub.docker.com/r/cfpq/py_algo). + If needed, replace the `latest` tag with a desired version. + ```bash + docker pull cfpq/py_algo:latest + ``` + + 2. Run the container. + ```bash + docker run -it cfpq/py_algo:latest + ``` + + 3. Refer to [cli.md](cli.md) for further usage instructions. + +
+ +### Docker Image from Sources + +This is the way to install CFPQ_PyAlgo from sources while still using Docker. + +
+ Instructions + + 1. Clone the repository with its submodules. + ```bash + git clone --recurse-submodules -b murav/optimize-matrix https://github.com/JetBrains-Research/CFPQ_PyAlgo.git + cd CFPQ_PyAlgo/ + git submodule init + git submodule update + ``` + + 2. Build the Docker image. + ```bash + # Ensure we're in the project root directory + cd $(git rev-parse --show-toplevel) + + docker build --tag cfpq/py_algo:from-source . + ``` + + 3. Run the container. + ```bash + docker run -it cfpq/py_algo:from-source + ``` + + 4. Refer to [cli.md](cli.md) for further usage instructions. + +
+ +### Direct Installation from Sources + +This is the way to install CFPQ_PyAlgo from sources without using Docker. + +
+ Instructions + + 1. Ensure that your OS is Linux-based. + If it's not, use one of the Docker-based installation methods. + + 2. Clone the repository with its submodules. + ```bash + git clone --recurse-submodules -b murav/optimize-matrix https://github.com/JetBrains-Research/CFPQ_PyAlgo.git + cd CFPQ_PyAlgo/ + git submodule init + git submodule update + ``` + + 3. Install legacy dependencies (if you skip this step tests for legacy algorithms won't pass). + ```bash + pip3 install pygraphblas==5.1.8.0 + cd $(git rev-parse --show-toplevel)/deps/CFPQ_Data + pip3 install -r requirements.txt + python3 setup.py install --user + ``` + + 4. Install production dependencies. + ```bash + # Ensure we're in the project root directory + cd $(git rev-parse --show-toplevel) + + pip3 install -r requirements.txt + ``` + + 5. Check if the installation was successful by running tests. + ```bash + # Ensure we're in the project root directory + cd $(git rev-parse --show-toplevel) + + python3 -m pytest test -v -m "CI" + ``` + + 6. Refer to [cli.md](cli.md) for further usage instructions. + +
\ No newline at end of file