User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

OpenSCAD

Tue Feb 26, 2019 3:21 am

I have been attempting to compile OpenSCAD on Raspbian for a while now, with repeated failure. So I am asking for some help, how can I get OpenSCAD up and running on current Raspbian?
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Silverlock
Posts: 87
Joined: Wed Apr 10, 2013 3:51 am

Re: OpenSCAD

Tue Feb 26, 2019 3:49 am

I built a recent version (2018.11.22) from source by following the instructions at https://github.com/openscad/openscad. It was a few months ago but I don't recall any big issues. Ran the dependencies scripts, started make, went and watched some TV, came back an hour or two later and it was all done. Only wrinkle that I recall was that it ended up using Qt4 rather than Qt5 and that the 'ding' at the end of a Render didn't work because it needed some stuff that was only available in Qt5. A few minutes hacking the source and rebuilding got that working too. Exactly what problems are you running into?

One non-standard aspect on my setup is that I'm running off an external HDD rather than the uSD card and have a nice big swap file (2Gb). I vaguely recall that at least one of the compiles took a long time and lots and lots of memory.
RPi3+external HDD/Raspbian Stretch

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: OpenSCAD

Tue Feb 26, 2019 11:08 am

Silverlock wrote:
Tue Feb 26, 2019 3:49 am
I built a recent version (2018.11.22) from source by following the instructions at https://github.com/openscad/openscad. It was a few months ago but I don't recall any big issues. Ran the dependencies scripts, started make, went and watched some TV, came back an hour or two later and it was all done. Only wrinkle that I recall was that it ended up using Qt4 rather than Qt5 and that the 'ding' at the end of a Render didn't work because it needed some stuff that was only available in Qt5. A few minutes hacking the source and rebuilding got that working too. Exactly what problems are you running into?

One non-standard aspect on my setup is that I'm running off an external HDD rather than the uSD card and have a nice big swap file (2Gb). I vaguely recall that at least one of the compiles took a long time and lots and lots of memory.
My primary issue has been running out of memory. Though once I get things to go I end up with a list of errors from gcc so long that I have been spending months attempting to track down each and it is still a long list after months of eliminating issue after issue.

I wish that there were still a binary package in the repos. If people have built it why is is not yet in the stretch repos? It was in the Jesse repos. Just because it does not autobuild is no reason not to have a working version in the repos once a working version exists.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: OpenSCAD

Tue Feb 26, 2019 11:14 am

This is enough of an issue that I am actually tempted to break my long standing rule of no JS. I do not like to admit it though at least OpenJSCAD works out of box (though a lot slower than OpenSCAD on the same HW).

I do hope it is not time for me to learn Java Script.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Silverlock
Posts: 87
Joined: Wed Apr 10, 2013 3:51 am

Re: OpenSCAD

Tue Feb 26, 2019 8:57 pm

After sleeping on it, I remembered that building OpenSCAD from source wasn't completely smooth sailing. I did have to massage a few more Qt related things. Quite possibly that's due to using Qt4 rather than Qt5. But it certainly wasn't terribly difficult; I had the new version built in a single evening, and most of that was waiting for the make command to finish.

I just dug up the 2018.11.22 source that I had, unzipped it into another directory and rebuilt it. Here's what I did.


Note 1: this isn't a completely fair test. I have obviously built OpenSCAD on this sytem before. So I may have had some other issues with getting the dependencies' acts together that I've forgotten. I'd really have to put together a fresh system from scratch and start from there. But I'm just not feeling that ambitious.

Note 2: my system isn't running off the uSD card. It's on an external HDD, and I have a 2GB swap file. It wouldn't surprise me in the least if the build fails if you try it on a system running on the uSD with a 100MB swap file.

Note 3: This isn't related to the build, but to actually running OpenSCAD once you've got it built. Using the original non-GL desktop driver did not work for me when it came time to run OpenSCAD. Either fake or full KMS was required. And even that didn't work on a system that was upgraded from Jessie to Stretch. It only worked properly with a fresh install of Stretch. You can probably guess how I found that out.

1. Edit the scripts/check-dependencies.sh file, and at the start of main(), move qscintilla2 to the start of the deps list ahead of qt so it looks like this:

Code: Select all

deps="qscintilla2 qt cgal gmp mpfr boost opencsg glew eigen glib2 fontconfig freetype2 harfbuzz libzip bison flex make"
2. Follow the instructions in "Building for Linux/BSD" and "Building for Linux/BSD on systems with older or missing dependencies". Since I already had all the dependencies from building OpenSCAD before, this was quick for me.

3. Edit src/mainwin.cc. Replace the lines

Code: Select all

#include <QSound>
with

Code: Select all

#include <cstdlib>
and

Code: Select all

QSound::play(":sounds/complete.wav");
with

Code: Select all

