Docker Community Forums

Share and learn in the Docker community.

How to fix configure error when building a Git repo using docker-compose

I’m trying to build OpenModelica from Git using docker-compose. I’ve downloaded all the dependencies that OpenModelica has listed here. Now I’m using their build instructions as a RUN statement, and getting an error when I launch /.configure. The full sequence of commands to execute is

> autoconf
> ./configure CC=clang CXX=clang++
> make -j8
> build/bin/omc --version
> (cd testsuite/partest && ./runtests.pl)

I’ve tried dropping the clang options from the ./configure step, but that didn’t resolve the error.

My Docker file and supporting files are:

Dockerfile

FROM python:3.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY pips.txt /code/
COPY gets.txt /code/
RUN pip install -r pips.txt \
    && apt-get update \
    && xargs -a gets.txt apt-get -y install \
    && apt update \
    && apt install -y openscenegraph-3.4

COPY OpenModelica /code/OpenModelica
RUN cd /code/OpenModelica \
    && autoconf \
    && autoreconf -i
RUN cd /code/OpenModelica \
    && ./configure CC=clang-3.8 CXX=clang++-3.8
RUN make -j8 \
    && build/bin/omc --version \
    && (cd testsuite/partest && ./runtests.pl)

COPY . /code/

pips.txt

Django==2.2
psycopg2==2.8.2

gets.txt

...
clang-3.8
clang++-3.8
...

I’m getting these error messages when I launch docker-compose build

ln: failed to create symbolic link '.git/hooks/pre-commit': File exists

which I don’t think is a fatal error, then the code continues to execute for a few lines, then

configure: error: no

The full error message in context is

Step 10/12 : RUN cd /code/OpenModelica  && ./configure CC=clang-3.8 CXX=clang++-3.8
 ---> Running in 9da205a757d3
checking for gcc... clang-3.8
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang-3.8 accepts -g... yes
checking for clang-3.8 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++-3.8 accepts -g... yes
checking how to run the C preprocessor... clang-3.8 -E
configure: OpenModelica pre-commit hook has been installed
ln: failed to create symbolic link '.git/hooks/pre-commit': File exists
configure: OpenModelica commit-msg hook has been installed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
build_short: x86_64-linux-gnu
host_short: x86_64-linux-gnu
checking if cppruntime is requested... no
checking for omlibrary target... core
checking for libraries directory... configure: error: no

I haven’t been able to find any useful info on the error since it’s so vague. I’m new to Docker, so I’m not sure if it’s a Docker thing or something specific to OpenModelica.