[m-rev.] diff: Fix a problem with linking to libhwloc in high-level C grades
Paul Bone
paul at bone.id.au
Thu Jun 23 16:36:22 AEST 2016
Fix a problem with linking to libhwloc in high-level C grades
When libhwloc is available it is used by the low level C grades to determine
the number of processors available. I recently added similar support to the
high level C grades, but I neglected to add -lhwloc to the compiler's command
line in these grades. This patch fixes that.
compiler/compile_target_code.m:
Link to libhwloc in all parallel grades.
configure.ac:
Use the correct name for all instances of the same variable.
---
compiler/compile_target_code.m | 27 ++++++++++-----------------
configure.ac | 2 +-
2 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/compiler/compile_target_code.m b/compiler/compile_target_code.m
index a91be6b..ca18fc1 100644
--- a/compiler/compile_target_code.m
+++ b/compiler/compile_target_code.m
@@ -1880,23 +1880,16 @@ link_exe_or_shared_lib(Globals, ErrorStream, LinkTargetType, ModuleName,
UseThreadLibs = yes,
globals.lookup_string_option(Globals, ThreadFlagsOpt, ThreadOpts),
- % Determine which options are needed to link to libhwloc, if libhwloc
- % is used at all.
- globals.lookup_bool_option(Globals, highlevel_code, HighLevelCode),
- (
- HighLevelCode = yes,
- HwlocOpts = ""
- ;
- HighLevelCode = no,
- ( if Linkage = "shared" then
- HwlocFlagsOpt = hwloc_libs
- else if Linkage = "static" then
- HwlocFlagsOpt = hwloc_static_libs
- else
- unexpected($module, $pred, "Invalid linkage")
- ),
- globals.lookup_string_option(Globals, HwlocFlagsOpt, HwlocOpts)
- )
+ % Determine which options are needed to link to libhwloc, if
+ % libhwloc is not used then the string option will be empty.
+ ( if Linkage = "shared" then
+ HwlocFlagsOpt = hwloc_libs
+ else if Linkage = "static" then
+ HwlocFlagsOpt = hwloc_static_libs
+ else
+ unexpected($module, $pred, "Invalid linkage")
+ ),
+ globals.lookup_string_option(Globals, HwlocFlagsOpt, HwlocOpts)
;
UseThreadLibs = no,
ThreadOpts = "",
diff --git a/configure.ac b/configure.ac
index 462827c..d67f890 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5188,7 +5188,7 @@ if test "$with_hwloc" != "no"; then
else
libhwloc_LIBS=""
libhwloc_CFLAGS=""
- libhwloc_static_libs=""
+ hwloc_static_libs=""
fi
HWLOC_LIBS="$libhwloc_LIBS"
--
2.7.4
More information about the reviews
mailing list