Primes icon indicating copy to clipboard operation
Primes copied to clipboard

Added arch files

Open marghidanu opened this issue 4 years ago • 13 comments

Running the benchmark under my M1 machine yielded quite a few errors on the following solutions:

error: [PrimeCSharp][solution_2] Failed building solution!
error: [PrimeDart][solution_1] Failed building solution!
error: [PrimeHaskell][solution_1] Failed building solution!
error: [PrimeJulia][solution_1] Failed building solution!
error: [PrimeJulia][solution_2] Failed building solution!
error: [PrimeSwift][solution_1] Failed building solution!
error: [PrimeZig][solution_1] Failed building solution! 
error: [PrimeZig][solution_3] Failed building solution!
error: [PrimeJava][solution_2] Failed building solution!
error: [PrimeFortran][solution_2] Failed building solution!

warn: [PrimeLua][solution_2] Exited with abnormal code: 1. Results might be partial... (can be fixed)
warn: [PrimePascal][solution_1] Exited with abnormal code: 217. Results might be partial...
warn: [PrimeWren][solution_1] Exited with abnormal code: 255. Results might be partial...

I've added the arch-amd64 flag for these since they fail to build/run under arm64.

marghidanu avatar Jul 14 '21 19:07 marghidanu

Any indication as to why these solutions might not build?

Could you provide docker output so that people without suitable hardware to test on may suggest fixes based on the error messages?

tjol avatar Jul 14 '21 20:07 tjol

@tjol Not all Docker images are suitable for ARM64. Also, some of the solutions specifically target x86_64.

marghidanu avatar Jul 14 '21 20:07 marghidanu

Some of those are clear. Lol @ Apple not providing a Docker image for Swift that runs on M1. Others, less so. I'm puzzled why Fortran solution 2 should fail when Fortran solution 1 works, as they run in the same environment

tjol avatar Jul 14 '21 20:07 tjol

Some of those are clear. Lol @ Apple not providing a Docker image for Swift that runs on M1. Others, less so. I'm puzzled why Fortran solution 2 should fail when Fortran solution 1 works, as they run in the same environment

Indeed the fact that Swift doesn't have an am64 Docker image is quite funny.

As for Fortran solution_2 that can probably be fixed. We'll probably do a review at some point and signal to the authors to improve their solutions.

marghidanu avatar Jul 14 '21 20:07 marghidanu

A detail that shouldn't matter (but who knows) is that the first RUN directive in Fortran/solution_2's Dockerfile is spelled as RUn.

rbergen avatar Jul 14 '21 20:07 rbergen

(but who knows)

Hence why I suggested docker output might be useful ;-)

tjol avatar Jul 14 '21 20:07 tjol

@rbergen that doesn't matter.

marghidanu avatar Jul 14 '21 20:07 marghidanu

As I said. it shouldn't. :) What's interesting is that the solution does (docker) build and run on my rpi 4.

rbergen avatar Jul 14 '21 21:07 rbergen

Hmm, that’s interesting, maybe is the virtualization engine for Docker under M1, let me switch that around and try again. Will do a comparison between the M1 and the Pi to see if the same solutions fail.

marghidanu avatar Jul 15 '21 05:07 marghidanu

For the Julia solutions, Julia does provide an arm64v8 Docker image, but only for 1.6.1-buster while the Julia solutions use 1.6.1-alpine3.13.

How do you suppose we handle this? Should we use 1.6.1-buster for all architectures? We should also probably check the other solutions for similar issues.

louie-github avatar Jul 15 '21 09:07 louie-github

Ideally, we should use images that support both x86_64 and arm64 solutions, but that shouldn't be mandatory. We support the arch files for this exact reason. If the developer decides to support both platforms, they should choose whatever images they think are suitable. For example, I chose to go with the Alpine 3.13 image on the Crystal implementation as it supports multiple platforms. The Crystal compiler is installed from the package manager as the official images do not run under arm64.

marghidanu avatar Jul 15 '21 09:07 marghidanu

Hmm, that’s interesting, maybe is the virtualization engine for Docker under M1, let me switch that around and try again. Will do a comparison between the M1 and the Pi to see if the same solutions fail.

I'm curious what your conclusions are, when you've had the time to look into this.

rbergen avatar Jul 17 '21 10:07 rbergen

Hmm, that’s interesting, maybe is the virtualization engine for Docker under M1, let me switch that around and try again. Will do a comparison between the M1 and the Pi to see if the same solutions fail.

Heya have you been able to look into this?

Macleykun avatar Sep 05 '21 12:09 Macleykun

Closing this after a brief discussion with @marghidanu.

rbergen avatar Nov 30 '22 09:11 rbergen