bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
114 stars 24 forks source link

Java wrapper compilation error #76

Closed espositomarco closed 2 years ago

espositomarco commented 2 years ago

OS: Debian "bullseye" Nomad version: 4.2

When building the Java wrapper, following the instructions in interfaces/jNomad/Readme, I get the following error:

[ 93%] Built target jNomad
[ 93%] Linking CXX executable NMOpt.exe
Scanning dependencies of target jNomad_jar
gmake[2]: *** No rule to make target 'interfaces/jNomad/SWIGTYPE_p_NOMAD_4_1__EvalParameters.java', needed by 'interfaces/jNomad/CMakeFiles/jNomad_jar.dir/java_compiled_jNomad_jar'.  Stop.
gmake[1]: *** [CMakeFiles/Makefile2:1366: interfaces/jNomad/CMakeFiles/jNomad_jar.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

and cmake exits with error code 2.

Here is the complete Dockerfile I'm using:


ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    m4 \
    cmake \
    nano \
    curl

WORKDIR /

# First install SWIG
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    autotools-dev \
    automake \
    byacc \
    libpcre2-dev

RUN git clone https://github.com/swig/swig.git

WORKDIR swig
RUN ./autogen.sh
RUN ./configure --prefix=/swig
RUN make
RUN make install

RUN ln -s /swig/bin/swig /usr/local/bin/swig

# Compile and install NOMAD
WORKDIR /

RUN curl https://codeload.github.com/bbopt/nomad/tar.gz/refs/tags/v.4.2.0 --output NOMAD42.tar.gz
RUN tar -xf NOMAD42.tar.gz && mv nomad-v.4.2.0 NOMAD42 && rm -r NOMAD42.tar.gz

ENV NOMAD_HOME="/NOMAD42"
WORKDIR /NOMAD42

RUN cmake -DTEST_OPENMP=OFF -DBUILD_INTERFACE_C=ON -DBUILD_INTERFACE_JAVA=ON  -S . -B build/release && \
    cmake --build build/release --parallel 16 && \
    cmake --install build/release

ENV LD_LIBRARY_PATH="/NOMAD42/build/release/lib"

WORKDIR /
CMD /bin/bash

I was able to build the C and Python interfaces without a problem.

Any help would be greatly appreciated!

ctribes commented 2 years ago

See issue #75