Skip to content

Commit

Permalink
FIX/Fix:minizinc Docker installation
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoPez committed Jan 13, 2025
1 parent cb2c6ab commit ef532ac
Showing 1 changed file with 1 addition and 67 deletions.
68 changes: 1 addition & 67 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -228,72 +228,6 @@ RUN cd yices-2.6.4 \

WORKDIR /opt

# Installing or-tools
RUN wget https://github.com/google/or-tools/releases/download/v9.2/or-tools_amd64_flatzinc_ubuntu-21.10_v9.2.9972.tar.gz \
&& tar -xf or-tools_amd64_flatzinc_ubuntu-21.10_v9.2.9972.tar.gz \
&& rm or-tools_amd64_flatzinc_ubuntu-21.10_v9.2.9972.tar.gz

RUN mkdir -p /opt/minizinc/solvers/s

RUN echo '\
{ \n\
"executable": "/opt/or-tools_flatzinc_Ubuntu-21.10-64bit_v9.2.9972/bin/fzn-or-tools", \n\
"id": "Xor", \n\
"isGUIApplication": false, \n\
"mznlib": "/opt/or-tools_flatzinc_Ubuntu-21.10-64bit_v9.2.9972/lib", \n\
"mznlibVersion": 1, \n\
"name": "Xor", \n\
"needsMznExecutable": false, \n\
"needsPathsFile": false, \n\
"needsSolns2Out": true, \n\
"needsStdlibDir": false, \n\
"stdFlags": [ \n\
"-a", \n\
"-p", \n\
"-r", \n\
"-f" \n\
], \n\
"supportsFzn": true, \n\
"supportsMzn": false, \n\
"supportsNL": false, \n\
"version": "8.2" } \
' > /opt/minizinc/solvers/Xor.msc

# Installing Choco

# Copy Choco's executable from the previous stage across
RUN wget https://github.com/chocoteam/choco-solver/archive/refs/tags/v4.10.12.tar.gz \
&& tar -xf v4.10.12.tar.gz \
&& rm v4.10.12.tar.gz

RUN wget https://github.com/chocoteam/choco-solver/releases/download/v4.10.12/choco-solver-4.10.12.jar

# Update files
RUN sed -i 's&CHOCO_JAR=.*&CHOCO_JAR=/opt/choco-solver-4.10.12.jar&g' /opt/choco-solver-4.10.12/parsers/src/main/minizinc/fzn-choco && \
sed -i 's&"mznlib".*&"mznlib":"/opt/choco-solver-4.10.12/parsers/src/main/minizinc/mzn-lib/",&g' /opt/choco-solver-4.10.12/parsers/src/main/minizinc/choco.msc && \
sed -i 's&"executable".*&"executable":"/opt/choco-solver-4.10.12/parsers/src/main/minizinc/fzn-choco",&g' /opt/choco-solver-4.10.12/parsers/src/main/minizinc/choco.msc

ENV PATH="/opt/choco-solver-4.10.12:${PATH}"

RUN echo '\
{ \n\
"id": "org.choco.choco", \n\
"name": "Choco-solver", \n\
"description": "Choco FlatZinc executable", \n\
"version": "4.10.12", \n\
"mznlib": "/opt/choco-solver-4.10.12/parsers/src/main/minizinc/mzn_lib", \n\
"executable": "/opt/choco-solver-4.10.12/parsers/src/main/minizinc/fzn-choco", \n\
"tags": ["cp","int"], \n\
"stdFlags": ["-a","-f","-n","-p","-r","-s","-t"], \n\
"supportsMzn": false, \n\
"supportsFzn": true, \n\
"needsSolns2Out": true, \n\
"needsMznExecutable": false, \n\
"needsStdlibDir": false, \n\
"isGUIApplication": false \n\
} \
' > /opt/minizinc/solvers/choco.msc

ENV MZN_SOLVER_PATH="/opt/minizinc/solvers"

ENV LD_LIBRARY_PATH="/opt/MiniZincIDE-2.6.4-bundle-linux-x86_64/lib:${LD_LIBRARY_PATH}"
Expand All @@ -316,4 +250,4 @@ FROM claasp-base AS claasp-lib

COPY . .

RUN make install
RUN make install

0 comments on commit ef532ac

Please sign in to comment.