Meson: Beginners question

Created on 6 Feb 2019  路  9Comments  路  Source: mesonbuild/meson

Sorry to post with a question rather than an issue here (I think..).

After installing meson with
pip3 install meson

And trying to use it to compile (in my case mpd 0.21):
meson . output/release --buildtype=debugoptimized -Db_ndebug=true

I get:
-bash: /usr/bin/meson: No such file or directory

As you probably guessed I'm not really an expert.. How do I fix this?

supporRFC

Most helpful comment

Hi, maybe pip3 put the executable under /usr/local/bin or something different from /usr/bin; put that directory in your PATH and try again. Next time is better if you describe your OS/environment.

example:
PATH="/usr/local/bin:$PATH"

All 9 comments

Hi, maybe pip3 put the executable under /usr/local/bin or something different from /usr/bin; put that directory in your PATH and try again. Next time is better if you describe your OS/environment.

example:
PATH="/usr/local/bin:$PATH"

Hi there,

thanks for your help! I should have mentioned it of course.. but I'm on Ubuntu 18.04.

Another question: Where do I change the path for Pip3? (sorry.. I'm very new to this..)

pip3 path seems right, you probably install it via apt and is in /urs/bin/ so you are able to use it. The problem is that it puts python packages (probably) in /usr/local; so is meson out of PATH. Just use the line above from bash and try to execute meson. At the moment I don't suggest to you to change how pip3 works to avoid to create a mess with system packages and so on. Just try as I said for the moment. Then I strongly suggest to understand how pip3/python/apt works on your distribution to avoid to go crazy with packages installed in various path. I suggest also to have a look to python3 venv.

If you are just a meson user, that mean that you probably use meson as build system so you are less interested in python, you can consider to install it via apt instead of via pip3 so I will fit better in your distribution.

Just my 2c I'm not an ubuntu user!

since you're running a relatively new version of Ubuntu the version for apt is probably sufficient for you. If your sure you want to use pip, you'll need to edit your .bashrc file.

If you used sudo pip do something like:

echo "export PATH=/usr/local/bin:$PATH" >> ~/.bashrc

if you didn't use sudo, ie, pip3 install --user, then you probably need to add either ~/.bin or ~/.local/bin to your bashrc the same way.

Well indeed.. I started with installing via APT, but to compile MPD I was in need for a newer version than APT provided.

Indeed, it turns out that pip3 installed to /usr/local/bin instead of /usr/bin/, which is the Ubuntu standard. With that in mind I could just execute the build command like this:
/usr/local/bin/meson . output/release --buildtype=debugoptimized -Db_ndebug=true
instead of
meson . output/release --buildtype=debugoptimized -Db_ndebug=true

.. so for this particular issue there was no need to add/change the path of Bash.

Thanks so much for your help guys!!

Warner

Just FYI, it's common on Linux systems for /usr/* to be reserved for the package manager (apt, dnf, zippyr, pacman, etc) and packages installed by other means (pip, make install, etc) to go in /usr/local/* so that you don't fight with the package manager.

I'm going to go ahead and close this since it seems resolved.

This is still an issue. The pip3 install meson; installs everything but the executable (which is instead installed into /usr/local/bin). It would save any newer people a lot of time if this information was either provided with the installation instructions on the website or create a symlink shim in /usr/bin. the path for /usr/local/bin is not included in most default distro paths.

In my opinion this is not an issue. It is the common behaviour of all python program installed with pip3 on most unixes. I think a programmer should know how his O.S/distribution and tools, so know what happens using pip, or the packages manager; know about executables path and so on. I never found so much specific install instruction for developer tools. Anyway if you think it's really important enough and a valuable resource for others, you can try to make a PR with the instructions you believe are useful.

@scontini76 it is common practice for items to be installed in many possible different locations. The standard behavior I would expect is either in the default path or a symlink pointing to its actual location with the symlink in a default path (/bin or /usr/bin).

There are at least two standard user flows for interacting with any build system, mesonbuild notwithstanding. The first would be the project developer (programmer) that builds the Cmake/autotool/meson.build file option/config files; and then standard users (almost nil programming experience) who are performing the second stage in building software with various configured features.

The vast majority of people in the user pool will likely fall into the latter due to the lower technical expertise hurdle. I've updated the Quickstart guide with the appropriate information and submitted a pull request.

PR#5868 - Update Quickstart Guide

Was this page helpful?
0 / 5 - 0 ratings