Skip to content
Snippets Groups Projects
Commit 0df8fbf2 authored by Romin Tomasetti's avatar Romin Tomasetti
Browse files

fix(symbols): removing leaking MPI symbols (see #2173)

parent 165ded1e
No related branches found
No related tags found
No related merge requests found
Pipeline #10223 canceled
......@@ -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:
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment