Re: PIC flags not found for mpif77(ifort)

2010-12-15 Thread Christian Rössel
Hi Ralf,

Am 12/10/2010 6:55 PM, schrieb Ralf Wildenhues:
 Hello Christian,
 
 * Christian Rössel wrote on Fri, Dec 10, 2010 at 02:56:51PM CET:
 ./configure --enable-shared F77=mpif77 ...

 where mpif77 translates to

 ifort -I/opt/parastation/mpi2-intel/include
 -L/opt/parastation/mpi2-intel/lib -Wl,-rpath
 -Wl,/opt/parastation/mpi2-intel/lib -lmpich -lpthread
 -L/opt/parastation/lib64 -Wl,-rpath,/opt/parastation/lib64
 -Wl,--enable-new-dtags -lpscom -lrt

 configure fails in finding PIC flags (mpicc (icc) and mpicxx (icpc) PIC
 flags are discovered though):

 configure:17627: checking for mpif77 option to produce PIC
 configure:17899: result:

 There is no more output concerning the PIC flags in config.log.
 With F77=ifort everything works as expected:

 configure:16805: checking for ifort option to produce PIC
 configure:17077: result: -fPIC
 
 Yeah, that's because libtool.m4 macros partly match by name, unless the
 compiler claims to be GCC.  A bit dumb, sure, but it's not easy to avoid
 because portable testing of these flags is not trivial.  We might have
 to think about a more general way to extract the compiler name from an
 MPI driver (-show and -showme come to mind).
 
 For the moment you should be able to work around it using
   configure lt_cv_prog_compiler_pic_F77=-fPIC \
 lt_cv_prog_compiler_pic_FC=-fPIC \
 
 but I'm not sure if you also need fixes for missing -static and -Wl,
 flags (lt_prog_compiler_wl_F77 and lt_prog_compiler_static_F77 ...).
 This requires Libtool = 2.4.

I upgraded to 2.4. but this leads to another error. I will investigate this.

 Alternatively, the untested patch below should help as well.  Can you
 try it out?

Unfortunately the patch didn't work. configure does not execute the new
case branch although the innermost condition matches.

BTW, the same problem occurs for mpif77 and mpif90 using the PGI
compilers. Called with -V they produce:

pgf90 10.9-0 64-bit target on x86-64 Linux -tp core2-64
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2010, STMicroelectronics, Inc. All Rights Reserved.

Thanks,
Christian

 Thanks for the report,
 Ralf
 
 Fix PIC flags with mpif77 using ifort on GNU/Linux.
 
 * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC) [linux]:
 Match Intel compiler also using $CC -V output, to avoid false
 negatives with compiler drivers like mpif77.
 Report by Christian Rössel.
 
 diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
 index 1f61140..e735c75 100644
 --- a/libltdl/m4/libtool.m4
 +++ b/libltdl/m4/libtool.m4
 @@ -4338,6 +4338,11 @@ m4_if([$1], [CXX], [
 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 ;;
 +*Intel*\ [CF]*Compiler*)
 +   _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 +   _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 +   _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 +   ;;
   esac
   ;;
esac



Re: PIC flags not found for mpif77(ifort)

2010-12-15 Thread Ralf Wildenhues
* Christian Rössel wrote on Wed, Dec 15, 2010 at 04:38:13PM CET:
 Am 12/10/2010 6:55 PM, schrieb Ralf Wildenhues:
  Alternatively, the untested patch below should help as well.  Can you
  try it out?
 
 Unfortunately the patch didn't work. configure does not execute the new
 case branch although the innermost condition matches.

Hmm.  Is $GCC = yes for this compiler?  That would be surprising.
Why else would the new branch not be matched?

 BTW, the same problem occurs for mpif77 and mpif90 using the PGI
 compilers. Called with -V they produce:
 
 pgf90 10.9-0 64-bit target on x86-64 Linux -tp core2-64
 Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
 Copyright 2000-2010, STMicroelectronics, Inc. All Rights Reserved.

I suppose that could be fixed with the diff below on top
(pending the fix for the issue above).

Thanks,
Ralf

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index e735c75..7323986 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4343,6 +4343,11 @@ m4_if([$1], [CXX], [
  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  ;;
+   *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
esac
;;
   esac



Re: Enhanced OS/2 port

2010-12-15 Thread Ralf Wildenhues
[ adding libtool-patches@; followups can remove libtool@ ]

* KO Myung-Hun wrote on Sun, Nov 28, 2010 at 07:20:32AM CET:
 I've enhanced and fixed libtool 2.4 for OS/2.

Thanks again for working on this.

Generally, we prefer one patch per logical change, and GNU-style
ChangeLog entries.  Also, we should strive to expose bugs in the
testsuite, so that we don't regress.

I understand that just producing a patch at all can be hard work,
so we can help with things (just that takes time ...)
One thing is quite helpful though, and that's how well our testsuite
fares on your system (both without and with the patch).

Also, for nontrivial changes, the FSF needs copyright papers
(more on this off-list).

That said, let's try to get the easier things out of the way:

 --- Makefile.am.org   2010-09-21 16:07:22.0 +0900
 +++ Makefile.am   2010-11-27 00:19:56.0 +0900
 @@ -324,7 +324,7 @@
  dist_man1_MANS   = $(srcdir)/doc/libtool.1 
 $(srcdir)/doc/libtoolize.1
  MAINTAINERCLEANFILES += $(dist_man1_MANS)
  update_mans = \
 -  PATH=.$(PATH_SEPARATOR)$$PATH; export PATH; \
 +  PATH=.$(PATH_SEPARATOR)$$PATH; export PATH; \

Good change.

$(HELP2MAN) --output=$@
  $(srcdir)/doc/libtool.1: $(srcdir)/$(auxdir)/ltmain.sh
   $(update_mans) --help-option=--help-all libtool

 --- libltdl/config/general.m4sh.org   2010-09-01 15:02:44.0 +0900
 +++ libltdl/config/general.m4sh   2010-11-27 12:15:52.0 +0900
 @@ -296,10 +296,13 @@
   ;;
*)
   save_IFS=$IFS
 - IFS=:
 - for progdir in $PATH; do
 -   IFS=$save_IFS
 -   test -x $progdir/$progname  break
 + for pathsep in : ;; do
 +   IFS=$pathsep
 +   for progdir in $PATH$pathsep; do
 +  IFS=$save_IFS
 +  test -x $progdir/$progname  break
 +   done
 +   test -n $progdir  break
   done
   IFS=$save_IFS
   test -n $progdir || progdir=`pwd`

I don't particularly like guessing here.  Rather, let's store the
configure-computed PATH_SEPARATOR in the generated libtool script
(libtoolize already sets it anyway) and use that.

I'm applying the following patch in your name, and adding you to THANKS:


2010-12-15  KO Myung-Hun k...@chollian.net  (tiny change)
Ralf Wildenhues  ralf.wildenh...@gmx.de

Fix PATH_SEPARATOR handling for OS/2.
* Makefile.am (update_mans): Quote $(PATH_SEPARATOR).
* libltdl/m4/libtool.m4 (_LT_SETUP): Add _LT_DECL for
PATH_SEPARATOR.
* libltdl/config/general.m4sh: Use PATH_SEPARATOR when computing
$progpath.
* THANKS: Update.

diff --git a/Makefile.am b/Makefile.am
index 66f38b1..4be353c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -330,7 +330,7 @@ $(srcdir)/doc/notes.txt: $(srcdir)/doc/notes.texi
 dist_man1_MANS = $(srcdir)/doc/libtool.1 $(srcdir)/doc/libtoolize.1
 MAINTAINERCLEANFILES   += $(dist_man1_MANS)
 update_mans = \
-  PATH=.$(PATH_SEPARATOR)$$PATH; export PATH; \
+  PATH=.$(PATH_SEPARATOR)$$PATH; export PATH; \
   $(HELP2MAN) --output=$@
 $(srcdir)/doc/libtool.1: $(srcdir)/$(auxdir)/ltmain.sh
$(update_mans) --help-option=--help-all libtool
diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh
index 44a7ce9..40d5413 100644
--- a/libltdl/config/general.m4sh
+++ b/libltdl/config/general.m4sh
@@ -296,7 +296,7 @@ case $progpath in
  ;;
   *)
  save_IFS=$IFS
- IFS=:
+ IFS=${PATH_SEPARATOR-:}
  for progdir in $PATH; do
IFS=$save_IFS
test -x $progdir/$progname  break
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 1f61140..ab3e16f 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -146,6 +146,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
 
+_LT_DECL([], [PATH_SEPARATOR], [0], [The PATH separator for the build 
system])dnl
+dnl
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl
 _LT_DECL([], [host_os], [0])dnl




 @@ -564,6 +567,10 @@

(in func_show_eval)

  my_cmd=$1
  my_fail_exp=${2-:}
 
 +# pdksh 5.2.14-bin-2 for OS/2 does not remove trailing CR
 +# when a line length is 1022. Maybe 1022 is a magic number ?
 +my_cmd=`$ECHO $my_cmd | $SED s/\r$//`

Ouch.  Where did you hit this?  Can't you fix pdksh instead?
This change unconditionally costs two forks and one exec on almost every
command that libtool issues.  Also, \r is not a portable sed regex.

Does something like this work instead?

   # pdksh 5.2.14-bin-2 for OS/2 does not remove trailing CR
   # when a line length is 1022.
   case $my_cmd in *$'\r')
 my_cmd=`$ECHO $my_cmd | $SED s/\r$//` ;;
   esac

What about this?
   cr=$'\r'
   case $my_cmd in *$cr)
 my_cmd=`$ECHO $my_cmd | $SED s/\r$//` ;;
   esac

Then we still need to factor setting of $cr, but at least it's not quite
so expensive on other systems.

  ${opt_silent-false} || {

Re: Enhanced OS/2 port

2010-12-15 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Wed, Dec 15, 2010 at 10:32:04PM CET:
 --- a/libltdl/m4/libtool.m4
 +++ b/libltdl/m4/libtool.m4
 @@ -146,6 +146,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
  AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
  
 +_LT_DECL([], [PATH_SEPARATOR], [0], [The PATH separator for the build 
 system])dnl
 +dnl
  _LT_DECL([], [host_alias], [0], [The host system])dnl
  _LT_DECL([], [host], [0])dnl
  _LT_DECL([], [host_os], [0])dnl

Sorry about the glitch, but the above doesn't put double-quotes around
the value in the libtool script.  I'm pushing this followup patch to fix
that.

Cheers,
Ralf

* libltdl/m4/libtool.m4 (_LT_SETUP): Fix quoting for PATH_SEPARATOR.

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index ab3e16f..59114b4 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -146,7 +146,7 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
 
-_LT_DECL([], [PATH_SEPARATOR], [0], [The PATH separator for the build 
system])dnl
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build 
system])dnl
 dnl
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl