scottransom / presto

Open source pulsar search and analysis toolkit
http://www.cv.nrao.edu/~sransom/presto/
GNU General Public License v2.0
239 stars 177 forks source link

docker build fails on arm64 system #160

Open 0xCoto opened 2 years ago

0xCoto commented 2 years ago

I'm trying to build the Dockerfile on a Ubuntu 18.04 bionic arm64 machine using sudo docker build --platform linux/amd64 ., but I get the following error:

Sending build context to Docker daemon  39.23MB
Step 1/22 : FROM ubuntu:20.04
 ---> d5ca7a445605
Step 2/22 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 5f3b9c1637ed
Step 3/22 : RUN apt-get update -qq &&     apt-get -y --no-install-recommends install     autoconf     automake     build-essential     gfortran     git     latex2html     libcfitsio-bin     libcfitsio-dev     libfftw3-bin     libfftw3-dev     libglib2.0-dev     libpng-dev     libtool     libx11-dev     pgplot5     python3-dev     python3-numpy     python3-pip     tcsh     wget &&     apt-get clean all &&     rm -r /var/lib/apt/lists/*
 ---> Using cache
 ---> 51996e98e034
Step 4/22 : ENV PGPLOT_DIR=/usr/local/pgplot
 ---> Using cache
 ---> a2e98a44213c
Step 5/22 : ENV PGPLOT_DEV=/Xserve
 ---> Using cache
 ---> a86db73f9b72
Step 6/22 : RUN pip3 install numpy     scipy     astropy
 ---> Using cache
 ---> 7f67edc0c90c
Step 7/22 : ENV PRESTO /code/presto
 ---> Using cache
 ---> 54d3868f0007
Step 8/22 : ENV LD_LIBRARY_PATH /code/presto/lib
 ---> Using cache
 ---> 1e4a800a4773
Step 9/22 : ADD . /code/presto
 ---> Using cache
 ---> 5a61b9ab9c4a
Step 10/22 : WORKDIR /code/presto/src
 ---> Using cache
 ---> f4fca4f72fcb
Step 11/22 : RUN make cleaner
 ---> Using cache
 ---> 64704fd06a80
Step 12/22 : RUN make libpresto slalib
 ---> Using cache
 ---> e72611825c4e
Step 13/22 : WORKDIR /code/presto
 ---> Using cache
 ---> 6e6c4ce40d8b
Step 14/22 : RUN pip3 install /code/presto &&     sed -i 's/env python/env python3/' /code/presto/bin/*py &&     python3 tests/test_presto_python.py
 ---> Using cache
 ---> d6027fa1dc81
Step 15/22 : WORKDIR /home/soft
 ---> Using cache
 ---> 6e23ee9177de
Step 16/22 : RUN wget https://www.atnf.csiro.au/research/pulsar/psrcat/downloads/psrcat_pkg.tar.gz &&     gunzip psrcat_pkg.tar.gz &&     tar -xvf psrcat_pkg.tar &&     rm psrcat_pkg.tar &&     cd psrcat_tar &&     ls &&     bash makeit &&     cp psrcat /usr/bin
 ---> Using cache
 ---> 8ad5a65c2af4
Step 17/22 : ENV PSRCAT_FILE /home/soft/psrcat_tar/psrcat.db
 ---> Using cache
 ---> 00ab20bfaf6a
Step 18/22 : RUN git clone https://github.com/nanograv/tempo.git &&     cd tempo &&     ./prepare &&     ./configure &&     make &&     make install
 ---> Running in df6d9f33a0dc
Cloning into 'tempo'...
Updating files: 100% (260/260), done.
configure.ac:6: installing 'config/compile'
configure.ac:24: installing 'config/config.guess'
configure.ac:24: installing 'config/config.sub'
configure.ac:3: installing 'config/install-sh'
configure.ac:3: installing 'config/missing'
src/Makefile.am: installing 'config/depcomp'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran...  -L/usr/lib/gcc/aarch64-linux-gnu/9 -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/9/../../../../lib -L/lib/aarch64-linux-gnu -L/lib/../lib -L/usr/lib/aarch64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/aarch64-linux-gnu/9/../../.. -lgfortran -lm
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking if sgemm_ is being linked in already... no
checking for sgemm_ in -lopenblas... no
checking for ATL_xerbla in -latlas... no
checking for sgemm_ in -lblas... no
checking for sgemm_ in -lmkl... no
checking for sgemm_ in -framework vecLib... no
checking for sgemm_ in -lcxml... no
checking for sgemm_ in -ldxml... no
checking for sgemm_ in -lscs... no
checking for sgemm_ in -lcomplib.sgimath... no
checking for sgemm_ in -lblas... (cached) no
checking for sgemm_ in -lblas... (cached) no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tempo.cfg
config.status: creating src/config.h
config.status: creating clock/Makefile
config.status: creating ephem/Makefile
config.status: creating test/Makefile
config.status: creating tzpar/Makefile
config.status: creating util/print_resid/Makefile
config.status: executing depfiles commands

Tempo is ready to be compiled.  Please run 'make'.

'make install' will copy 'tempo' to /usr/local/bin.

Making all in src
make[1]: Entering directory '/home/soft/tempo/src'
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o a1ut1f.o a1ut1f.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o a1utcf.o a1utcf.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o ang.o ang.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o arrtim.o arrtim.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o atimfake.o atimfake.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bigendian.o bigendian.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o blkdbat.o blkdbat.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnrybt.o bnrybt.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnrybtx.o bnrybtx.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnrydd.o bnrydd.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnryddgr.o bnryddgr.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnryddk.o bnryddk.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnryddt.o bnryddt.f
bnryddt.f:123:10:

   46 |  do 20 i=1,4
      |                 2
......
  123 | 20 trb(i)=-d2bar
      |          1
Warning: Array reference at (1) out of bounds (4 > 3) in loop beginning at (2)
bnryddt.f:123:0:

  123 | 20 trb(i)=-d2bar
      | 
Warning: iteration 3 invokes undefined behavior [-Waggressive-loop-optimizations]
bnryddt.f:46:0:

   46 |  do 20 i=1,4
      | 
note: within this loop
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnryddfwhiecc.o bnryddfwhiecc.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnryeh.o bnryeh.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnryell1.o bnryell1.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnrymss.o bnrymss.f
gfortran  -g -O2 -ffixed-form -ffixed-line-length-none -std=legacy -c -o bnrydds.o bnrydds.f
bnrydds.f:50:15:

   50 |         real*10 frb, tt0, tt, orbits
      |               1
Error: Old-style type declaration REAL*10 not supported at (1)
make[1]: Leaving directory '/home/soft/tempo/src'
make[1]: *** [Makefile:478: bnrydds.o] Error 1
make: *** [Makefile:359: all-recursive] Error 1
The command '/bin/sh -c git clone https://github.com/nanograv/tempo.git &&     cd tempo &&     ./prepare &&     ./configure &&     make &&     make install' returned a non-zero code: 2

What could be the cause for this? Could there be an easy way to resolve this issue? The Docker image builds fine on macOS but apparently not so well on this Linux arm64 machine.