Skip to content

Commit

Permalink
Deploying to gh-pages from @ f36edd7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
facebook-github-bot committed Jul 3, 2024
1 parent b60c722 commit a9c830a
Show file tree
Hide file tree
Showing 34 changed files with 180 additions and 138 deletions.
8 changes: 4 additions & 4 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<meta name="generator" content="Docusaurus v2.1.0">
<title data-rh="true">Page Not Found | Mariana Trench</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://mariana-tren.ch/404.html"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Page Not Found | Mariana Trench"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://mariana-tren.ch/404.html"><link data-rh="true" rel="alternate" href="https://mariana-tren.ch/404.html" hreflang="en"><link data-rh="true" rel="alternate" href="https://mariana-tren.ch/404.html" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Mariana Trench RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Mariana Trench Atom Feed"><link rel="stylesheet" href="/assets/css/styles.e56ff910.css">
<link rel="preload" href="/assets/js/runtime~main.d88c7a83.js" as="script">
<link rel="preload" href="/assets/js/main.32537cd0.js" as="script">
<link rel="preload" href="/assets/js/runtime~main.cab7fccc.js" as="script">
<link rel="preload" href="/assets/js/main.5f3b3b95.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script>
<div style="display: none; text-align: center; background-color: white; color: black;" id="internaldocs-banner"></div><div id="__docusaurus">
<div role="region" aria-label="theme.common.skipToMainContent"><a href="#" class="skipToContent_fXgn">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle clean-btn" type="button" tabindex="0"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><b class="navbar__title text--truncate">Mariana Trench</b></a><a class="navbar__item navbar__link" href="/docs/overview/">Documentation</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/facebook/mariana-trench" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div class="main-wrapper mainWrapper_z2l0"><main class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">Page Not Found</h1><p>We could not find what you were looking for.</p><p>Please contact the owner of the site that linked you to the original URL and let them know their link is broken.</p></div></div></main></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Learn</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started/">Getting Started</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://twitter.com/metaOpenSource" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/facebook/mariana-trench" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">Legal</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://opensource.facebook.com/legal/privacy/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Privacy<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://opensource.facebook.com/legal/terms/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Terms<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="margin-bottom--sm"><a href="https://opensource.facebook.com" rel="noopener noreferrer" class="footerLogoLink_BH7S"><img src="/img/oss_logo.png" alt="Facebook Open Source Logo" class="themedImage_ToTc themedImage--light_HNdA footer__logo"><img src="/img/oss_logo.png" alt="Facebook Open Source Logo" class="themedImage_ToTc themedImage--dark_i4oU footer__logo"></a></div><div class="footer__copyright">Copyright © 2024 Meta Platforms, Inc. Built with Docusaurus.</div></div></div></footer></div>
<script src="/assets/js/runtime~main.d88c7a83.js"></script>
<script src="/assets/js/main.32537cd0.js"></script>
<script src="/assets/js/runtime~main.cab7fccc.js"></script>
<script src="/assets/js/main.5f3b3b95.js"></script>
</body>
</html>
88 changes: 62 additions & 26 deletions _src/contribution.md → _src/build_from_source.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
id: contribution
title: Contribution
sidebar_label: Contribution
id: build-from-source
title: Build from Source
sidebar_label: Build from Source
---

This documentation aims to help you become an active contributor to Mariana Trench.
This documentation aims to help you build Mariana Trench from source and run the tests.

## Building From Source

### Support
## Supported Platforms

Mariana Trench is currently supported on **macOS** (tested on *Big Sur 11.4*) and **Linux** (tested on *Ubuntu 20.04 LTS*).

### Dependencies
## Dependencies

