From 04c45742f63dac8fc9224de9d2b91897afd16948 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Wed, 16 Oct 2024 10:47:32 +0200 Subject: [PATCH 01/11] Enable support for OpenMP on x64_64 --- containers/buildUbuntuDevel.docker/Dockerfile.x86-64 | 9 ++++++++- helper.linux.fish | 2 +- scripts/buildArangoDB312.fish | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 index 57f2be3af..c7be08a08 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 @@ -48,7 +48,14 @@ RUN apt-get update --fix-missing && \ ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update --fix-missing && apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev libclang-rt-${CLANG_VERSION}-dev nodejs npm && apt-get clean +RUN apt-get update --fix-missing && \ + apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} \ + cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish \ + psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \ + liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \ + libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \ + libclang-rt-${CLANG_VERSION}-dev nodejs npm liblapack-dev \ + && apt-get clean # yarn for UI build: RUN npm install -g yarn diff --git a/helper.linux.fish b/helper.linux.fish index d073c7a2f..681d922aa 100755 --- a/helper.linux.fish +++ b/helper.linux.fish @@ -22,7 +22,7 @@ else end set -gx UBUNTUBUILDIMAGE_312_NAME arangodb/ubuntubuildarangodb-devel -set -gx UBUNTUBUILDIMAGE_312_TAG 7 +set -gx UBUNTUBUILDIMAGE_312_TAG 8 set -gx UBUNTUBUILDIMAGE_312 $UBUNTUBUILDIMAGE_312_NAME:$UBUNTUBUILDIMAGE_312_TAG-$UBUNTUBUILDIMAGE_TAG_ARCH set -gx UBUNTUBUILDIMAGE_311_NAME $UBUNTUBUILDIMAGE_312_NAME diff --git a/scripts/buildArangoDB312.fish b/scripts/buildArangoDB312.fish index b516ac804..cef69ce2d 100755 --- a/scripts/buildArangoDB312.fish +++ b/scripts/buildArangoDB312.fish @@ -53,7 +53,8 @@ set -g FULLARGS $argv \ -DOPENSSL_ROOT_DIR=/opt \ -DUSE_STRICT_OPENSSL_VERSION=$USE_STRICT_OPENSSL \ -DBUILD_REPO_INFO=$BUILD_REPO_INFO \ - -DARANGODB_BUILD_DATE="$ARANGODB_BUILD_DATE" + -DARANGODB_BUILD_DATE="$ARANGODB_BUILD_DATE" \ + -DLAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu/" if test "$MAINTAINER" = "On" set -g FULLARGS $FULLARGS \ From aad493396d578a642960d841ba8afe8124778907 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Wed, 16 Oct 2024 11:01:48 +0200 Subject: [PATCH 02/11] Add OpenMP to arm --- containers/buildUbuntuDevel.docker/Dockerfile.arm64 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 index 8d7500c30..17bbbad0d 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 @@ -48,7 +48,14 @@ RUN apt-get update --fix-missing && \ ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update --fix-missing && apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev libclang-rt-${CLANG_VERSION}-dev nodejs npm && apt-get clean +RUN apt-get update --fix-missing && \ + apt-get install -y build-essential gcc-${COMPILER_VERSION} g++-${COMPILER_VERSION} \ + cmake make bison flex python3 ccache git libjemalloc-dev vim exuberant-ctags gdb fish \ + psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \ + liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \ + libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \ + libclang-rt-${CLANG_VERSION}-dev nodejs npm liblapack-dev \ + && apt-get clean # yarn for UI build: RUN npm install -g yarn From 16d65d140e321c9a2a2d7be69b0511a03266dae1 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Fri, 18 Oct 2024 13:28:29 +0200 Subject: [PATCH 03/11] Update Dockerfile x86_64 --- .../buildUbuntuDevel.docker/Dockerfile.x86-64 | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 index c7be08a08..b93b8ceed 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 @@ -1,5 +1,9 @@ -# First rebuild glibc with a special option and provide some .deb files: +# Arguments used through multiple build stages +ARG COMPILER_VERSION=13 +ARG CLANG_VERSION=16 +ARG CLANG_FULL_VERSION=16.0.6 +# First rebuild glibc with a special option and provide some .deb files: FROM ubuntu:24.04 as glibcdebs COPY ./static /static @@ -28,6 +32,49 @@ RUN dpkg -i /debs/*.deb #COPY ./tools/install_v8.sh /tools/install_v8.sh #RUN /tools/install_v8.sh +# Build OpenMP static library +FROM ubuntu:24.04 as openmp + +ARG COMPILER_VERSION +ARG CLANG_VERSION +ARG CLANG_FULL_VERSION + +RUN apt-get update --fix-missing && \ + apt-get upgrade -y && \ + apt-get install -y software-properties-common net-tools wget + +WORKDIR / + +COPY static/ubuntu.sources ./ + +RUN cat ubuntu.sources >> /etc/apt/sources.list.d/ubuntu.sources + +RUN apt-get update && apt-get install dpkg-dev -y + +RUN apt-get source llvm-${CLANG_VERSION}-dev -y && \ + apt-get build-dep llvm-${CLANG_VERSION}-dev -y + +RUN apt-get update --fix-missing && apt-get install -y \ + clang-$CLANG_VERSION clang++-$CLANG_VERSION \ + cmake lsb-release wget git ninja-build gnupg + +COPY patches/diff_llvm.patch . + +WORKDIR /llvm-toolchain-${CLANG_VERSION}-${CLANG_FULL_VERSION} + +# Patch omp to enable running when it is a static library +RUN git apply /diff_llvm.patch + +WORKDIR build + +RUN cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;openmp" -DCMAKE_C_COMPILER=clang-${CLANG_VERSION} \ + -DCMAKE_CXX_COMPILER=clang++-${CLANG_VERSION} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBOMP_ENABLE_SHARED=OFF \ + -DENABLE_OMPT_TOOLS=OFF -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_LIBOMPTARGET=OFF -DLIBOMP_INSTALL_ALIASES=OFF ../llvm && ninja + +RUN mkdir -p /opt/omp && cp ./lib/libomp.so.5 /opt/omp/libomp.a + + # Finally, build the actual build image based on the above preparation: FROM prepare @@ -35,11 +82,13 @@ FROM prepare MAINTAINER Max Neunhoeffer ARG ARCH="x86_64" +ARG COMPILER_VERSION +ARG CLANG_VERSION # We provide gcc 13.2.0 as well as clang 16.0.6 from Ubunutu 24.04 -ENV COMPILER_VERSION 13 -ENV CLANG_VERSION 16 +ENV COMPILER_VERSION=${COMPILER_VERSION} +ENV CLANG_VERSION=${CLANG_VERSION} RUN apt-get update --fix-missing && \ apt-get install -y software-properties-common net-tools && \ @@ -69,6 +118,9 @@ RUN curl -L https://github.com/mozilla/sccache/releases/download/v0.3.1/sccache- #COPY --from=v8 /opt/v8/include /opt/v8/include #COPY --from=v8 /opt/v8/third_party /opt/v8/third_party +# Fetch libomp +COPY --from=openmp /opt/omp /opt/omp + # Build openssl and openldap libraries in specific versions and with static # libraries, install with prefix /opt: From a007e4d7a8261e96c79ccf0b8279791004a89052 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Fri, 18 Oct 2024 13:28:46 +0200 Subject: [PATCH 04/11] Update CMake command --- scripts/buildArangoDB312.fish | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/buildArangoDB312.fish b/scripts/buildArangoDB312.fish index cef69ce2d..64e61622c 100755 --- a/scripts/buildArangoDB312.fish +++ b/scripts/buildArangoDB312.fish @@ -35,6 +35,10 @@ echo "Using openssl version $OPENSSL_VERSION" if test "$ARCH" = "x86_64" -a (string sub -s 1 -l 1 "$OPENSSLPATH") = "3" set -xg X86_64_SUFFIX "64" + set -xg LAPACK_LIB_PATH "/usr/lib/x86_64-linux-gnu/lapack" +else + # TODO (jbajic) check this path + set -xg LAPACK_LIB_PATH "/usr/lib/aarch64/lapack" end set -l pie "" @@ -54,7 +58,7 @@ set -g FULLARGS $argv \ -DUSE_STRICT_OPENSSL_VERSION=$USE_STRICT_OPENSSL \ -DBUILD_REPO_INFO=$BUILD_REPO_INFO \ -DARANGODB_BUILD_DATE="$ARANGODB_BUILD_DATE" \ - -DLAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu/" + -DLAPACK_LIBRARIES="$LAPACK_LIB_PATH" if test "$MAINTAINER" = "On" set -g FULLARGS $FULLARGS \ @@ -62,7 +66,7 @@ if test "$MAINTAINER" = "On" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" else set -g FULLARGS $FULLARGS \ - -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie $inline -fno-stack-protector -fuse-ld=lld " \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie $inline -fno-stack-protector -fuse-ld=lld -fopenmp=libomp -L/opt/omp" \ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" \ -DUSE_CATCH_TESTS=Off \ -DUSE_GOOGLE_TESTS=Off From c5142dffa1e40313196dfafe35cbfb71a7b0fcd7 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Fri, 18 Oct 2024 13:29:04 +0200 Subject: [PATCH 05/11] Add external files for building --- .../buildUbuntu312.docker | 1 + .../patches/diff_llvm.patch | 86 +++++++++++++++++++ .../static/ubuntu.sources | 15 ++++ 3 files changed, 102 insertions(+) create mode 120000 containers/buildUbuntuDevel.docker/buildUbuntu312.docker create mode 100644 containers/buildUbuntuDevel.docker/patches/diff_llvm.patch create mode 100644 containers/buildUbuntuDevel.docker/static/ubuntu.sources diff --git a/containers/buildUbuntuDevel.docker/buildUbuntu312.docker b/containers/buildUbuntuDevel.docker/buildUbuntu312.docker new file mode 120000 index 000000000..9f6bb91ce --- /dev/null +++ b/containers/buildUbuntuDevel.docker/buildUbuntu312.docker @@ -0,0 +1 @@ +buildUbuntu312.docker/ \ No newline at end of file diff --git a/containers/buildUbuntuDevel.docker/patches/diff_llvm.patch b/containers/buildUbuntuDevel.docker/patches/diff_llvm.patch new file mode 100644 index 000000000..632c2f10c --- /dev/null +++ b/containers/buildUbuntuDevel.docker/patches/diff_llvm.patch @@ -0,0 +1,86 @@ +diff --git a/openmp/runtime/src/ompd-specific.cpp b/openmp/runtime/src/ompd-specific.cpp +index c4018789e..07da27023 100644 +--- a/openmp/runtime/src/ompd-specific.cpp ++++ b/openmp/runtime/src/ompd-specific.cpp +@@ -82,6 +82,7 @@ void ompd_init() { + char *libname = NULL; + + #if KMP_OS_UNIX ++#if 0 + // Find the location of libomp.so thru dladdr and replace the libomp with + // libompd to get the full path of libompd + Dl_info dl_info; +@@ -97,6 +98,7 @@ void ompd_init() { + strncpy(libname, dl_info.dli_fname, lib_path_length); + memcpy(libname + lib_path_length, "/libompd.so\0", 12); + } ++#endif + #endif + + const char *ompd_env_var = getenv("OMP_DEBUG"); +diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp +index 55a936575..a71c1aef3 100644 +--- a/openmp/runtime/src/ompt-general.cpp ++++ b/openmp/runtime/src/ompt-general.cpp +@@ -164,8 +164,7 @@ ompt_start_tool(unsigned int omp_version, const char *runtime_version) { + // runtime library is linked before the tool. Since glibc 2.2 strong symbols + // don't override weak symbols that have been found before unless the user + // sets the environment variable LD_DYNAMIC_WEAK. +- ompt_start_tool_t next_tool = +- (ompt_start_tool_t)dlsym(RTLD_NEXT, "ompt_start_tool"); ++ ompt_start_tool_t next_tool = nullptr; + if (next_tool) { + ret = next_tool(omp_version, runtime_version); + } +@@ -245,14 +244,14 @@ ompt_tool_windows(unsigned int omp_version, const char *runtime_version) { + #endif + + static ompt_start_tool_result_t * +-ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { ++ ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { + ompt_start_tool_result_t *ret = NULL; +- ompt_start_tool_t start_tool = NULL; ++ // ompt_start_tool_t start_tool = NULL; + #if KMP_OS_WINDOWS + // Cannot use colon to describe a list of absolute paths on Windows + const char *sep = ";"; + #else +- const char *sep = ":"; ++ // const char *sep = ":"; + #endif + + OMPT_VERBOSE_INIT_PRINT("----- START LOGGING OF TOOL REGISTRATION -----\n"); +@@ -275,7 +274,7 @@ ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { + OMPT_VERBOSE_INIT_PRINT("----- END LOGGING OF TOOL REGISTRATION -----\n"); + return ret; + } +- ++#if 0 + // Try tool-libraries-var ICV + OMPT_VERBOSE_INIT_CONTINUED_PRINT("Failed.\n"); + const char *tool_libs = getenv("OMP_TOOL_LIBRARIES"); +@@ -348,6 +347,8 @@ ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { + } else { + OMPT_VERBOSE_INIT_PRINT("No OMP_TOOL_LIBRARIES defined.\n"); + } ++#endif ++ return nullptr; + + // usable tool found in tool-libraries + if (ret) { +@@ -355,6 +356,7 @@ ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { + return ret; + } + ++#if 0 + #if KMP_OS_UNIX + { // Non-standard: load archer tool if application is built with TSan + const char *fname = "libarcher.so"; +@@ -383,6 +385,7 @@ ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { + } + } + } ++#endif + #endif + OMPT_VERBOSE_INIT_PRINT("No OMP tool loaded.\n"); + OMPT_VERBOSE_INIT_PRINT("----- END LOGGING OF TOOL REGISTRATION -----\n"); diff --git a/containers/buildUbuntuDevel.docker/static/ubuntu.sources b/containers/buildUbuntuDevel.docker/static/ubuntu.sources new file mode 100644 index 000000000..12e4ee8e0 --- /dev/null +++ b/containers/buildUbuntuDevel.docker/static/ubuntu.sources @@ -0,0 +1,15 @@ + +Types: deb-src +URIs: http://archive.ubuntu.com/ubuntu/ +Suites: noble noble-updates noble-backports +Components: main universe restricted multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +## Ubuntu security updates. Aside from URIs and Suites, +## this should mirror your choices in the previous section. +Types: deb-src +URIs: http://security.ubuntu.com/ubuntu/ +Suites: noble-security +Components: main universe restricted multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + From 1496aace19abd58c41bc3342d1ffd0bd826d8010 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Fri, 18 Oct 2024 13:30:58 +0200 Subject: [PATCH 06/11] Update arm Dockerfile --- .../buildUbuntuDevel.docker/Dockerfile.arm64 | 53 ++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 index 17bbbad0d..2297a0f0f 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 @@ -1,4 +1,7 @@ # First rebuild glibc with a special option and provide some .deb files: +ARG COMPILER_VERSION=13 +ARG CLANG_VERSION=16 +ARG CLANG_FULL_VERSION=16.0.6 FROM ubuntu:24.04 as glibcdebs @@ -30,16 +33,61 @@ RUN dpkg -i /debs/*.deb # Finally, build the actual build image based on the above preparation: +# Build OpenMP static library +FROM ubuntu:24.04 as openmp + +ARG COMPILER_VERSION +ARG CLANG_VERSION +ARG CLANG_FULL_VERSION + +RUN apt-get update --fix-missing && \ + apt-get upgrade -y && \ + apt-get install -y software-properties-common net-tools wget + +WORKDIR / + +COPY static/ubuntu.sources ./ + +RUN cat ubuntu.sources >> /etc/apt/sources.list.d/ubuntu.sources + +RUN apt-get update && apt-get install dpkg-dev -y + +RUN apt-get source llvm-${CLANG_VERSION}-dev -y && \ + apt-get build-dep llvm-${CLANG_VERSION}-dev -y + +RUN apt-get update --fix-missing && apt-get install -y \ + clang-$CLANG_VERSION clang++-$CLANG_VERSION \ + cmake lsb-release wget git ninja-build gnupg + +COPY patches/diff_llvm.patch . + +WORKDIR /llvm-toolchain-${CLANG_VERSION}-${CLANG_FULL_VERSION} + +# Patch omp to enable running when it is a static library +RUN git apply /diff_llvm.patch + +WORKDIR build + +RUN cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;openmp" -DCMAKE_C_COMPILER=clang-${CLANG_VERSION} \ + -DCMAKE_CXX_COMPILER=clang++-${CLANG_VERSION} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBOMP_ENABLE_SHARED=OFF \ + -DENABLE_OMPT_TOOLS=OFF -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_LIBOMPTARGET=OFF -DLIBOMP_INSTALL_ALIASES=OFF ../llvm && ninja + +RUN mkdir -p /opt/omp && cp ./lib/libomp.so.5 /opt/omp/libomp.a + + FROM prepare MAINTAINER Max Neunhoeffer ARG ARCH="aarch64" +ARG COMPILER_VERSION +ARG CLANG_VERSION # We provide gcc 13.2.0 as well as clang 16.0.6 from Ubunutu 24.04 -ENV COMPILER_VERSION 13 -ENV CLANG_VERSION 16 +ENV COMPILER_VERSION=${COMPILER_VERSION} +ENV CLANG_VERSION=${CLANG_VERSION} RUN apt-get update --fix-missing && \ apt-get install -y software-properties-common net-tools && \ @@ -68,6 +116,7 @@ RUN curl -L https://github.com/mozilla/sccache/releases/download/v0.3.1/sccache- #COPY --from=v8 /opt/v8/lib /opt/v8/lib #COPY --from=v8 /opt/v8/include /opt/v8/include #COPY --from=v8 /opt/v8/third_party /opt/v8/third_party +COPY --from=openmp /opt/omp /opt/omp # Build openssl and openldap libraries in specific versions and with static # libraries, install with prefix /opt: From d6c430e31f31c395de6abc6eea0d500f64475a53 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Fri, 18 Oct 2024 13:39:41 +0200 Subject: [PATCH 07/11] Remove redundant file --- containers/buildUbuntuDevel.docker/buildUbuntu312.docker | 1 - 1 file changed, 1 deletion(-) delete mode 120000 containers/buildUbuntuDevel.docker/buildUbuntu312.docker diff --git a/containers/buildUbuntuDevel.docker/buildUbuntu312.docker b/containers/buildUbuntuDevel.docker/buildUbuntu312.docker deleted file mode 120000 index 9f6bb91ce..000000000 --- a/containers/buildUbuntuDevel.docker/buildUbuntu312.docker +++ /dev/null @@ -1 +0,0 @@ -buildUbuntu312.docker/ \ No newline at end of file From 24ac430b9181106411fc64481ef8758a341249f5 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Fri, 18 Oct 2024 15:10:13 +0200 Subject: [PATCH 08/11] Fix for architecture --- containers/buildUbuntuDevel.docker/Dockerfile.arm64 | 2 +- containers/buildUbuntuDevel.docker/Dockerfile.x86-64 | 2 +- scripts/buildArangoDB312.fish | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 index 2297a0f0f..d371c2344 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 @@ -102,7 +102,7 @@ RUN apt-get update --fix-missing && \ psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \ liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \ libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \ - libclang-rt-${CLANG_VERSION}-dev nodejs npm liblapack-dev \ + libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-16-dev liblapack-dev \ && apt-get clean # yarn for UI build: diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 index b93b8ceed..07088a246 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 @@ -103,7 +103,7 @@ RUN apt-get update --fix-missing && \ psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \ liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \ libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \ - libclang-rt-${CLANG_VERSION}-dev nodejs npm liblapack-dev \ + libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-16-dev liblapack-dev \ && apt-get clean # yarn for UI build: diff --git a/scripts/buildArangoDB312.fish b/scripts/buildArangoDB312.fish index 64e61622c..ded8c7cc6 100755 --- a/scripts/buildArangoDB312.fish +++ b/scripts/buildArangoDB312.fish @@ -35,6 +35,9 @@ echo "Using openssl version $OPENSSL_VERSION" if test "$ARCH" = "x86_64" -a (string sub -s 1 -l 1 "$OPENSSLPATH") = "3" set -xg X86_64_SUFFIX "64" +end + +if test "$ARCH" = "x86_64" set -xg LAPACK_LIB_PATH "/usr/lib/x86_64-linux-gnu/lapack" else # TODO (jbajic) check this path From 3fa64d74d2ff8ddaca767fba2f360e2dd0c6d46c Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Mon, 21 Oct 2024 09:57:34 +0200 Subject: [PATCH 09/11] Fix path for arm --- scripts/buildArangoDB312.fish | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/buildArangoDB312.fish b/scripts/buildArangoDB312.fish index ded8c7cc6..9a10abd26 100755 --- a/scripts/buildArangoDB312.fish +++ b/scripts/buildArangoDB312.fish @@ -40,8 +40,7 @@ end if test "$ARCH" = "x86_64" set -xg LAPACK_LIB_PATH "/usr/lib/x86_64-linux-gnu/lapack" else - # TODO (jbajic) check this path - set -xg LAPACK_LIB_PATH "/usr/lib/aarch64/lapack" + set -xg LAPACK_LIB_PATH "/usr/lib/aarch64-linux-gnu/lapack" end set -l pie "" From 5de3b2e6b974fcafc3501a7d24d60014646bfb10 Mon Sep 17 00:00:00 2001 From: Jure Bajic Date: Tue, 22 Oct 2024 09:30:29 +0200 Subject: [PATCH 10/11] Add gfortran as library --- containers/buildUbuntuDevel.docker/Dockerfile.arm64 | 2 +- containers/buildUbuntuDevel.docker/Dockerfile.x86-64 | 2 +- scripts/buildArangoDB312.fish | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 index d371c2344..fa5310160 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.arm64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.arm64 @@ -102,7 +102,7 @@ RUN apt-get update --fix-missing && \ psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \ liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \ libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \ - libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-16-dev liblapack-dev \ + libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-16-dev liblapack-dev gfortran \ && apt-get clean # yarn for UI build: diff --git a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 index 07088a246..3d4294ee7 100644 --- a/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 +++ b/containers/buildUbuntuDevel.docker/Dockerfile.x86-64 @@ -103,7 +103,7 @@ RUN apt-get update --fix-missing && \ psmisc sudo debhelper debconf jq wget libdb-dev curl gnupg2 gcovr prometheus bc tcpdump \ liburing-dev cppcheck clang-${CLANG_VERSION} lldb-${CLANG_VERSION} lld-${CLANG_VERSION} \ libc++-${CLANG_VERSION}-dev libc++abi-${CLANG_VERSION}-dev libclang-common-${CLANG_VERSION}-dev \ - libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-16-dev liblapack-dev \ + libclang-rt-${CLANG_VERSION}-dev nodejs npm libomp-16-dev liblapack-dev gfortran \ && apt-get clean # yarn for UI build: diff --git a/scripts/buildArangoDB312.fish b/scripts/buildArangoDB312.fish index 9a10abd26..544f0a339 100755 --- a/scripts/buildArangoDB312.fish +++ b/scripts/buildArangoDB312.fish @@ -64,7 +64,7 @@ set -g FULLARGS $argv \ if test "$MAINTAINER" = "On" set -g FULLARGS $FULLARGS \ - -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie -fno-stack-protector -fuse-ld=lld" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie -fno-stack-protector -fuse-ld=lld -fopenmp=libomp -L/opt/omp" \ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" else set -g FULLARGS $FULLARGS \ From f1c5e43f976c7389d1b6be67d02a4a67fdb3bc37 Mon Sep 17 00:00:00 2001 From: jbajic Date: Tue, 5 Nov 2024 14:15:30 +0100 Subject: [PATCH 11/11] Fix lapack library path --- scripts/buildArangoDB312.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/buildArangoDB312.fish b/scripts/buildArangoDB312.fish index 544f0a339..faa578042 100755 --- a/scripts/buildArangoDB312.fish +++ b/scripts/buildArangoDB312.fish @@ -38,9 +38,9 @@ if test "$ARCH" = "x86_64" -a (string sub -s 1 -l 1 "$OPENSSLPATH") = "3" end if test "$ARCH" = "x86_64" - set -xg LAPACK_LIB_PATH "/usr/lib/x86_64-linux-gnu/lapack" + set -xg LAPACK_LIB_PATH "/usr/lib/x86_64-linux-gnu/lapack/liblapack.a" else - set -xg LAPACK_LIB_PATH "/usr/lib/aarch64-linux-gnu/lapack" + set -xg LAPACK_LIB_PATH "/usr/lib/aarch64-linux-gnu/lapack/liblapack.a" end set -l pie "" @@ -64,11 +64,11 @@ set -g FULLARGS $argv \ if test "$MAINTAINER" = "On" set -g FULLARGS $FULLARGS \ - -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie -fno-stack-protector -fuse-ld=lld -fopenmp=libomp -L/opt/omp" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie -fno-stack-protector -fuse-ld=lld -fopenmp=libomp -L/opt/omp -llapack -lgfortran" \ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" else set -g FULLARGS $FULLARGS \ - -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie $inline -fno-stack-protector -fuse-ld=lld -fopenmp=libomp -L/opt/omp" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--build-id=sha1 $pie $inline -fno-stack-protector -fuse-ld=lld -fopenmp=libomp -L/opt/omp -llapack -lgfortran" \ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" \ -DUSE_CATCH_TESTS=Off \ -DUSE_GOOGLE_TESTS=Off