+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*|-h*omp)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -6234,6 +6234,21 @@ func_mode_link ()
esac
# This is a shared library
+ # Cray's compiler drivers need a -dynamic flag if any linked
+ # library is a shared library. Ensure it gets this flag.
+ case `$CC -V 2>&1 | sed 5q` in
+ *Cray*)
+ case " $compile_command " in
+ *" -dynamic ") ;;
+ *) func_append compile_command " -dynamic" ;;
+ esac
+ case " $finalize_command " in
+ *" -dynamic ") ;;
+ *) func_append finalize_command " -dynamic" ;;
+ esac
+ ;;
+ esac
+
# Warn about portability, can't link against -module's on some
# systems (darwin). Don't bleat about dlopened modules though!
dlopenmodule=
@@ -8311,7 +8326,24 @@ EOF
finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^
$]*\).ltframework% -framework \1%g'`
;;
esac
-
+ if test -n "$dlfiles" ||
+ test "$dlself" = "yes" ||
+ test "$export_dynamic" = "yes"; then
+ # Cray's compiler drivers need a -dynamic flag if the program
+ # is going to be dlopening itself or any libraries.
+ case `$CC -V 2>&1 | sed 5q` in
+ *Cray*)
+ case " $compile_command " in
+ *" -dynamic ") ;;
+ *) func_append compile_command " -dynamic" ;;
+ esac
+ case " $finalize_command " in
+ *" -dynamic ") ;;
+ *) func_append finalize_command " -dynamic" ;;
+ esac
+ ;;
+ esac
+ fi
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a3bc337..5467b5d 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1530,7 +1530,9 @@ _LT_DECL([], [archiver_list_spec], [1],
m4_defun([_LT_CMD_OLD_ARCHIVE],
[_LT_PROG_AR
-AC_CHECK_TOOL(STRIP, strip, :)
+# Cray's compiler drivers need STRIP to be an absolute file name when
+# static linking.
+AC_PATH_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
@@ -4407,6 +4409,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
+ *Cray\ C*)
+ # Cray C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-hpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
esac
;;
esac
@@ -4764,6 +4772,11 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
+ *Cray\ Fortran* | *Cray\ C*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-hpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
esac
;;
esac
@@ -5247,6 +5260,14 @@ _LT_EOF
fi
;;
esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Cray\ C* | *Cray\ Fortran*) # Cray C/C++/Fortran
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in
$convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\";
done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(archive_cmds, $1)='save_STRIP=$STRIP; unset STRIP; $CC
-shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o
$lib; ret=\$?; STRIP=\$save_STRIP; export STRIP; (exit \$ret)'
+ ;;
+ esac
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -5792,6 +5813,16 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs
$deplibs $compiler_flags'
;;
esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Cray\ C* | *Cray\ Fortran*) # Cray C/C++/Fortran
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in
$convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\";
done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='save_STRIP=$STRIP; unset STRIP; $CC -shared
$pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib;
ret=\$?; STRIP=\$save_STRIP; export STRIP; (exit \$ret)'
+ ;;
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
;;
netbsd*)
@@ -7064,6 +7095,21 @@ if test yes != "$_lt_caught_CXX_error"; then
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
;;
+ *Cray\ C*) # Cray C++ compiler
+ # If STRIP is set while creating a shared library with
+ # the Cray compiler, the library has its symbols
+ # removed. So we unset and restore it.
+ _LT_TAGVAR(archive_cmds, $1)='save_STRIP=$STRIP; unset STRIP; $CC
-shared $wl-soname $wl$soname -o $lib $predep_objects $libobjs $deplibs
$postdep_objects $compiler_flags; ret=\$?; STRIP=\$save_STRIP; export STRIP;
(exit \$ret)'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-vv $wl--whole-archive`new_convenience=; for conv in
$convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\";
done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+ ;;
esac
;;
esac
-- 2.0.0
Thank you,
Eric Bavier, Scientific Libraries, Cray Inc.