Skip to content

Latest commit

 

History

History
179 lines (162 loc) · 6.33 KB

File metadata and controls

179 lines (162 loc) · 6.33 KB

Scratchpad for Cesogen

Generate manual

(asdf:load-system "imbrex/generate-documentation")
(asdf:load-system "cesogen/documentation")
(uiop:symbol-call '#:imbrex/generate-documentation '#:generate-section-documentation
                  (symbol-value (uiop:find-symbol* '#:@cesogen-manual '#:cesogen/documentation))
                  "cesogen/documentation"
                  :formats '(:pdf)
                  :extra-pandoc-options '("--metadata=author:Paul A. Patience"))

Build CLI

Locally

make all

Via Docker

Run the Docker daemon in another terminal.

# We want to evaluate $GUIX_ENVIRONMENT within the first instance of
# /bin/sh, hence the particular quoting.
guix shell --pure docker containerd -- /bin/sh -c '/bin/doas /bin/su -c "PATH=\"$GUIX_ENVIRONMENT/bin\" dockerd"'

Add dependencies here when necessary.

echo 'git asdf https://gitlab.common-lisp.net/asdf/asdf.git :tag 3.3.6'
echo 'git asdf-release-ops https://github.com/daewok/asdf-release-ops.git :tag v0.1.0'
# CFFI and lisp-invocation are for asdf-release-ops.
echo 'git lisp-invocation https://github.com/fare/lisp-invocation.git :ref ebf543ca17422dfbb51609f5b6d35a98c5f07449'
/home/paul/projects/passel/passel-list \
  alexandria \
  clingon \
  cffi \
  introspect-environment \
  mgl-pax \
  nibbles \
  numpy-file-format \
  pathname-utils | grep -v '^#'

Run this afterwards.

scripts/get-dependencies

Build the program.

guix shell --pure make docker-cli -- make docker-musl
guix shell --pure make docker-cli -- make docker-glibc
guix shell --pure make docker-cli -- make docker-static

(It takes about 3 minutes to compile the static executable.)

Troubleshooting

guix shell --pure docker-cli -- docker run \
  clfoundation/sbcl:alpine3.15 --noinform --non-interactive \
    --eval '(format t "~S~%" *features*)'
guix shell --pure docker-cli -- docker run \
  fukamachi/sbcl:2.3.10-alpine --noinform --non-interactive \
    --eval '(format t "~S~%" *features*)'

TODO-ish

cesogen/mesh api

;; here cesogen/fields:intersection. ;; f:intersection. ;; cesogen:intersection (of cellular solids) ;; cesogen is an sdf-based cellular solid generator. ;; cesogen bunny.stl intersection. ;; so clearly a cesogen intersection is sdf. ;; The stuff that is exported from cesogen is clearly just for those mesh things. ;; ;; now the question is, what if we start adding that kind of stuff to cesogen? ;; smooth… ;; smooth-mesh? ;; well, no, it would be smooth sdf. ;; and if I add a mesh smoothing operation… ;; it would have to be in postprocessing, ;; so probably better done in a separate program. ;; ;; this way: ;; ;; cesogen gyroid box -> ;; cesogen:intersection #’gyroid #’box ;; ;; what about cesogen/mesh though… ;; maybe it’s fine if the apis are different, e.g., ;; contour fun output. ;; ;; contour fun grid ;; (contour #’gyroid (make-uniform-grid …)) ;; should return a mesh. ;; ;; Hmm, it would be great if the meshes were compatible. ;; ;; (imbrex:intersection (contour #’gyroid (make-uniform-mesh…) ;; I think it’s fine for now to have meshes, but it will be no mesh operations. ;; Like perhaps I could use operations, but it will be all internal; no exporting of mesh ;; operations, that’s for sure.

-o ‘|f3d’ with cesogen?

Start README

Probably just say to install Docker, or manually install the dependencies. I mean, the only dependency to install locally is SBCL (‘sbcl’ on Ubuntu, Debian and Arch Linux), awk (installed by default), curl and git. Oh, well, my libraries need to be released, too. But when I distribute to people around, I can pass them the ext dir.

Or, if using Docker, the only thing they save is having to install SBCL.

On Windows it will be trickier, since Awk is not available by default.

Fix intermittent failure to find components when downloading dependencies directly in containers

Fix when running directly from container

It doesn’t generate the output file.

MAYBE Fix the structure of the repo to make it easier to use Docker?

Like with src. Or maybe just *.lisp, I guess. Or use .dockerignore? I think it’s better to avoid dockerignore. ok so that is why people have starting splitting directories, like doc src test, etc. because it is easier to split in docker and other container-like things.

Sometimes SBCL crashes during the build in Docker

More stuff in Makefile?

Target to build the documentation

Remember to move generate-documentation here.

For deps?

Archive

Or let asdf-release-ops do that for me? How will I distribute? Could have an archive which contains the ext stuff.

The croc releases have Linux, FreeBSD and DragonFlyBSD, and it contains readme, license, completions, and the executable. No signature or anything.

MAYBE Further improve the Dockerfiles with dependent stages

https://docs.docker.com/build/cache/#use-multi-stage-builds gives an example where they install several things separately, just to get the dependencies, and at the end nothing stays anyway.

I suppose the dependencies could be fetched in the static build while SBCL is being compiled.

MAYBE Add Docker labels

https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys

Verbose information

E.g., size of contouring grid, DSL showing the SDF combination, etc.

Move guix.scm to scripts dir?

guix.scm in root dir does not play well with ext/, which can contain scm files too

And also, then need to copy them all over. (unless I get the git dir and copy only those git files.)

How useful is -o '|f3d' as an option?

I can just open F3D on the file first and then refresh it when it changes. For dynamic viewing anyway a GUI would be better.

I’m starting to get around to the idea that syntax sugar (shorthands, basically) might hurt more than they help. And I can always add some later; it’s harder to remove already existing ones.

Doc dir?

Eventually switch to podman