diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9048b69050b24100869e443eb12c626a85e0a79a..44d2b494058013edd3595868ab41197f9db0a268 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,6 +85,7 @@ windows_msvc_ci: .linux_official: &linux_official only: - master@gmsh/gmsh + - fix-mpi-symbols-leak@romin.tomasetti/gmsh <<: *ssh_config script: - mkdir build @@ -92,12 +93,20 @@ windows_msvc_ci: - cmake -DGMSH_HOST=gmsh.info -DENABLE_PETSC=1 -DPETSC_ARCH=real_mumps_seq -DPETSC_DIR=/petsc-3.14.4 ${EXTRA_OPTION} .. - make package -j 8 - PKG=`ls gmsh-*.tar*` - - scp ${PKG} geuzaine@gmsh.info:.wwwgmsh/bin/Linux/${PKG/\.tar\.gz/\.tgz} + # - scp ${PKG} geuzaine@gmsh.info:.wwwgmsh/bin/Linux/${PKG/\.tar\.gz/\.tgz} - ctest -j 8 --output-on-failure tags: - linux64 - docker +.linux_sdk_official: &linux_sdk_official + script: + - !reference [.linux_official, script] + # Ensure libgmsh.so exists, and check that it doesn't expose MPI-related symbols. + # See also https://gitlab.onelab.info/gmsh/gmsh/-/issues/2173. + - test -f libgmsh.so + - if objdump -T libgmsh.so | c++filt | grep "MPI_Init" ;then echo "MPI_Init was found. This should not happen."; exit -1;fi + linux_official_snapshot: image: onelab/debian.stretch.64bit variables: @@ -119,6 +128,7 @@ linux-sdk_official_snapshot: variables: EXTRA_OPTION: "-DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1" <<: *linux_official + <<: *linux_sdk_official except: - tags artifacts: @@ -132,6 +142,7 @@ linux-sdk_official_release: variables: EXTRA_OPTION: "-DGMSH_RELEASE=1 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1" <<: *linux_official + <<: *linux_sdk_official only: - /^gmsh_.*$/ artifacts: diff --git a/utils/docker/Dockerfile.debian.stretch.64bit b/utils/docker/Dockerfile.debian.stretch.64bit index d560a8eaea2382b49f20a3ca05218ab148823bb3..11e8bc60d3f5f8700ed29d0dfc1eb7bde792669a 100644 --- a/utils/docker/Dockerfile.debian.stretch.64bit +++ b/utils/docker/Dockerfile.debian.stretch.64bit @@ -25,6 +25,8 @@ ENV CC=/usr/local/bin/gcc ENV CXX=/usr/local/bin/g++ ENV FC=/usr/local/bin/gfortran +ARG NUM_JOBS=4 + # ----------------------- # OpenBLAS # ----------------------- @@ -71,7 +73,13 @@ ENV PETSC_DIR ${PWD}/petsc-3.14.4 ENV PETSC_ARCH real_mumps_seq # -fvisibility=hidden is important so that PETSc does not leak e.g. MPI symbols when integrated in libgmsh.so -RUN cd ${PETSC_DIR} && ./configure CC=$CC CXX=$CXX FC=$FC CFLAGS="$CFLAGS -fvisibility=hidden" CXXFLAGS="$CXXFLAGS -fvisibility=hidden" FFLAGS=$FFLAGS --with-clanguage=cxx --with-debugging=0 --with-mpi=0 --with-mpiuni-fortran-binding=0 --download-mumps=yes --with-mumps-serial --with-shared-libraries=0 --with-x=0 --with-ssl=0 --with-scalar-type=real --with-blaslapack-lib="/usr/local/lib/libopenblas.a /usr/local/lib64/libgfortran.a /usr/local/lib64/libquadmath.a -lpthread" && make +# Patching MUMPS.py as stated in https://gitlab.onelab.info/gmsh/gmsh/-/issues/2173. +RUN cd ${PETSC_DIR} \ + && awk -v OLD="\+ self.updatePackageCFlags" -v NEW="+ ' -fvisibility=hidden ' + self.updatePackageCFlags" '($0 ~ OLD) {gsub(OLD, NEW); count++}1 ; END{exit (count==1)==0}' "/petsc-3.14.4/config/BuildSystem/config/packages/MUMPS.py" > tmp.py && mv tmp.py "/petsc-3.14.4/config/BuildSystem/config/packages/MUMPS.py" \ + && awk -v OLD="\+self.updatePackageFFlags" -v NEW="+ ' -fvisibility=hidden ' + self.updatePackageFFlags" '($0 ~ OLD) {gsub(OLD, NEW); count++}1 ; END{exit (count==1)==0}' "/petsc-3.14.4/config/BuildSystem/config/packages/MUMPS.py" > tmp.py && mv tmp.py "/petsc-3.14.4/config/BuildSystem/config/packages/MUMPS.py" \ + && ./configure CC=$CC CXX=$CXX FC=$FC CFLAGS="$CFLAGS -fvisibility=hidden" CXXFLAGS="$CXXFLAGS -fvisibility=hidden" FFLAGS=$FFLAGS \ + --with-clanguage=cxx --with-debugging=0 --with-mpi=0 --with-mpiuni-fortran-binding=0 --download-mumps=yes --with-mumps-serial --with-shared-libraries=0 --with-x=0 --with-ssl=0 --with-scalar-type=real --with-blaslapack-lib="/usr/local/lib/libopenblas.a /usr/local/lib64/libgfortran.a /usr/local/lib64/libquadmath.a -lpthread" \ + && make -j${NUM_JOBS} ENV PETSC_ARCH complex_mumps_seq # -fvisibility=hidden is important so that PETSc does not leak e.g. MPI symbols when integrated in libgmsh.so