Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meson error : can't find module #4605

Closed
boxerab opened this issue Dec 8, 2018 · 13 comments
Closed

Meson error : can't find module #4605

boxerab opened this issue Dec 8, 2018 · 13 comments

Comments

@boxerab
Copy link

boxerab commented Dec 8, 2018

When building https://gitlab.freedesktop.org/gstreamer/gst-docs ,
I get the following error:

meson.build:3:0: ERROR: Module "hotdoc" does not exist

I installed hotdoc via

python3 -m pip install hotdoc

However, when I run python3, I can import hotdoc module

@xclaesse
Copy link
Member

xclaesse commented Dec 8, 2018

Here the hotdoc module is a meson module, not the python module. You need Meson >= 0.48. I see gst-doc is missing a check on the minimal meson version.

@xclaesse xclaesse closed this as completed Dec 8, 2018
@xclaesse
Copy link
Member

xclaesse commented Dec 8, 2018

FYI, made a fix in gst-docs: https://gitlab.freedesktop.org/gstreamer/gst-docs/merge_requests/14

@boxerab
Copy link
Author

boxerab commented Dec 8, 2018

Thanks, Xavier :)

@z-s-e
Copy link

z-s-e commented Jul 31, 2019

I am getting basically this error using meson installed from the Ubuntu package repository (which is version 0.49.0, so it passes the version >= 0.48 check). Is meson not correctly packaged for Ubuntu, or what is the problem? Thanks
Verbatim error:

meson.build:5:0: ERROR: hotdoc 0.8.100 required but not found. (No module named 'hotdoc')

@FlyingBBQ
Copy link

I experience the same problem with meson installed from the Arch linux repository (version 0.51.1).
Unable to import the cmake module:
meson.build:73:2: ERROR: Unable to find CMake

@mensinda
Copy link
Member

mensinda commented Aug 9, 2019

@FlyingBBQ Do you have CMake installed? If yes, could you please post the entire error message. There are multiple instances where CMake is (optionally) required in meson.

@FlyingBBQ
Copy link

Yes, I do have CMake installed (version 3.15.1). I'm trying to build CppUTest as CMake subproject with the following in my meson.build

cmake = import('cmake')
cpputest_cmake = cmake.subproject('cpputest')

The error from meson-log.txt

Executing subproject cpputest method cmake 

CMake binary for MachineChoice.HOST is not cached
CMake binary missing from cross or native file, or env var undefined.
Found CMake: NO

meson.build:73:2: ERROR: Unable to find CMake

I tried adding CMake manually with CMake = find_program('cmake'). Meson does find cmake but the error remains

@mensinda
Copy link
Member

mensinda commented Aug 9, 2019

Are you cross compiling? I am also using Arch and I cannot reproduce this.

I am testing with this project (also meson 0.51.1): https://github.com/mensinda/mesonCMakeBuilder

CMake binary for MachineChoice.HOST is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Trying CMake binary cmake for machine MachineChoice.HOST at ['/usr/bin/cmake']
Found CMake: /usr/bin/cmake (3.15.1)

Configuring the build directory with CMake version 3.15.1

Is your source code public?

@FlyingBBQ
Copy link

I tried the project you linked which builds without problems.

In my project I'm cross compiling for ARM. I just pushed the commit where I try to build CppUTest with CMake. If you clone my repository and run . ./build.sh followed by ninja you should be able to reproduce this error.

You will need the arm-none-eabi toolchain to cross compile. In case you don't have Doxygen you can disable this from the meson_options.txt

@mensinda
Copy link
Member

mensinda commented Aug 9, 2019

I managed to reproduce the error with your project. I also managed to fix it by adding cmake = 'cmake' to your cross-file (in [binaries]). However, it still doesn't build because CMake doesn't like the compiler. It seems like the cross-compilation support for CMake subprojects is currently lacking.

Feel free to open a new issue specifically asking for better cross support. I will look into how hard it is to implement properly. Maybe I manage it until the next release.

@mensinda
Copy link
Member

mensinda commented Aug 9, 2019

But I would guess that you won't get around writing your own CMake cross files (in addition to meson cross files) if you want to use CMake subprojects. Generating them automatically from meson corss files would be a nightmare.

You could already test these if you manually pass -DCMAKE_TOOLCHAIN_FILE=whatever.cmake via the cmake_options key to the cmake.subproject function.

@FlyingBBQ
Copy link

First of all, thank you for the quick responses and support!

However, my goal is not to compile the CMake subproject with the cross-compiler. CppUTest is a test framework which I would like to run from the build machine, so it should use the native compiler.
I was about to switch to GoogleTest since it is included in the WrapDB. This allows me to make a test executable and link it to the gtest dependency, obtained from the subproject. I was trying to achieve the same thing with CppUTest.

Is this possible with a CMake subproject? or would it make more sense to add CppUTest to the WrapDB?

@mensinda
Copy link
Member

mensinda commented Aug 9, 2019

I don't think that it is generally supported to build an entire subproject for the build machine (even the normal subprojects function lacks the native flag). So I am not sure if this would work with the GoogleTest WrapDB subproject because it should build the libraries for the host machine, not the build machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants