projectcalico / bird

Calico's fork of the BIRD protocol stack
90 stars 86 forks source link

fatal error: timer.h: No such file or directory #78

Closed fancc closed 4 years ago

fancc commented 4 years ago

I want to cross compile the arm64 version under amd64 environment, but when I use ARCH = arm64 ./build.sh to execute the compilation, it will report this error: “fatal error: timer.h: No such file or directory”

Has anyone encountered this situation?

My server environment is Ubuntu 18.04.2.

../lib/birdlib.h:12:10: fatal error: timer.h: No such file or directory
 #include "timer.h"
          ^~~~~~~~~
compilation terminated.
In file included from /code/nest/bird.h:13,
                 from checksum.c:15:
../lib/birdlib.h:12:10: fatal error: timer.h: No such file or directory
 #include "timer.h"
          ^~~~~~~~~
compilation terminated.
In file included from /code/nest/bird.h:13,
                 from event.c:22:
../lib/birdlib.h:12:10: fatal error: timer.h: No such file or directory
 #include "timer.h"
          ^~~~~~~~~
compilation terminated.
In file included from /code/nest/bird.h:13,
                 from ip.c:20:
../lib/birdlib.h:12:10: fatal error: timer.h: No such file or directory
 #include "timer.h"
          ^~~~~~~~~
compilation terminated.
In file included from /code/nest/bird.h:13,
                 from lists.c:29:
../lib/birdlib.h:12:10: fatal error: timer.h: No such file or directory
 #include "timer.h"
          ^~~~~~~~~

I found the timer.h file in the /sysdep/unix/ path, but why is this error reported?

rafaelvanoni commented 4 years ago

@fancc I'd suggest pinging the folks who added the arm64 support in the calico-users slack. I don't really know who they are but you could find them by looking at the git history on that repository.

tmjd commented 4 years ago

@deitch I believe you did some of the arm64 work originally, do you have any suggestions here?

deitch commented 4 years ago

If nothing has changed, then I suspect that the dockerfile build is not consistent. We did it basically:

FROM gcc:latest
MAINTAINER Tom Denham <tom@projectcalico.org>

RUN dpkg --add-architecture arm64
RUN dpkg --add-architecture ppc64el
RUN dpkg --add-architecture s390x
RUN apt update
RUN apt install -y autoconf flex bison \
    libncurses-dev libreadline-dev \
    binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu libncurses-dev:arm64 libreadline-dev:arm64 \
    binutils-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu libncurses-dev:ppc64el libreadline-dev:ppc64el \
    binutils-s390x-linux-gnu gcc-s390x-linux-gnu libncurses-dev:s390x libreadline-dev:s390x

the image gcc:latest (and the packages included) easily could have changed over the time since. We should have locked it down to a single tag, at the very least. If we could pull logs off of the last successful build, we might be able to get a good image tag from there.

deitch commented 4 years ago

I just did a clean build on Ubuntu 16.04, no problem. This should not matter, since the entire build is in docker. But it is possible. Try both and see?

fancc commented 4 years ago

@rafaelvanoni @tmjd @deitch Sorry, this is not a bug but my fault. I modified some files, but some of them were wrong. We have several non-amd64 architecture servers, including arm64 and mips64el. I need to be able to cross compile executable files of arm64 and mips64el architecture, but I noticed that you do not support mips64el architecture, so I made some changes to enable it support cross compilation mips64el architecture.

deitch commented 4 years ago

No problem. I’m glad I didn’t have the chance to spend more time on it. 😃

fancc commented 4 years ago

@rafaelvanoni @tmjd @deitch I submitted a pr to support cross compilation of mips64el architecture. I think there should be some developers like me who need to cross compile mips64el architectures . Can you review it?

rafaelvanoni commented 4 years ago

PR -> https://github.com/projectcalico/bird/pull/79