admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

Building a static model executable in Docker #303

Closed arni-magnusson closed 8 months ago

arni-magnusson commented 8 months ago

Hi! I just ran the tutorial QuickStart - Using ADMB Docker Linux Image with success on an Ubuntu 22.04 host. Happily built and ran simple.tpl, first as a host-level call and then as an interactive session. Great improvement since the previous container release.

The only question I have is where it says

For Linux host, executable could be run locally.

 ./simple

In my case that returns an error message

./simple: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by ./simple)

Do we know if the model executable was built statically, and whether that could be helpful for running the executable locally on the host machine without getting an error message?

johnoel commented 8 months ago

If on a linux host, use command below to tun in the container

docker run --rm --volume $PWD:/simple --workdir /simple --entrypoint ./simple johnoel/admb-13.2:linux

arni-magnusson commented 8 months ago

Right, that's the "host-level call" that I mentioned, which ran without problems. I guess I'm trying to make two points:

  1. The lines

    For Linux host, executable could be run locally.
    ./simple

    can perhaps be deleted from the quickstart-unix tutorial, if the statement is not generally true. It seems to me that the user cannot run the executable locally unless their host machine (laptop) happens to be Debian 12, matching the basis of the image.

  2. Alternatively, the above lines could stay in the tutorial if we are indeed able to guarantee that the model executable can run on practically all Linux machines (Red Hat, openSUSE, etc.). I don't know enough about statically linked executables to know if such executables are achievable or recommended. I would be happy to see the lines deleted from the tutorial if the executable cannot be run locally by typing ./simple in the host terminal.

iantaylor-NOAA commented 8 months ago

Is the -p (for portable) option still relevant as discussed here: https://github.com/admb-project/admb/pull/127?

johnoel commented 8 months ago

Done. (see e9ac427)