system("/usr/bin/play -q /usr/local/share/openscad/sounds/complete.wav");
4. Run "qmake-qt4 openscad.pro". After it creates the Makefile, remove "-lQtMultimedia " from the LIBS line near the start of the Makefile.

5. Run the make. Go have lunch. Or maybe watch a movie. It's going to take a while. It took just over 2 hours for the make to complete on my system. Ignore the myriad of 'notes:' complaining about parameter passing changing in GCC 7.1. Raspbian isn't there yet.

6. Once your command prompt is back, you can run a quick test with "./openscad". Obviously all the bits won't be in their proper places yet, but you should be able to open up a scad file and see it at this point.

Image

7. Exit the program and run "sudo make install".

8. cd to /usr/local/share/openscad. Create the sounds directory if necessary. Copy complete.wav from the sounds subdirectory of your build directory to the sounds directory here. Install play if you haven't already.

9. That ought to be it. There ought to be an OpenSCAD icon either in your main menu somewhere or maybe even on your desktop.
Last edited by Silverlock on Sun Mar 03, 2019 8:56 pm, edited 1 time in total.
RPi3+external HDD/Raspbian Stretch

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: OpenSCAD

Sat Mar 02, 2019 4:18 pm

Thank you for that. I will get started with that about two hours before I go to sleep next. I hope that it all goes as smoothly. There are tricks to use less memory for a build, it just ends up taking a bit longer to build.

Assuming that all goes well today for my build:
What would it take to get OpenSCAD in the Raspbian Repos? As it can be built, someone that has the access could produce a set of diffs so that it can be built with the auto-builder and be included in the repos, should not be to difficult, and once I build it there will be two people to verify that it works as expected. Please, Please, should not make everyone with a 3d printer have to build this from source.

I will report back my results in building tomorrow.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: OpenSCAD

Sat Mar 02, 2019 4:22 pm

Also most 3D software for CAD/CAM runs faster on the RPi 3B than on my Intel Win10 box (that I have been playing with a bit last few days), by a long shot. While I am sure part of that is the Intel HD graphics not keeping up with VideoCoreIV, it is still enough to make the RPi 3B+ a more desirable platform for CAD/CAM. Even OpenSCAD on Jessie ran faster than OpenSCAD on the Win10 x86PC.

And of course OpenJSCAD is many times slower than OpenSCAD (and memory usage is a concern).

So once I succeed at this build I would ask that someone please make the diffs to get it to build with the autobuilder, so that other Raspbian users can have it available without having to build.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: OpenSCAD

Sun Mar 03, 2019 2:23 pm

I do thank you for the aid. Though this time it failed with a system lockup, ran out of RAM (running swappoff), despite trying to reduce memory usage by the compile.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
scruss
Posts: 2471
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: OpenSCAD

Sun Mar 03, 2019 4:05 pm

There's another thread on building it here: Is Openscad ported to Raspbian Stretch? that might contain some additional useful pointers
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Silverlock
Posts: 87
Joined: Wed Apr 10, 2013 3:51 am

Re: OpenSCAD

Sun Mar 03, 2019 8:58 pm

A quick read through Joel_Mckay's build instructions revealed that we both used Qt4 and 2GB swap files in order to build the binary.

I've edited my earlier post to use qmake-qt4 rather than qmake. Although they're both the same on my installation, I imagine others might have qmake pointing to the Qt5 version.
RPi3+external HDD/Raspbian Stretch

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: OpenSCAD

Mon Mar 04, 2019 1:24 am

Silverlock wrote:
Sun Mar 03, 2019 8:58 pm
A quick read through Joel_Mckay's build instructions revealed that we both used Qt4 and 2GB swap files in order to build the binary.

I've edited my earlier post to use qmake-qt4 rather than qmake. Although they're both the same on my installation, I imagine others might have qmake pointing to the Qt5 version.
Yes my qmake does point at the Qt5 version, though I know to use the Qt4 version. The 2GB swapfile is likely an issue, as I can not get the RPi to boot from a spinning rust HDD, and my SSD is in use otherwise (RISC OS boot drive), so I am running from a 64GB SD Card.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Silverlock
Posts: 87
Joined: Wed Apr 10, 2013 3:51 am

Re: OpenSCAD

Mon Mar 04, 2019 2:16 am

I haven't felt the need to go to the USB only boot route either. I've left /boot on the uSD and just moved / over to an HDD. It's not bleeding edge but it works for my purposes.
RPi3+external HDD/Raspbian Stretch

User avatar
Arimil
Posts: 4
Joined: Thu Mar 21, 2019 4:55 am

Re: OpenSCAD

Thu Mar 21, 2019 9:37 pm

Silverlock wrote:
Tue Feb 26, 2019 8:57 pm
Thanks I was able to get it built after a bunch of messing with dependencies following this.

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: OpenSCAD

Sun Jun 30, 2019 10:32 am

Can anyone point me to a bullet proof script for OpenScad on the Pi - I want to exercise the long legs of my brand new #Pi4x4 . . .
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

