Bug#1153700: scotch: restore internal _SCOTCH namespace in packaged CMake builds
Christophe Prud'homme
christophe.prudhomme at cemosis.fr
Wed Nov 11 06:18:44 GMT 2026
Source: scotch
Version: 7.0.18-2
Severity: normal
Tags: patch
Dear Maintainer,
The packaged CMake builds drop the upstream internal _SCOTCH symbol namespace.
I encountered the problem on Ubuntu 26.04 (Resolute), using the inherited
7.0.11-1ubuntu1 packaging, and verified that it also affects Debian's current
7.0.18-2 source and amd64 binary package from the official Debian archive.
In debian/patches/no_auto_rename.patch, the upstream unconditional
-DSCOTCH_RENAME definition becomes conditional on the CMake SCOTCH_RENAME
variable. However, CMAKE_FLAGS_COMMON in debian/rules does not enable it.
As a result, private routines are exported without upstream's _SCOTCH prefix.
For example, inspecting Debian's libscotch-7.0c 7.0.18-2 amd64 package:
apt download libscotch-7.0c=7.0.18-2
dpkg-deb -x libscotch-7.0c_7.0.18-2_amd64.deb /tmp/scotch-symbol-check
nm -D --defined-only \
/tmp/scotch-symbol-check/usr/lib/x86_64-linux-gnu/libscotch.so.7.0.18 \
| awk '{print $3}' | grep -E '^(_SCOTCH)?intSort2asc1$'
Observed:
intSort2asc1
With upstream's internal namespace enabled, the symbol is:
_SCOTCHintSort2asc1
One observed downstream symptom was MMG failing to link with USE_SCOTCH=ON:
undefined reference to '_SCOTCHintSort2asc1'
MMG is independently replacing this private sorter dependency with local
qsort; that fix remains appropriate. This report concerns the packaging's
change to upstream internal namespacing, rather than requesting a stable
private ABI.
Related upstream discussion and MMG fix:
https://github.com/MmgTools/mmg/issues/328
https://github.com/MmgTools/mmg/pull/329
The attached patch against Debian 7.0.18-2:
* enables -DSCOTCH_RENAME=ON in CMAKE_FLAGS_COMMON;
* adds -DSCOTCH_RENAME when compiling the installed-library tests, because
those tests include Scotch's private headers.
It leaves SCOTCH_RENAME_ALL, library names, and the public API suffix policy
unchanged. The patch applies cleanly to the current Debian packaging.
Validation of the equivalent change on Ubuntu's 7.0.11-1ubuntu1 source:
* dpkg-buildpackage --build=binary -us -uc -j8 succeeded, building 28 packages;
* all 477 build-time tests passed across the three integer variants;
* all 747 installed-library tests passed across six test scripts;
* _SCOTCHintSort2asc1 is present, and intSort2asc1 absent, in all three
rebuilt libscotch variants;
* the public SCOTCH_* export sets are unchanged for all three libscotch
and libptscotch variants (174 and 70 symbols respectively).
The attached validation-results.txt describes that Ubuntu build environment
and its limits. I have inspected Debian's 7.0.18-2 source and binary, but have
not rebuilt or run the full test suite for that version on Debian.
Thank you,
Christophe Prud'homme
-------------- next part --------------
--- a/debian/rules
+++ b/debian/rules
@@ -21,6 +21,7 @@
DEB_SRCDIR = $(CURDIR)/src
CMAKE_FLAGS_COMMON = -DBUILD_SHARED_LIBS=ON \
+ -DSCOTCH_RENAME=ON \
-DUSE_ZLIB=ON \
-DUSE_BZ2=ON \
-DUSE_LZMA=ON \
--- a/debian/tests/test-scotch
+++ b/debian/tests/test-scotch
@@ -10,7 +10,8 @@
DEB_HOST_ARCH_BITS=$(dpkg-architecture -qDEB_HOST_ARCH_BITS)
DEB_BUILD_ARCH_OS=$(dpkg-architecture -qDEB_BUILD_ARCH_OS)
-PTHREAD_CFLAGS="-DCOMMON_PTHREAD"
+# Tests using private headers must match the libraries' internal symbol names.
+PTHREAD_CFLAGS="-DCOMMON_PTHREAD -DSCOTCH_RENAME"
if [ "${DEB_BUILD_ARCH_OS}" = "linux" ]; then
PTHREAD_CFLAGS="${PTHREAD_CFLAGS} -DSCOTCH_PTHREAD_AFFINITY_LINUX"
fi
-------------- next part --------------
Scotch internal symbol namespacing: Ubuntu packaging validation
Date: 2026-11-11
Source: scotch 7.0.11-1ubuntu1 from the official Ubuntu archive
Candidate source version: 7.0.11-1ubuntu1.1
Environment: Ubuntu 26.04 (Resolute), amd64
Container image: ghcr.io/feelpp/feelpp-env:ubuntu-26.04
Compiler: GCC 15.2.0; CMake: 4.2.3
Source preparation
------------------
The original tarball and Debian packaging tarball were checked against the
sizes and SHA256 hashes in the official source .dsc before extraction.
The Ubuntu source patches were applied by dpkg-source.
Packaging changes
-----------------
1. debian/rules: add -DSCOTCH_RENAME=ON to CMAKE_FLAGS_COMMON.
2. debian/tests/test-scotch: add -DSCOTCH_RENAME to the compilation flags for
tests that use the libraries' private headers. All six test entry points
use this shared script.
3. debian/changelog: document the candidate change.
SCOTCH_RENAME_ALL and the integer-variant public API suffix policy were left
unchanged. There are no upstream source changes.
Binary package build
--------------------
Command: dpkg-buildpackage --build=binary -us -uc -j8
Result: exit 0; all 28 binary .deb packages built, plus debug packages.
Configuration Build-time tests
default 159/159 passed
64-bit indexes (_64) 159/159 passed
64-bit integers (_64i) 159/159 passed
Total 477/477 passed
Installed-library tests
-----------------------
The rebuilt runtime, development, and executable packages were installed in
the same Ubuntu container. libscotchmetis-dev was excluded from installation
because the image already has conflicting libmetis-dev installed; its package
was built successfully. All six installed-library scripts were run directly
from debian/tests with NPROC=8 and MAKEFLAGS=-j8.
Script Result
test-scotch 110/110 passed
test-scotch-64 110/110 passed
test-scotch-64i 110/110 passed
test-ptscotch 139/139 passed
test-ptscotch-64 139/139 passed
test-ptscotch-64i 139/139 passed
Total 747/747 passed
Symbol checks
-------------
nm -D --defined-only was run against the installed rebuilt shared libraries.
For libscotch.so, libscotch_64.so, and libscotch_64i.so:
_SCOTCHintSort2asc1 is exported;
intSort2asc1 is not exported.
The public SCOTCH_* exported symbol sets were compared with the original
Ubuntu libraries captured before installing the candidate packages:
libscotch.so, libscotch_64.so, libscotch_64i.so:
all 174 public symbols unchanged in each variant.
libptscotch.so, libptscotch_64.so, libptscotch_64i.so:
all 70 public symbols unchanged in each variant.
Scope
-----
Validation covers amd64, all three packaged integer variants, sequential and
parallel library tests. Other architectures were not tested. The installed
test scripts were executed directly, rather than through an autopkgtest
runner in a newly provisioned testbed.
More information about the debian-science-maintainers
mailing list