seanspotatobusiness
Posts: 151
Joined: Tue May 22, 2012 11:19 pm

Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Wed Jun 13, 2018 1:58 am

Can anyone tell me if it's possible to compile the code here to run on the Pi? Is it relevant that the Pi uses an ARM processor instead of conventional one you'd find in a desktop?

https://github.com/RavenProject/Ravencoin/releases
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Wed Jun 13, 2018 2:13 am

Is it relevant that the Pi uses an ARM processor instead of conventional one you'd find in a desktop?
Entirely relevant. RISC vs. CISC. https://www.electronicshub.org/risc-and ... itectures/

So, to answer your question in regards to porting, maybe. It would be more difficult (read: a lot of work) to port from x32/x64 to ARM in my opinion because of the reduced instruction set in RISC. This would be reflected in the compiler and necessitate some creative coding to work around (if possible at all) missing functions.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

seanspotatobusiness
Posts: 151
Joined: Tue May 22, 2012 11:19 pm

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Wed Jun 13, 2018 3:06 am

Thanks. I also heard that it depends on whether any of the dependencies are available for ARM and that I should just try it and see?
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

User avatar
Paeryn
Posts: 2108
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Wed Jun 13, 2018 4:50 am

The Traveler wrote:
Wed Jun 13, 2018 2:13 am
It would be more difficult (read: a lot of work) to port from x32/x64 to ARM in my opinion because of the reduced instruction set in RISC. This would be reflected in the compiler and necessitate some creative coding to work around (if possible at all) missing functions.
The code is C/C++, the only part I can see that directly uses inline asm has checks to use a default backup for non-x86 architectures (reading the time-stamp counter and hardware random numbers). Unless there is use of x86 intrinsics without backups for non-x86 then there shouldn't be much (if any) modifications needed.

The docs say that it recommends at least 1.5GB to compile, it gives a configure setup to make the compiler's garbage collector more aggressive which should help minimise swap usage on the RPi.
She who travels light — forgot something.

ghans
Posts: 7785
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Wed Jun 13, 2018 4:51 am

Just try it and see. You actually have the source code of this app, which is the minimum prerequisite neccessary for Raspberry Pi compatibility of random "Linux" software.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

seanspotatobusiness
Posts: 151
Joined: Tue May 22, 2012 11:19 pm

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Fri Jun 15, 2018 2:11 am

With some complex instructions listed here I was able to compile this source code for the Pi. The problem is I don't know where to find the finished, compiled files. Any idea where they would go?
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Fri Jun 15, 2018 2:59 am

The problem is I don't know where to find the finished, compiled files. Any idea where they would go?
Check the configure or make file. Look for the section labeled "install". It should provide clues to where it installs the files. Depending on any user supplied install path prefixes, usually executable files end up in /usr/bin or /usr/local/bin and the library files in /usr/lib or usr/local/lib. It's not a hard and fast rule but it applies generally.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

seanspotatobusiness
Posts: 151
Joined: Tue May 22, 2012 11:19 pm

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Sat Jun 16, 2018 4:45 am

Thanks for responding. I didn't find them in either of those locations but I may have found them in the src folder within the folder I did the compiling.
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 10860
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Is it possible to compile this code for the Pi if it was intended for different processor architecture?

Sat Jun 16, 2018 2:39 pm

its often NOT the type of CPU that is the problem, its the type of platform the code expects to be running on.
if the code expects certain hardware aspects to exists with certain closely defined aspects, be it interrupt handling, or timers, or DMA or other system specifics then if the other system doesn't have equivalents that work exactly the same on a register level, then such pieces of code have to be completely rewritten, if that is even possible.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 26 guests