User avatar
Gavinmc42
Posts: 3715
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenSCAD

Tue Jul 16, 2019 10:28 am

Pretty impressed with OpenGL on the Pi4.
Thought I would try installing OpenSCAD
So many dependencies.
I got this far. Hey, wonder if Povray works?

./scripts/check-dependencies.sh
depname minimum found OKness
qt 4.4 unknown NotOK
./scripts/check-dependencies.sh: line 248: -query: command not found
./scripts/check-dependencies.sh: line 248: -query: command not found
qscintilla2 2.7 unknown NotOK
cgal 3.6 4.13 OK
gmp 5.0 6.1.2 OK
mpfr 3.0 4.0.2 OK
boost 1.35 1.67 OK
opencsg 1.3.2 1.4.2 OK
glew 1.5.4 1.7.0 OK
eigen 3.0 3.3.7 OK
glib2 2.0 2.58.3 OK
fontconfig 2.10 2.13. OK
freetype2 2.4 2.9.1 OK
harfbuzz 0.9.19 2.3.1 OK
libzip 0.10.1 1.5.1 OK
bison 2.4 3.3.2 OK
flex 2.5.35 2.6.4 OK
make 3 4.2.1 OK
double-conversion 2.0.1 2.0.1 OK
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

hklang
Posts: 2
Joined: Sun Aug 11, 2019 8:29 pm

Re: OpenSCAD

Mon Aug 12, 2019 1:06 pm

Apparently working for me on Buster/rpI4

I'm using this appimage from openscad snapshots:

files . openscad. org / snapshots / OpenSCAD-2019.01.13-armhf.AppImage

User avatar
scruss
Posts: 2471
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: OpenSCAD

Mon Aug 12, 2019 7:00 pm

can confirm that that works on a 3A+ running Buster. Thanks for finding it!

Direct AppImage link:
https://files.openscad.org/snapshots/Op ... f.AppImage

All snapshots:
https://files.openscad.org/snapshots/
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
Gavinmc42
Posts: 3715
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenSCAD

Tue Aug 13, 2019 12:11 am

Yep, thanks for finding that.
Just noticed it was a QT problem, had QT issues when trying to compile FreeCAD.
Sort QT out both might compile?

Usable CAD on a Pi4 is getting very close.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

kdv
Posts: 6
Joined: Wed Aug 21, 2019 10:43 am
Location: Madrid, Spain

Re: OpenSCAD

Wed Aug 21, 2019 10:49 am

Openscad-2019.05, compiled from source on 2019-07-10-raspbian-buster-full. Installation in /opt/openscad-2019.05/
There's a file /opt/openscad-2019.05/BUILD_NOTES which shows the "apt-get install" used.

https://www.dropbox.com/s/6jh22c7gxr6s9 ... r.bz2?dl=1

hklang
Posts: 2
Joined: Sun Aug 11, 2019 8:29 pm

Re: OpenSCAD

Thu Aug 22, 2019 10:57 pm

Thank you very much kdv

Build instructions worked perfectly on rpi4x4 latest buster.

User avatar
Gavinmc42
Posts: 3715
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenSCAD

Fri Aug 23, 2019 2:06 am

Optimized for Pi4 - A72 on Gentoo64
Attachments
OpenSCAD_2019-08-23_03-01-28.png
OpenSCAD_2019-08-23_03-01-28.png (115.68 KiB) Viewed 863 times
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

kdv
Posts: 6
Joined: Wed Aug 21, 2019 10:43 am
Location: Madrid, Spain

Re: OpenSCAD

Fri Aug 23, 2019 3:45 pm

I've created an AppImage for Openscad-2019.05 on Buster.
You can download the binary. Here are the Build notes. If there are any errors, please tell.

I hope this tides us over until we get an "official" OpenSCAD release.

User avatar
Gavinmc42
Posts: 3715
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenSCAD

Sat Aug 24, 2019 1:22 am

Now that it works on two different OS, we can cross this off the list.
The officials in charge of the official OS's can take note and add it :D

The collection of usable CAD programs is growing :D
Now how about some CAM apps?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

kdv
Posts: 6
Joined: Wed Aug 21, 2019 10:43 am
Location: Madrid, Spain

Re: OpenSCAD

Sat Aug 24, 2019 7:04 am

Now how about some CAM apps?
What apps do you have in mind?

User avatar
Gavinmc42
Posts: 3715
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenSCAD

Sat Aug 24, 2019 10:48 am

FreeCAD has G-code.
LinuxCNC needs a RT kernel.
What else is there that will run on Pi's?
Inkscape for 2D to G-code.

Once stuff is designed it needs to be made.
Additive or subtractive.
Plastics -
PLA, ABS = 3D printer = slicer.
Nylon? Laser Sintered powder?
UV resin
Metal -
CNC Lathe, Mill.

I have not used OpenSCAD much, will it help?
Time to RTFM
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Raspbian”