-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding start to script for spack export.
There are a ton of symbols from system includes that are deemed missing, but we do not have a way to know that they are from system (and not a dependency). Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
66,520 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM ghcr.io/autamus/clingo:latest | ||
# docker build -f Dockerfile.clingo -t clingo . | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV PATH=/opt/conda/bin:$PATH | ||
RUN apt-get update && apt-get install -y curl | ||
RUN /bin/bash -c "curl -L https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > miniconda.sh && \ | ||
bash miniconda.sh -b -p /opt/conda && \ | ||
rm miniconda.sh" | ||
RUN /bin/bash -c "conda install -y -c conda-forge mamba && \ | ||
mamba create -q -y -c potassco -n clingo-env clingo && \ | ||
source activate clingo-env && \ | ||
conda clean --all -y && \ | ||
pip install pyelftools && \ | ||
conda install clingo ipython six" | ||
RUN echo "source activate clingo-env" > ~/.bashrc | ||
ENV PATH /opt/conda/envs/clingo-env/bin:${PATH} | ||
ENTRYPOINT /bin/bash | ||
WORKDIR /code | ||
ADD . /code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# A Logic Program to work with Spack | ||
|
||
The file [abi-facts.lp](abi-facts.lp) is generated with [this branch](https://github.com/vsoch/spack/tree/add/clingo-analyzer) of spack, which has an added analyzer for clingo: | ||
|
||
```bash | ||
$ spack install zlib+debug | ||
$ spack install tcl+debug | ||
$ spack analyze run -a clingo tcl | ||
``` | ||
|
||
Note above that both tcl and it's dependency zlib were installed with debug information, | ||
otherwise this would not work. Also note that in the command above, we are stating | ||
that "tcl" is the main library we are interested in to assess compatibility with | ||
it's dependencies. In the case of generating facts for a solver (likely for a splice) | ||
the problem will be slightly different - we will still be interested in some primary package, | ||
but we will be including facts (atoms) for the dependency version we want to splice in. | ||
|
||
The above command generates that file in the analyzers folder, in the clingo subdirectory. We are copying it here so it's easy to develop with. | ||
Next, let's build a container to develop in: | ||
|
||
```bash | ||
$ docker build -f Dockerfile.clingo -t clingo-docker . | ||
``` | ||
|
||
And shell into it. | ||
|
||
```bash | ||
$ docker run -it --rm -v $PWD/:/code clingo-docker bash | ||
``` | ||
|
||
Unlike our first attempt in the [python](../python) folder, instead of having | ||
a main binary and two libraries (one known to work and one we are testing), | ||
for this logic program we are throwing all symbols in the space into a bag, | ||
including the compiler, and we target the binaries of the main package as the | ||
ones we are interested in to assess if they still work. This means that we assume | ||
that a dependency of this main library (that is already installed) is working, | ||
and we don't add all nested dependency symbols into the mix. If any symbol is | ||
missing for a main binary/library that we are interested in, we will throw an issue. | ||
|
||
We can then develop and run our program: | ||
|
||
```bash | ||
(clingo-env) root@12069473da65:/code/python# clingo --out-ifs=\\n abi-facts.lp is_compatible.lp | ||
``` |
Oops, something went wrong.