BRL-CAD / brlcad

BRL-CAD is a powerful cross-platform open source combinatorial solid modeling system
https://brlcad.org
Other
686 stars 140 forks source link

Docker debian:stable-slim (bookworm) build report #113

Open ITmaze opened 7 months ago

ITmaze commented 7 months ago

Context: I'm a long time software developer. I prefer Debian and use Docker for most of my experiments. I'm a first-time visitor to the BRL-CAD world and wanted to test it for myself. I was unable to find any packages for Debian (Bookworm) and thought I'd try my hand at compiling from source.

I came across some issues, but don't feel that I know enough about the ecosystem to start updating the wiki, even though technically I suspect I could. Instead I'm lodging this as an issue, so others with more experience might consider my feedback in a wider context.

I essentially followed the bouncing ball on the wiki and got to the point where I could compile the software inside a Docker container, using a build stage and then copy the installed files from that stage to a new container.

In doing so I discovered the following:

These dependencies appear to be superfluous, because build-essential already pulls them in:

These dependencies appear to be missing. The compilation process stops or generates an error. I didn't dig in to see if all errors were terminal or not. For example, in passing I saw other errors, like references to OpenCV missing, but they didn't appear to stop the compilation process. I note that a big omission is git:

After compilation completed, I ran each of the tests. I haven't (yet) submitted my benchmarks since I don't know if they are representative. I'm doing this all inside a VMware Linux VM running on MacOS. My "Docker" machine is not using all the resources of the Mac, so these are "virtual" benchmarks, impressive, but not sure how relevant they are.

As I understand it, make test is supposed to have "failures", but, in my opinion, that doesn't mean that the process itself should fail, since that halts the compilation during the build stage of a Docker container, which means that you cannot use it to validate the build. It's unclear from the documentation that I found which of the tests are run by make test, since none of the other tests appeared to have any failures, which makes me think that it is a super set of all tests with bonus tests thrown in.

If you follow the instructions in the wiki, (and you resolve the missing dependencies) you end up with an installed binary in "the right" location, that passes all the tests, but won't run because none of the dependencies are installed. I was unable to discover the list of actual dependencies at this point.

It's unclear how to set the install directory to something else, like /opt or /usr/local and make -n install didn't actually help provide information about what was going to be installed where, instead giving me pages of make commands, rather than install commands.

I tried using checkinstall to "package" the compiled version, but it failed with this error:

CMake Error at src/other/ext/cmake_install.cmake:46 (file):
  file INSTALL destination: /usr/brlcad/rel-7.38.1/lib is not a directory.

Interestingly, make install worked just fine, though it was unclear what was installed and where. I took a punt and considered /usr/brlcad the root of the installation. I don't know if any files were "installed" anywhere else.

The script ./sh/make_deb.sh, which I discovered in /doc/README.Linux is not mentioned in the "Compiling BRL-CAD" wiki page. It solves the issues with dependencies that are not installed on a bare system.

Apart from altering the copyright date on that script, it wasn't updated since 2014. Surprisingly it still appears to work in the current (Bookworm) version of Debian. It does put up several warnings about "Compatibility levels before 10 are depreciated (level 7 in use)"

Based on the package that the script creates, this is a list of the dependencies that are installed on a debian:stable-slim container:

At this stage I can launch both mged and archer and see the user interface. I haven't done anything with it, but that's for tomorrow.

If any of my feedback needs more input from me, please don't hesitate to ask. If there are things that need doing that I could or should (like updating the wiki), please let me know. I don't want to step on any toes.

Kind regards, Onno