Closed paspro closed 1 year ago
Hello,
Yes, the lines relative to scotch/ptscotch are explicitely excluded in build_aux/cs_link_library.py
(search for "scotch").
This is a quick workaround on Linux to allow linking with a static-onlyn scotch (because scotch 7.0 alllows CMake-based build, but that option does not include shared libraries yet). A cleaner solution would be to test for each detected library whether is is a .a
archive or .so
library (is it the same on Mac) ? That would involve more tests in .am
files, and at some point, rewriting all of this in python would allow better code factorization, but might be a significant project.
A solution here would simply be to replace:
for o in other:
if o in ("-lptscotch", "-lscotch"):
continue
if o[:2] == '-R':
cmd += ["-Wl,-rpath", "-Wl,"+o[2:]]
else:
cmd.append(o)
With:
exclude_list = ("-lptscotch", "-lscotch")
import platform
if platform.system() == 'Darwin':
exclude_list = []
for o in other:
if o in exclude_list:
continue
if o[:2] == '-R':
cmd += ["-Wl,-rpath", "-Wl,"+o[2:]]
else:
cmd.append(o)
Can you try that ?
This problem is not on macOS but on Ubuntu 22.0.4 and Debian 11.
Sorry, I confused this with the other bug report.
In this case, we'll need more advanced tests, but this is not the priority in the coming weeks.
I'm not surprised that the linker on Ubuntu is picky (it always seems to have strict + stupid settings, since this issue has never been solved: https://bugs.launchpad.net/ubuntu/+source/code-saturne/+bug/1672585.
I'm more surprised on Debian 11, since I don't think I have the issue on Arch Linux (I'll test again). I'll have access to a Scibian-11 based system soon, so I can try that.
In the meantime, I woulnd't expect that you will have much of a performance difference not using PT-Scotch at all and using the built-in partitioner instead, which will work around this issue (PT-Scotch becomes really interesting at higher node and core counts).
An alternative approach might be to add --warn-unresolved-symbols
to the linker flags.
An alternative approach might be to add
--warn-unresolved-symbols
to the linker flags.
I tried this option but had no results.
Now that PT-Scotch 7.0.3 has better CMake build options, we use an empty "exclude_list" by default, so the issue should be solved (assuming your build of PT-Scotch uses shared libraries).
Commits ea3d91f3 on master, 4482f38b on v8.0, 01f8711b on v7.3.
When trying to build code_saturne 7.3 on either ubuntu 22.0.4 or Debian 11 using the install_saturne.py script the process fails with a linker error which indicates that the scotch library is not specified for linking. Note that the third-party libraries HDF5, CGNS, MED and Scotch are downloaded, compiled and installed by this script without any errors.
The setup file used is the following:
The error message is the following:
Note that the line:
does not contain the required
-lscotch -lptscotch
command line options.