I'm trying to build a fortran project, that depends on other C/C++ and Fortran subprojects using meson and ninja. After installing everything necessary, gfortran
, build-essential
, meson
and ninja
, and trying to run:
meson setup build --reconfigure -Db_coverage=true -Dc_args=-Og,-w
I get an error like:
subprojects/**/meson.build:30:9: ERROR: Compiler cc cannot compile programs.
I have checked that compiler cc
exists, and is available with cc --version
. I don't understand why this error happens. I've simplified the meson error down to running
meson.get_compiler('c')
Which errors out with a
meson.build:14:6: ERROR: Tried to access compiler for language "c", not specified for host machine.
Why does this happen?
I'm trying to build a fortran project, that depends on other C/C++ and Fortran subprojects using meson and ninja. After installing everything necessary, gfortran
, build-essential
, meson
and ninja
, and trying to run:
meson setup build --reconfigure -Db_coverage=true -Dc_args=-Og,-w
I get an error like:
subprojects/**/meson.build:30:9: ERROR: Compiler cc cannot compile programs.
I have checked that compiler cc
exists, and is available with cc --version
. I don't understand why this error happens. I've simplified the meson error down to running
meson.get_compiler('c')
Which errors out with a
meson.build:14:6: ERROR: Tried to access compiler for language "c", not specified for host machine.
Why does this happen?
Share Improve this question asked Mar 11 at 10:17 tornikeotornikeo 9678 silver badges21 bronze badges1 Answer
Reset to default 1In my case the issue was a wrong build command for meson. I.e:
meson setup build --reconfigure -Db_coverage=true -Dc_args=-Og,-w
Is wrong, and should instead be:
meson setup build --reconfigure -Db_coverage=true -Dc_args='-Og -w'
Adding quotes (') fixes this. Without quotes, meson passes the -w
to a default C compiler incorrectly, which causes the compiler to return an exception. Meson then decides that the compiler doesn't work - and announces that the compiler for "c" is not specified for the host machine.
See more about this this meson discussion.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744801721a4594531.html
评论列表(0条)