diff --git a/Makefile b/Makefile index e9df038d..212a12a4 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ rundocker: builddocker sh -c "cd /home/sage/tii-claasp && make install && cd /home/sage/tii-claasp && exec /bin/bash" builddocker-m1: - docker build --build-arg="GUROBI_ARCH=armlinux64" -f docker/Dockerfile --platform linux/aarch64 --target claasp-base -t $(DOCKER_IMG_NAME) . + docker build -f docker/Dockerfile --platform linux/x86_64 --target claasp-base -t $(DOCKER_IMG_NAME) . rundocker-m1: builddocker-m1 docker run -i -p 8888:8888 --mount type=bind,source=`pwd`,target=/home/sage/tii-claasp -t $(DOCKER_IMG_NAME) \ @@ -95,6 +95,3 @@ copyright: install local-installation: ./configure.sh - -local-installation-m1: - ./configure.sh armlinux64 diff --git a/configure.sh b/configure.sh index 152f30f7..ad3f5bab 100755 --- a/configure.sh +++ b/configure.sh @@ -2,7 +2,7 @@ apt-get -qq update apt-get install -y python3 -python3 create_bash_script.py $1 +python3 create_bash_script.py chmod +x dependencies_script.sh ./dependencies_script.sh source ~/.bashrc diff --git a/create_bash_script.py b/create_bash_script.py index ad2c72c7..89004614 100644 --- a/create_bash_script.py +++ b/create_bash_script.py @@ -1,7 +1,5 @@ import sys -gurobi_arch = sys.argv[1] or 'linux64' - with open('docker/Dockerfile', 'r') as f: dockerfile_lines = f.readlines() @@ -10,6 +8,10 @@ environment_variables = [] for line in dockerfile_lines: line = line.strip() + + if line.startswith("FROM claasp-base AS claasp-lib"): + break + is_a_comment = line.startswith('#') is_split_command = line.endswith('\\') if not line or is_a_comment: @@ -21,11 +23,7 @@ docker_command += line bash_instruction = '' if docker_command.startswith('RUN'): - command = docker_command.split('RUN')[1].strip() - if 'GUROBI_ARCH' in command: - bash_instruction = command.replace('${GUROBI_ARCH}', gurobi_arch) - else: - bash_instruction = command + bash_instruction = docker_command.split('RUN')[1].strip() elif docker_command.startswith('ENV'): command = docker_command.split('ENV')[1].strip() environment_variable = command.split('=')[0] @@ -34,11 +32,7 @@ bash_instruction = f'export {command}' elif docker_command.startswith('ARG'): command = docker_command.split('ARG')[1].strip() - bash_instruction = 'export ' - if 'GUROBI_ARCH' in command: - bash_instruction += f'GUROBI_ARCH={gurobi_arch}' - else: - bash_instruction += command + bash_instruction = f'export {command}' elif docker_command.startswith('WORKDIR'): directory = docker_command.split('WORKDIR')[1].strip() if directory != '/home/sage/tii-claasp': diff --git a/docker/Dockerfile b/docker/Dockerfile index 5cebca31..ef9efc13 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,6 @@ FROM ubuntu:22.04 AS claasp-base ARG DEBIAN_FRONTEND=noninteractive -ARG GUROBI_ARCH=linux64 ARG COPY_CLAASP_LIBRARY=false ARG INSTALL_CLAASP_LIBRARY=false @@ -30,11 +29,11 @@ COPY docker/sitecustomize.py /usr/lib/python3.10/sitecustomize.py WORKDIR /opt -RUN wget https://packages.gurobi.com/10.0/gurobi10.0.0_${GUROBI_ARCH}.tar.gz \ - && tar -xf gurobi10.0.0_${GUROBI_ARCH}.tar.gz \ - && rm gurobi10.0.0_${GUROBI_ARCH}.tar.gz +RUN wget https://packages.gurobi.com/10.0/gurobi10.0.0_linux64.tar.gz \ + && tar -xf gurobi10.0.0_linux64.tar.gz \ + && rm gurobi10.0.0_linux64.tar.gz -ENV GUROBI_HOME="/opt/gurobi1000/${GUROBI_ARCH}" +ENV GUROBI_HOME="/opt/gurobi1000/linux64" ENV PATH="${PATH}:${GUROBI_HOME}/bin" ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib" diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index c1787e23..d0e875f4 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -50,9 +50,7 @@ To install the dependencies manually, you can do it through make command or exec root directory of the project. #### Make command -You need to have `make` installed for this execution. -- For m1 macs, run ```make local-installation-m1``` -- For other machines, run ```make local-installation``` +You need to have `make` installed for this execution. Run ```make local-installation``` #### Script execution - For m1 macs, run ```./configure.sh armlinux64```