Getting Meson (2024)

Meson is implemented in Python 3, and requires 3.7 or newer. If youroperating system provides a package manager, you should install itwith that. For platforms that don't have a package manager, you needto download it from Python's home page. See below forplatform-specific Python3 quirks.

Downloading Meson

Meson releases can be downloaded from the GitHub release page, andyou can run ./meson.py from inside a release or the git repositoryitself without doing anything special.

On Windows, if you did not install Python with the installer optionsthat make Python scripts executable, you will have to run python /path/to/meson.py, where python is Python 3.7 or newer.

The newest development code can be obtained directly from Git, andwe strive to ensure that it will always be working and usable. Allcommits go through a pull-request process that runs CI and testsseveral platforms.

Packing Meson into a zipapp

After downloading the release, you can create a standalone single-fileexecutable for Meson by running the script:

./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' <source checkout>

This uses python's native support for zipapp.

Installing Meson with pip

Meson is available in the Python Package Index and can be installedwith pip3 install --user meson. This does not require any specialprivileges. This will install the package in ~/.local/, so you willhave to add ~/.local/bin to your PATH. If you are using Meson onlyfor local development this should be all you need.

If you need to install your project in system directories, thisapproach will not work as executable installed in this way are notavailable when sudo is used. You can install Meson so it can be usedby every user with sudo pip3 install meson. It is generally notrecommended to do this, but instead use the version provided by distropackages.

If you must install Meson with sudo pip3 make sure to uninstall anydistro version first. Having multiple versions of any program insystem directories can lead to problems.

Installing Meson and Ninja with the MSI installer

We provide an MSI installer on the GitHub release page that can beused to install both Meson and Ninja at once for Windows. It alsocontains an embedded copy of Python, so scripts that use the Pythonmodule and do not have any external dependencieswill continue to work as expected.

Please note that this is a new feature, so bug reports are expectedand welcome!

Dependencies

In the most common case, you will need the Ninja executable forusing the ninja backend, which is the default in Meson. This backendcan be used on all platforms and with all toolchains, including GCC,Clang, Visual Studio, MinGW, ICC, ARMCC, etc.

You can use the version provided by your package manager if possible,otherwise download the binary executable from the Ninja project'srelease page.

If you will only use the Visual Studio backend (--backend=vs) togenerate Visual Studio solutions on Windows or the XCode backend(--backend=xcode) to generate XCode projects on macOS, you do notneed Ninja.

Windows Python3 quirks

When installing Python 3, it is highly recommended (but not required)that you select the installer options as follows:

Getting Meson (1)Getting Meson (2)Getting Meson (3)

With this, you will have python and pip in PATH, and you caninstall Meson with pip. You will also be able to directly run mesonin any shell on Windows instead of having to run py -3 with the fullpath to the meson.py script.

MSYS2 Python3 quirks

If you are using MSYS2 on Windows as your development environment,please make sure that you do not use the msys/python package toprovide Python 3. Use either mingw32/mingw-w64-i686-python3 ormingw64/mingw-w64-x86_64-python3 depending on which MinGW target youare building for.

The results of the search are

Website licensing information are available on the Legal page.

Getting Meson (2024)

FAQs

What is the use of Meson? ›

The Meson program is used to configure the source directory and generates either a Ninja build file or Visual Studio® build files.

How do I call Meson? ›

There are two different ways of invoking Meson. First, you can run it directly from the source tree with the command /path/to/source/meson.py . Second, Meson may also be installed in which case the command is simply meson .

What is a Meson build? ›

Meson is a build system that is designed to be as user-friendly as possible without sacrificing performance. The main tool for this is a custom language that the user uses to describe the structure of his build. The main design goals of this language has been simplicity, clarity and conciseness.

What's an example of a meson? ›

Examples of mesons are the p, h, r and w mesons. Mesons do not last long because they have no net baryon or net lepton number and can decay. For instance a p0 meson can decay into two photons. An object made of a red, a green and a blue quark is also colorless.

What does the name meson mean? ›

meson in British English

(ˈmiːzɒn ) noun. any of a group of elementary particles, such as a pion or kaon, that usually has a rest mass between those of an electron and a proton, and an integral spin. They are responsible for the force between nucleons in the atomic nucleus. Former name: mesotron.

Where is meson installed? ›

Meson is available in the Python Package Index and can be installed with pip3 install --user meson . This does not require any special privileges. This will install the package in ~/. local/ , so you will have to add ~/.

What is meson in Python? ›

meson-python is a Python build backend built on top of the Meson build system. It enables using Meson for the configuration and build steps of Python packages. Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.

How to compile using meson? ›

To compile any given configuration, just go into the corresponding build directory and run meson compile . Meson will automatically add compiler flags to enable debug information and compiler warnings (i.e. -g and -Wall ). This means the user does not have to deal with them and can instead focus on coding.

What are the three types of meson? ›

Mesons are the interaction agents between nucleons (protons and electrons). The rest mass of the mesons lies between 250-100mₑ . The most common type of mesons are the pions (pi mesons), kaons (K mesons) and the eta meson (η-meson).

Why is there no meson number? ›

Mesons are made up of a quark and an anti-quark. Mesons have L = 0 and B = 0, and they have no net leptons or baryons in their ultimate decay products. The number of mesons is not conserved, so there is no "meson number." After the discovery of pions other particles were discovered in rapid pace.

Who coined the term meson? ›

Complete Step by Step Answer: Hideki Yukawa coined the term 'mesons'. A scientist called David Anderson discovered a particle Meson which has mass between electron and proton and the name of the particle was then changed to Mesotron by taking advice from Millikan.

What is the life of meson? ›

Measurements of the lifetime of mesons which have traversed varying distances in air have been made and show that the value of τμc2 is constant. The existence of a spectrum of life-times is therefore excluded. The most probable value of τμc2 from our measurements is 2.6±0.3 × 10−14 sec./ev.

What is the charge of a meson? ›

According to current quark theory mesons consist of quark–antiquark pairs. They exist with positive, negative, and zero charges, but when charged the charge has the same magnitude as that of the electron. They include the kaon, pion, and psi particles.

Why is meson unstable? ›

Because a meson consists of a particle and an antiparticle, it is very unstable.

What is the role of mesons in nuclear forces? ›

According to the meson theory, protons and neutrons continuously emit and reabsorb pions. The transfer of these pions is responsible for a force of attraction in the same way as the exchange of electrons is responsible for bonds between adjacent atoms.

What is the role of the mesons in the nucleus? ›

Explanation: Mesons are what are called exchange particles. Nuclear force is experienced by exchange of mesons inside the nucleus. This was first hypothesized by Yukawa to explain the short range of nuclear forces.

What is the role of mesons in nuclear stability? ›

π - mesons are regarded as the nuclear glue to hold up neutrons and protons in nucleus. Assertion :Mesons have mass more than electron whereas hyperons have mass more than protons. Reason: Mesons (short lived) on decomposition gives mesons, electrons, positrons, neutrinos, antineutrinos and γ-rays.

What is the difference between a quark and a meson? ›

Mesons are intermediate mass particles which are made up of a quark-antiquark pair. Three quark combinations are called baryons. Mesons are bosons, while the baryons are fermions. There was a recent claim of observation of particles with five quarks (pentaquark), but further experimentation has not borne it out.

Top Articles
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 5779

Rating: 4.9 / 5 (49 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.