Discussion:
[gem5-users] Gem5 build error
Thawra Kadeed
2018-07-31 16:08:48 UTC
Permalink
Hello Jason,

I submitted before this error message I got during the build process of
Gem5.

you recommended me either to use previous versions of gcc (e.g. gcc 7)
or to use clang.

As I am using Feodra28, I am not able to install gcc 7 because there are
no corresponding dependencies in fedora28 for such a version.
However, I removed gcc8 and installed clang. Here, gcc8 installs
automatically as a dependency package for clang. I tried to build, I got
the same error.

I do not know which c compiler the scons uses. I tried to look if I am
able to specify the c compiler in the scons but have not seen such a
choice.

Could anyone please give me a hint about this problem.
Thanks in advance,
Thawra

PS: your old answer was:
Hi Thawra,

My guess is that this is an issue with the version of pybind11 we're
using
and gcc 8+. We haven't tested on anything after gcc 7.X.

I'll put testing gcc 8 on my to do list, but I don't know when I'll get
to
it. I would try downgrading gcc to 7 or possibly using clang.

jason
Hello,
I am Thawra Kadeed from the university of Braunschweig in Germany.
I started using Gem5 and during the build process I got the foolowing
ext/pybind11/include/pybind11/pybind11.h: In member function 'void
pybind11::cpp_function::initialize_generic(pybind11::detail::function_record*,
ext/pybind11/include/pybind11/pybind11.h:320:74: error: cast between
incompatible function types from 'PyObject* (*)(PyObject*, PyObject*,
PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to
'PyCFunction' {aka '_object* (*)(_object*, _object*)'}
[-Werror=cast-function-type]
rec->def->ml_meth =
reinterpret_cast<PyCFunction>(*dispatcher);
Obviously as the error reports that the problem is cast between
incompatible function types from 'PyObject' to 'PyCFunction'
I installed all the required dependencies and as I am using fedora28 I
Python 2.7.14 and gcc-8.0.1-0.20.fc28.x86_64
I hope you have a helpful guide in this issue.
Thanks in advance.
Best regards,
Thawra
Jason Lowe-Power
2018-07-31 16:27:43 UTC
Permalink
Hi Thawra,

It looks like this pybind11 commit fixes the issue.
https://github.com/pybind/pybind11/pull/1396. Last time you sent the email
no one had posted a fix to pybind, yet :).

I just posted a patch on gerrit. Please download it, test it, and review it
on gerrit. If it works for you we'll push it into mainline.
https://gem5-review.googlesource.com/c/public/gem5/+/11909

Cheers,
Jason
Post by Thawra Kadeed
Hello Jason,
I submitted before this error message I got during the build process of
Gem5.
you recommended me either to use previous versions of gcc (e.g. gcc 7)
or to use clang.
As I am using Feodra28, I am not able to install gcc 7 because there are
no corresponding dependencies in fedora28 for such a version.
However, I removed gcc8 and installed clang. Here, gcc8 installs
automatically as a dependency package for clang. I tried to build, I got
the same error.
I do not know which c compiler the scons uses. I tried to look if I am
able to specify the c compiler in the scons but have not seen such a
choice.
Could anyone please give me a hint about this problem.
Thanks in advance,
Thawra
Hi Thawra,
My guess is that this is an issue with the version of pybind11 we're
using
and gcc 8+. We haven't tested on anything after gcc 7.X.
I'll put testing gcc 8 on my to do list, but I don't know when I'll get
to
it. I would try downgrading gcc to 7 or possibly using clang.
jason
Hello,
I am Thawra Kadeed from the university of Braunschweig in Germany.
I started using Gem5 and during the build process I got the foolowing
ext/pybind11/include/pybind11/pybind11.h: In member function 'void
pybind11::cpp_function::initialize_generic(pybind11::detail::function_record*,
ext/pybind11/include/pybind11/pybind11.h:320:74: error: cast between
incompatible function types from 'PyObject* (*)(PyObject*, PyObject*,
PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to
'PyCFunction' {aka '_object* (*)(_object*, _object*)'}
[-Werror=cast-function-type]
rec->def->ml_meth =
reinterpret_cast<PyCFunction>(*dispatcher);
Obviously as the error reports that the problem is cast between
incompatible function types from 'PyObject' to 'PyCFunction'
I installed all the required dependencies and as I am using fedora28 I
Python 2.7.14 and gcc-8.0.1-0.20.fc28.x86_64
I hope you have a helpful guide in this issue.
Thanks in advance.
Best regards,
Thawra
Thawra Kadeed
2018-07-31 17:17:33 UTC
Permalink
Hi Jason,

thanks for your quick answer.

I downloaded the pybind11 from
https://github.com/pybind/pybind11/pull/1396
,removed the old one and used this one, then complied but I got another
error after the past error passed:

New result:

scons: Building targets ...
[ CXX] ARM/sim/main.cc -> .o
[ CXX] ARM/mem/ruby/filters/BlockBloomFilter.cc -> .o
In file included from build/ARM/sim/serialize.hh:61,
from build/ARM/sim/eventq.hh:53,
from build/ARM/sim/core.hh:44,
from build/ARM/mem/request.hh:62,
from build/ARM/mem/packet.hh:66,
from build/ARM/mem/ruby/system/RubySystem.hh:40,
from build/ARM/mem/ruby/filters/BlockBloomFilter.cc:33:

build/ARM/base/bitunion.hh: In function 'std::ostream&
BitfieldBackend::bitfieldBackendPrinter(std::ostream&, const T&) [with T
= char; std::ostream = std::basic_ostream<char>]':
build/ARM/base/bitunion.hh:438:26: ERROR: type qualifiers ignored on
cast result type [-Werror=ignored-qualifiers]
os << (const int)t;
^
build/ARM/base/bitunion.hh: In function 'std::ostream&
BitfieldBackend::bitfieldBackendPrinter(std::ostream&, const T&) [with T
= unsigned char; std::ostream = std::basic_ostream<char>]':
build/ARM/base/bitunion.hh:446:35: ERROR: type qualifiers ignored on
cast result type [-Werror=ignored-qualifiers]
os << (const unsigned int)t;


Is it also because of gcc8?
Thanks again,
Thawra
Post by Thawra Kadeed
Hi Thawra,
It looks like this pybind11 commit fixes the issue.
https://github.com/pybind/pybind11/pull/1396. Last time you sent the
email no one had posted a fix to pybind, yet :).
I just posted a patch on gerrit. Please download it, test it, and
review it on gerrit. If it works for you we'll push it into mainline.
https://gem5-review.googlesource.com/c/public/gem5/+/11909
Cheers,
Jason
On Tue, Jul 31, 2018 at 9:08 AM Thawra Kadeed
Post by Thawra Kadeed
Hello Jason,
I submitted before this error message I got during the build process of
Gem5.
you recommended me either to use previous versions of gcc (e.g. gcc 7)
or to use clang.
As I am using Feodra28, I am not able to install gcc 7 because there are
no corresponding dependencies in fedora28 for such a version.
However, I removed gcc8 and installed clang. Here, gcc8 installs
automatically as a dependency package for clang. I tried to build, I got
the same error.
I do not know which c compiler the scons uses. I tried to look if I am
able to specify the c compiler in the scons but have not seen such a
choice.
Could anyone please give me a hint about this problem.
Thanks in advance,
Thawra
Hi Thawra,
My guess is that this is an issue with the version of pybind11 we're
using
and gcc 8+. We haven't tested on anything after gcc 7.X.
I'll put testing gcc 8 on my to do list, but I don't know when I'll get
to
it. I would try downgrading gcc to 7 or possibly using clang.
jason
Hello,
I am Thawra Kadeed from the university of Braunschweig in Germany.
I started using Gem5 and during the build process I got the
foolowing
ext/pybind11/include/pybind11/pybind11.h: In member function 'void
pybind11::cpp_function::initialize_generic(pybind11::detail::function_record*,
Post by Thawra Kadeed
ext/pybind11/include/pybind11/pybind11.h:320:74: error: cast
between
incompatible function types from 'PyObject* (*)(PyObject*,
PyObject*,
PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to
'PyCFunction' {aka '_object* (*)(_object*, _object*)'}
[-Werror=cast-function-type]
rec->def->ml_meth =
reinterpret_cast<PyCFunction>(*dispatcher);
Obviously as the error reports that the problem is cast between
incompatible function types from 'PyObject' to 'PyCFunction'
I installed all the required dependencies and as I am using
fedora28 I
Python 2.7.14 and gcc-8.0.1-0.20.fc28.x86_64
I hope you have a helpful guide in this issue.
Thanks in advance.
Best regards,
Thawra
Jason Lowe-Power
2018-08-03 16:35:10 UTC
Permalink
Hi Thawra,

Here's another patch:
https://gem5-review.googlesource.com/c/public/gem5/+/11949. I would greatly
appreciate it if you created an account on gem5-review.googlesource.com and
made comments/reviewed the patches there. If you have any questions on how
to do that, please let me know off list.

Thanks,
Jason
Post by Thawra Kadeed
Hi Jason,
thanks for your quick answer.
I downloaded the pybind11 from
https://github.com/pybind/pybind11/pull/1396
,removed the old one and used this one, then complied but I got another
scons: Building targets ...
[ CXX] ARM/sim/main.cc -> .o
[ CXX] ARM/mem/ruby/filters/BlockBloomFilter.cc -> .o
In file included from build/ARM/sim/serialize.hh:61,
from build/ARM/sim/eventq.hh:53,
from build/ARM/sim/core.hh:44,
from build/ARM/mem/request.hh:62,
from build/ARM/mem/packet.hh:66,
from build/ARM/mem/ruby/system/RubySystem.hh:40,
build/ARM/base/bitunion.hh: In function 'std::ostream&
BitfieldBackend::bitfieldBackendPrinter(std::ostream&, const T&) [with T
build/ARM/base/bitunion.hh:438:26: ERROR: type qualifiers ignored on
cast result type [-Werror=ignored-qualifiers]
os << (const int)t;
^
build/ARM/base/bitunion.hh: In function 'std::ostream&
BitfieldBackend::bitfieldBackendPrinter(std::ostream&, const T&) [with T
build/ARM/base/bitunion.hh:446:35: ERROR: type qualifiers ignored on
cast result type [-Werror=ignored-qualifiers]
os << (const unsigned int)t;
Is it also because of gcc8?
Thanks again,
Thawra
Post by Thawra Kadeed
Hi Thawra,
It looks like this pybind11 commit fixes the issue.
https://github.com/pybind/pybind11/pull/1396. Last time you sent the
email no one had posted a fix to pybind, yet :).
I just posted a patch on gerrit. Please download it, test it, and
review it on gerrit. If it works for you we'll push it into mainline.
https://gem5-review.googlesource.com/c/public/gem5/+/11909
Cheers,
Jason
On Tue, Jul 31, 2018 at 9:08 AM Thawra Kadeed
Post by Thawra Kadeed
Hello Jason,
I submitted before this error message I got during the build process of
Gem5.
you recommended me either to use previous versions of gcc (e.g. gcc 7)
or to use clang.
As I am using Feodra28, I am not able to install gcc 7 because there are
no corresponding dependencies in fedora28 for such a version.
However, I removed gcc8 and installed clang. Here, gcc8 installs
automatically as a dependency package for clang. I tried to build, I got
the same error.
I do not know which c compiler the scons uses. I tried to look if I am
able to specify the c compiler in the scons but have not seen such a
choice.
Could anyone please give me a hint about this problem.
Thanks in advance,
Thawra
Hi Thawra,
My guess is that this is an issue with the version of pybind11 we're
using
and gcc 8+. We haven't tested on anything after gcc 7.X.
I'll put testing gcc 8 on my to do list, but I don't know when I'll get
to
it. I would try downgrading gcc to 7 or possibly using clang.
jason
Hello,
I am Thawra Kadeed from the university of Braunschweig in Germany.
I started using Gem5 and during the build process I got the
foolowing
ext/pybind11/include/pybind11/pybind11.h: In member function 'void
pybind11::cpp_function::initialize_generic(pybind11::detail::function_record*,
Post by Thawra Kadeed
Post by Thawra Kadeed
ext/pybind11/include/pybind11/pybind11.h:320:74: error: cast
between
incompatible function types from 'PyObject* (*)(PyObject*,
PyObject*,
PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to
'PyCFunction' {aka '_object* (*)(_object*, _object*)'}
[-Werror=cast-function-type]
rec->def->ml_meth =
reinterpret_cast<PyCFunction>(*dispatcher);
Obviously as the error reports that the problem is cast between
incompatible function types from 'PyObject' to 'PyCFunction'
I installed all the required dependencies and as I am using
fedora28 I
Python 2.7.14 and gcc-8.0.1-0.20.fc28.x86_64
I hope you have a helpful guide in this issue.
Thanks in advance.
Best regards,
Thawra
Loading...