Below is a list of the required dependencies. Most of them can be installed with **[Homebrew](https://brew.sh/)**.

Expand All @@ -29,6 +27,8 @@ Below is a list of the required dependencies. Most of them can be installed with
* Android SDK (Optional)
* Redex (master)

## Building and Installing

### Install all dependencies with Homebrew

First, follow the instructions to install **[Homebrew](https://brew.sh/)** on your system.
Expand Down Expand Up @@ -58,40 +58,48 @@ On **Linux**, you will need to install Java to run the tests. For instance, on *
$ sudo apt install default-jre default-jdk
```

### Clone the repository

First of, clone the Mariana Trench repository. We will also set an environment variable `MARIANA_TRENCH_DIRECTORY` that points to it for the following instructions.
```shell
$ git clone https://github.com/facebook/mariana-trench.git
$ cd mariana-trench
$ MARIANA_TRENCH_DIRECTORY="$PWD"
```

### Installation directory

We do not recommend installing Mariana Trench as root. Instead, you should pick a directory where all libraries and binaries will be installed, and set the variable `MT_INSTALL_DIRECTORY` to its absolute path. For instance, assuming you are in the root directory of the repository:
We do not recommend installing Mariana Trench as root. Instead, we will install all libraries and binaries in a directory "install".
We will also use a directory called "dependencies" to store dependencies that we have to build from source.
Run the following commands:
```shell
$ mkdir install
$ MT_INSTALL_DIRECTORY="$PWD/install"
$ mkdir dependencies
```

### Building fmt

The 9.0 release of `fmt` has breaking changes that Mariana Trench is not yet compatible with, so for now, you need to build the library from source. You will need to do the following:

```shell
$ cd "$MARIANA_TRENCH_DIRECTORY/dependencies"
$ git clone -b 8.1.1 https://github.com/fmtlib/fmt.git
$ mkdir fmt/build
$ cd fmt/build
$ cmake -DCMAKE_INSTALL_PREFIX="$MT_INSTALL_DIRECTORY" ..
$ cmake -DCMAKE_INSTALL_PREFIX="$MARIANA_TRENCH_DIRECTORY/install" ..
$ make -j4
$ make install
```

### Building Redex

You will need to choose a temporary directory to store the C++ binaries and libraries for Redex and Mariana Trench. You can safely remove these after installation if you do not intend to update the C++ code. Pick a directory and set the variable `MT_INSTALL_DIRECTORY` to its absolute path, for instance:
```shell
$ MT_INSTALL_DIRECTORY="$PWD/install"
```

To build [Redex](https://fbredex.com/) from source, run:
We also need to build [Redex](https://fbredex.com/) from source, run:
```shell
$ cd "$MARIANA_TRENCH_DIRECTORY/dependencies"
$ git clone https://github.com/facebook/redex.git
$ mkdir redex/build
$ cd redex/build
$ cmake -DCMAKE_INSTALL_PREFIX="$MT_INSTALL_DIRECTORY" ..
$ cmake -DCMAKE_INSTALL_PREFIX="$MARIANA_TRENCH_DIRECTORY/install" ..
$ make -j4
$ make install
```
Expand All @@ -100,29 +108,30 @@ $ make install

Now that we have our dependencies ready, let's build the Mariana Trench binary:
```shell
$ cd ../.. # Go back to the root directory of Mariana Trench
$ cd "$MARIANA_TRENCH_DIRECTORY"
$ mkdir build
$ cd build
$ cmake \
-DREDEX_ROOT="$MT_INSTALL_DIRECTORY" \
-Dfmt_ROOT="$MT_INSTALL_DIRECTORY" \
-DCMAKE_INSTALL_PREFIX="$MT_INSTALL_DIRECTORY" \
-DREDEX_ROOT="$MARIANA_TRENCH_DIRECTORY/install" \
-Dfmt_ROOT="$MARIANA_TRENCH_DIRECTORY/install" \
-DCMAKE_INSTALL_PREFIX="$MARIANA_TRENCH_DIRECTORY/install" \
..
$ make -j4
$ make install
```

Finally, let's install Mariana Trench as a Python package.
We recommend to run this step inside a [virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments).
First, follow the instructions to create a [virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments).
Once inside a virtual environment (after using the `activate` script), run:
```shell
$ cd .. # Go back to the root directory
$ cd "$MARIANA_TRENCH_DIRECTORY"
$ python scripts/setup.py \
--binary "$MT_INSTALL_DIRECTORY/bin/mariana-trench-binary" \
--pyredex "$MT_INSTALL_DIRECTORY/bin/pyredex" \
install
```

## Development
## Testing during development

If you are making changes to Mariana Trench, you can use the `mariana-trench` wrapper inside the build directory:
```shell
Expand All @@ -139,10 +148,37 @@ Note that you will need to install all python dependencies:
$ pip install pyre_extensions fb-sapp
```

## Run the tests
## Running the tests

To run the tests after building Mariana Trench, use:
```shell
$ cd build
$ make check
```

## Troubleshooting

Here are a set of errors you might encounter, and their solutions.

### CMake Warning: Ignoring extra path from command line: ".."

You probably tried to run `cmake` from the wrong directory.
Make sure that `$MARIANA_TRENCH_DIRECTORY` is set correctly (test with `echo $MARIANA_TRENCH_DIRECTORY`).
Then, run the instructions again from the beginning of the section you are in.

### error: externally-managed-environment

You probably tried to run `python scripts/setup.py` without a virtual environment. Create a [virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) first.

### undefined reference to `pthread_create@GLIBC`

This seems to happen on Linux, when your operating system has an old version of glibc, which doesn't match the version used by Homebrew.
Try upgrading your operating system to the last version.

Another option is to use the compiler (gcc) from Homebrew directly:
```
$ brew install gcc
export CC=/home/linuxbrew/.linuxbrew/bin/cc
export CXX=/home/linuxbrew/.linuxbrew/bin/c++
```
You will need to run all the instructions from this page again, starting from `Clone the repository`. We recommend starting from scratch, i.e delete the mariana-trench directory.
Loading

0 comments on commit a9c830a

Please sign in to comment.