On Thu, 2008-03-20 at 09:32 -0400, Adam C Powell IV wrote: > On Thu, 2008-03-20 at 09:31 -0400, Jeff Squyres wrote: > > On Mar 20, 2008, at 9:17 AM, Adam C Powell IV wrote: > > > > >> | https://svn.open-mpi.org/svn/ompi/tmp-public/libatomic-ops > > > > > > Trouble in paradise. I checked this out, but in the libatomic-ops > > > directory, opal/include/opal/sys/atomic.h has: > > > > > > #elif OMPI_ASSEMBLY_ARCH == OMPI_LIBATOMIC_OPS > > > #include "opal/sys/libatomic_ops/atomic.h" > > > > > > But it's not there. opal/include/opal/sys doesn't have the > > > libatomic_ops directory at all. Forgot to check in a directory? > > > > Oops; yes, I missed the "svn add" for this from Brian's patch. It's > > committed now: > > > > https://svn.open-mpi.org/trac/ompi/changeset/17892 > > > > Sorry about that! > > Got it, thanks!
I'm attaching two patches: a new patch 70 (against openmpi 1.2.5) and a
quick patch against debian/ files. With these, the package builds on
amd64 using its default assembler.
However, it does not build when I force it to use libatomic-ops. I'm
building by the following procedure:
* debian/rules patch-stamp
* Remove the section of configure from line 25324 to 25588 (the
architecture "case" statement), forcing the case to go straight
to *) which uses libatomic-ops.
* debian/rules build
This procedure produces a problematic warning then an error, first the
warning (repeated frequently):
In file included from ../opal/include/opal/sys/atomic.h:124,
from ../opal/threads/mutex_unix.h:47,
from ../opal/threads/mutex.h:337,
from threads/mutex.c:21:
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_cmpset_acq_64’:
../opal/include/opal/sys/libatomic_ops/atomic.h:140: warning: pointer targets
in passing argument 1 of ‘AO_compare_and_swap_full’ differ in signedness
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_cmpset_rel_64’:
../opal/include/opal/sys/libatomic_ops/atomic.h:146: warning: pointer targets
in passing argument 1 of ‘AO_compare_and_swap_full’ differ in signedness
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_cmpset_64’:
../opal/include/opal/sys/libatomic_ops/atomic.h:152: warning: pointer targets
in passing argument 1 of ‘AO_compare_and_swap_full’ differ in signedness
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_add_32’:
../opal/include/opal/sys/libatomic_ops/atomic.h:161: warning: pointer targets
in passing argument 1 of ‘AO_int_fetch_and_add_full’ differ in signedness
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_sub_32’:
../opal/include/opal/sys/libatomic_ops/atomic.h:167: warning: pointer targets
in passing argument 1 of ‘AO_int_fetch_and_add_full’ differ in signedness
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_add_64’:
../opal/include/opal/sys/libatomic_ops/atomic.h:176: warning: pointer targets
in passing argument 1 of ‘AO_fetch_and_add_full’ differ in signedness
../opal/include/opal/sys/libatomic_ops/atomic.h: In function
‘opal_atomic_sub_64’:
../opal/include/opal/sys/libatomic_ops/atomic.h:182: warning: pointer targets
in passing argument 1 of ‘AO_fetch_and_add_full’ differ in signedness
In file included from ../opal/include/opal/sys/atomic.h:528,
from ../opal/threads/mutex_unix.h:47,
from ../opal/threads/mutex.h:337,
from threads/mutex.c:21:
../opal/include/opal/sys/atomic_impl.h: In function ‘opal_atomic_trylock’:
../opal/include/opal/sys/atomic_impl.h:346: warning: implicit declaration of
function ‘opal_atomic_cmpset_acq_32’
I don't know how severe the signedness issues will be, but am not too
concerned. The biggest problem is that AO_HAVE_int_compare_and_swap is
not defined (except on ia64 and 32-bit systems), so there is no 32-bit
compare-and-swap operation in libatomic-ops.
The error is related:
libtool: link: gcc -DNDEBUG -Wall -g -O2 -finline-functions
-fno-strict-aliasing -pthread -o .libs/opal_wrapper opal_wrapper.o
-Wl,--export-dynamic ../../../opal/.libs/libopen-pal.so -ldl -lnsl -lutil -lm
-pthread -Wl,-rpath -Wl,/usr/lib/openmpi/lib
../../../opal/.libs/libopen-pal.so: undefined reference to
`opal_atomic_cmpset_acq_32'
collect2: ld returned 1 exit status
make[3]: *** [opal_wrapper] Error 1
make[3]: Leaving directory `/home/hazelsct/openmpi-1.2.5/opal/tools/wrappers'
So the 32-bit compare-and-swap is necessary for this to function. And
there's no automatic method to do it on 64-bit arches in libatomic-ops,
unlike 32-bit arches which have AO_compare_double_and_swap_double* for
64 bits.
I went ahead and filed wishlist bug 471886 against libatomic-ops-dev for
this purpose. Can someone test this on a 32-bit arch? (I don't have a
32-bit system on my 64-bit machine.)
Regards,
-Adam
--
GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6
Engineering consulting with open source tools
http://www.opennovation.com/
--- openmpi-1.2.5/debian/patches/00list~ 2008-03-20 20:57:33.000000000 +0000 +++ openmpi-1.2.5/debian/patches/00list 2008-03-20 20:57:58.000000000 +0000 @@ -1,2 +1,3 @@ 10fix_config_infiniband 60fix_manpage_name_section +70support_libatomic_ops --- openmpi-1.2.5/debian/control~ 2008-03-20 15:31:11.000000000 +0000 +++ openmpi-1.2.5/debian/control 2008-03-20 15:47:29.000000000 +0000 @@ -4,7 +4,7 @@ Homepage: http://www.open-mpi.org/ Maintainer: Debian OpenMPI Maintainers <[EMAIL PROTECTED]> Uploaders: Dirk Eddelbuettel <[EMAIL PROTECTED]>, Manuel Prinz <[EMAIL PROTECTED]> -Build-Depends: debhelper (>= 5.0.0), dpatch, libibverbs-dev (>= 1.1.1) [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], gfortran, gcc (>= 4:4.1.2), chrpath +Build-Depends: debhelper (>= 5.0.0), dpatch, libibverbs-dev (>= 1.1.1) [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libatomic-ops-dev, gfortran, gcc (>= 4:4.1.2), chrpath Standards-Version: 3.7.3 Vcs-Svn: svn://svn.debian.org/svn/pkg-openmpi/openmpi/trunk/ Vcs-Browser: http://svn.debian.org/wsvn/pkg-openmpi/openmpi/trunk/ --- openmpi-1.2.5/debian/rules~ 2008-03-20 20:57:33.000000000 +0000 +++ openmpi-1.2.5/debian/rules 2008-03-20 21:00:27.000000000 +0000 @@ -36,6 +36,7 @@ --sysconfdir=/etc/openmpi \ --libdir=\$${prefix}/lib/openmpi/lib \ --includedir=\$${prefix}/lib/openmpi/include \ + --with-libatomic_ops \ --with-devel-headers # Thread support disabled because it's broken, see bug #435581 # --enable-mpi-threads \
70support_libatomic_ops.dpatch
Description: application/shellscript

