Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] Replacing poll()
From: Alex Margolin (alex.margolin_at_[hidden])
Date: 2012-03-02 06:26:44


Hi,

I'm trying to replace the poll() function with mine (say poll2() in
poll2.c), and I got some building errors.
This is after I copied poll2.c into opal/events/ and added it in the
sources list in Makefile.am in that folder.

...
Making all in tools/wrappers
make[2]: Entering directory
`/home/alex/huji/openmpi-1.4.4/opal/tools/wrappers'
depbase=`echo opal_wrapper.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc "-DEXEEXT=\"\"" -I. -I../../../opal/include -I../../../orte/include
-I../../../ompi/include
-I../../../opal/mca/paffinity/linux/plpa/src/libplpa -I../../.. -O3
-DNDEBUG -m64 -finline-functions -fno-strict-aliasing -pthread
-fvisibility=hidden -MT opal_wrapper.o -MD -MP -MF $depbase.Tpo -c -o
opal_wrapper.o opal_wrapper.c &&\
mv -f $depbase.Tpo $depbase.Po
opal_wrapper.c: In function ‘main’:
opal_wrapper.c:733:21: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c: In function ‘data_init’:
opal_wrapper.c:375:13: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c: In function ‘data_callback’:
opal_wrapper.c:333:25: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c:358:21: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c: In function ‘add_extra_includes’:
opal_wrapper.c:233:17: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c: In function ‘load_env_data’:
opal_wrapper.c:429:13: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c:432:17: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c: In function ‘load_env_data_argv’:
opal_wrapper.c:453:13: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
opal_wrapper.c:456:17: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
/bin/bash ../../../libtool --tag=CC --mode=link gcc -O3 -DNDEBUG -m64
-finline-functions -fno-strict-aliasing -pthread -fvisibility=hidden
-export-dynamic -o opal_wrapper opal_wrapper.o
../../../opal/libopen-pal.la -lnsl -lutil -lm
libtool: link: gcc -O3 -DNDEBUG -m64 -finline-functions
-fno-strict-aliasing -pthread -fvisibility=hidden -o .libs/opal_wrapper
opal_wrapper.o -Wl,--export-dynamic ../../../opal/.libs/libopen-pal.so
-ldl -lnsl -lutil -lm -pthread -Wl,-rpath -Wl,/home/alex/huji/ompi4/lib
../../../opal/.libs/libopen-pal.so: undefined reference to `poll2'
collect2: ld returned 1 exit status
make[2]: *** [opal_wrapper] Error 1
make[2]: Leaving directory
`/home/alex/huji/openmpi-1.4.4/opal/tools/wrappers'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/alex/huji/openmpi-1.4.4/opal'
make: *** [all-recursive] Error 1
alex_at_singularity:~/huji/openmpi-1.4.4$

It seems that I need to add poll2.c to OMPI_LIBEVENT_SOURCES, but I
can't find it anywhere other then Makefile files, which are regenerated...
Am I missing something?

I know trying to replace poll() seems like I'm doing something very
wrong, but I want to poll on events without a valid linux file
descriptor (and existing events, specifically sockets, at the same
time), and I see no other way. Obviously, my poll2 calls the linux poll
in most cases.

Thanks,
Alex