I was unsure of where this should go in so I have placed it under 'General'.
One of the pieces of software I use is built using CMake and increasingly there is a use of 'CMAKE_SIZEOF_VOID_P' throughout the code. Now I have gone through and commented these out but it is annoying that every new release I have to manually edit the build. It would be nice if I could use a 64bit version of CMake (and potentially other 64 bit apps) and avoid having to do this manual editing.
Is there a experimental distribution of 64bit apps to go along with the 64bit Raspbian dist?
-
- Posts: 14
- Joined: Tue Mar 31, 2020 1:35 pm
-
- Posts: 27225
- Joined: Tue Mar 25, 2014 12:40 pm
Re: 64 bit Raspbian apps
graham.reeds wrote: ↑Tue Mar 31, 2020 1:44 pmI was unsure of where this should go in so I have placed it under 'General'.
One of the pieces of software I use is built using CMake and increasingly there is a use of 'CMAKE_SIZEOF_VOID_P' throughout the code. Now I have gone through and commented these out but it is annoying that every new release I have to manually edit the build. It would be nice if I could use a 64bit version of CMake (and potentially other 64 bit apps) and avoid having to do this manual editing.
Is there a experimental distribution of 64bit apps to go along with the 64bit Raspbian dist?
Raspbian is 32bit Userland, though you can have either a ARM32 or ARM64 Kernel.
Take what I advise as advice not the utopian holy grail, and it is gratis !!
Re: 64 bit Raspbian apps
Something seems wrong here. Surely cmake should define CMAKE_SIZEOF_VOID_P appropriately and the code should build on 32 bit and 64 bit platforms. Without the need to go and comment them out.
I have been building and running 64 bit code on the 32 bit raspbian but with a 64 bit kernel installed and sakaki's nspawn setup : https://www.raspberrypi.org/forums/view ... 3&t=232417
Although I did not go for the full 64 bit desktop experience, only a 64 bit command line shell that I could build 64 bit TUI code in.
Sadly I can't find the thread where sakaki explains how to do that.
I have been building and running 64 bit code on the 32 bit raspbian but with a 64 bit kernel installed and sakaki's nspawn setup : https://www.raspberrypi.org/forums/view ... 3&t=232417
Although I did not go for the full 64 bit desktop experience, only a 64 bit command line shell that I could build 64 bit TUI code in.
Sadly I can't find the thread where sakaki explains how to do that.
Memory in C++ is a leaky abstraction .
Re: 64 bit Raspbian apps
+1.
Its perfectly easy in this day and age to write C/C++ code that's portable between 64-bit and 32-bit platforms without any edits.
Re: 64 bit Raspbian apps
To install a 64-bit Debian Buster environment on your RPi3/4 (running Raspbian), per the fuller instructions here, you should first run:
Code: Select all
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get -y upgrade
And then (if you are on a 'with desktop' Raspbian system), simply issue:
Code: Select all
pi@raspberrypi:~ $ sudo apt-get install -y raspbian-nspawn-64
Or (on a 'lite', CLI-only) Raspbian system, you should instead issue:
Code: Select all
pi@raspberrypi:~ $ sudo apt-get install -y --no-install-recommends raspbian-nspawn-64
Once installed, you can then enter a 64-bit terminal either from the menu item (if on a desktop-based system):

or by issuing, at a standard 32-bit terminal (works on both desktop and 'lite' systems):
Code: Select all
pi@raspberrypi:~ $ ds64-shell
pi@debian-buster-64:~ $
The 'sidekick' 64-bit system is vanilla Debian Buster, so e.g. apt etc. works.
hth, sakaki
Re: 64 bit Raspbian apps
Thank you sakaki. I was wondering where those instructions had got to. That 64 bit shell worked very nicely. Great job.
Memory in C++ is a leaky abstraction .
-
- Posts: 14
- Joined: Tue Mar 31, 2020 1:35 pm
Re: 64 bit Raspbian apps
You would think? The test is if CMAKE_SIZEOF_VOID_P != 8 it just gives up. The version of cmake that you can apt-get just gives 4 as the sizeof VOID_P. Hence why I need to comment it out and if there was a repository of 64bit apps.
Sorry about not replying sooner - I seemingly was never subscribed to this topic.
Re: 64 bit Raspbian apps
Hmm...graham.reeds wrote: ↑Thu May 14, 2020 2:49 pmYou would think? The test is if CMAKE_SIZEOF_VOID_P != 8 it just gives up. The version of cmake that you can apt-get just gives 4 as the sizeof VOID_P. Hence why I need to comment it out and if there was a repository of 64bit apps.
Presumably if someone has gone to the trouble of testing that sizeof void is 8 before it will build anything there is a good reason for it. I have run across a few programs that require 64 bit pointers, for example when they map many gigabytes of file into memory space. For those cases there is no point in trying to build it for 32 bits anyway.
Of course they could just be dolts who don't care to write portable code.
Lucky we now have a nice way to build and run 64 bit code thanks to the great work of sakaki.
Memory in C++ is a leaky abstraction .
Re: 64 bit Raspbian apps
In order to learn how to write portable code, even a dolt needs access to a variety of hardware architectures and compilers. Experience with many of these can be obtained using emulation on a single Pi. Among others, qemu can do
- IA-32 (x86) PCs
- x86-64 PCs
- MIPS64 Release 6 and earlier
- Sun's SPARC sun4m
- Sun's SPARC sun4u
- PowerPC (PReP and Mac)
- RISC-V
- Altair 8008
- AT&T 3B2
- CDC 1700
- Data General Nova, Eclipse
- DEC Alpha
- DEC PDP-1, 4, 7, 8, 9, 10, 11, 15
- VAX 11/730, 750, 780, 8600
- HP 2116, 2100, 21MX, 3000
- Honeywell H316, H516
The availability of all these emulators means there's absolutely no excuse not to write fully verified architecture, endian and operating system independent code. An example of a recently written C program that complies without change for
- PDP-11
- PET
- Pi
- x86
viewtopic.php?t=257317&start=75#p1573277
Surprisingly, the cmake makefile maker and all its complexity is unsurprisingly unportable. In addition to sensible coding practices, creating portable software further involves choosing the right tools--popular, widespread and simple enough that they can be ported if necessary.
On the other hand, now that 64-bit Linux has (along with COVID-19 and nspawn) taken over the world, it's possible being portable is no longer important, even to something as similar as 32-bit Raspbian.
-
- Posts: 14
- Joined: Tue Mar 31, 2020 1:35 pm
Re: 64 bit Raspbian apps
The shell inside the shell works. Question is: Why use raspbian at all and why not just use ds64 directly? 

-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 12856
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: 64 bit Raspbian apps
Because it doesn't work on Pi0, 1 (ARM1176), or earlier 2's (A7). Only late Pi2s, Pi 3s (A53), and Pi4s (A72) are 64 bit processors.graham.reeds wrote: ↑Mon May 18, 2020 8:15 amThe shell inside the shell works. Question is: Why use raspbian at all and why not just use ds64 directly?![]()
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: 64 bit Raspbian apps
Feel free to. If you don't need any of the Pi-specific accelerations (video, mostly) then a standard 64b Debian userland works nicely.graham.reeds wrote: ↑Mon May 18, 2020 8:15 amThe shell inside the shell works. Question is: Why use raspbian at all and why not just use ds64 directly?![]()
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.
-
- Posts: 14
- Joined: Tue Mar 31, 2020 1:35 pm
Re: 64 bit Raspbian apps
But I am not interested in those for my use case.
The original problem was that cmake was reporting that the size of pointer was 4 bytes. The author of a software I use fairly often uses that to make sure it is being compiled on a 64 bit system (it is cross platform on Mac, Win, Linux). Commenting them out allows the software to compile fine but was awkward as I had to make the change every time a new release came out.
Hence why I asked if there was a repo with 64bit apps in it.
I had seen the nspawn project but it had a rather complex install method (glad to see that has changed), but now a boot to terminal needs to be changed to immediately spawn another terminal?
Hence why boot into raspbian at all and simply boot into the ds64 shell?
PS: I love the Pi (I have a couple of 2's, half a dozen Pi3b+ (for a failed virtual wind tunnel project), and a couple of Pi4's plus a couple of NanoPi (also for the virtual wind tunnel project)). On my desk I have a Pi3 and Pi4 in ArmorCase and a PiZero which I was making in a PiHole.
The original problem was that cmake was reporting that the size of pointer was 4 bytes. The author of a software I use fairly often uses that to make sure it is being compiled on a 64 bit system (it is cross platform on Mac, Win, Linux). Commenting them out allows the software to compile fine but was awkward as I had to make the change every time a new release came out.
Hence why I asked if there was a repo with 64bit apps in it.
I had seen the nspawn project but it had a rather complex install method (glad to see that has changed), but now a boot to terminal needs to be changed to immediately spawn another terminal?
Hence why boot into raspbian at all and simply boot into the ds64 shell?
PS: I love the Pi (I have a couple of 2's, half a dozen Pi3b+ (for a failed virtual wind tunnel project), and a couple of Pi4's plus a couple of NanoPi (also for the virtual wind tunnel project)). On my desk I have a Pi3 and Pi4 in ArmorCase and a PiZero which I was making in a PiHole.