Build error on OS X 10.4: ld: multiple definitions of symbol _posix_memalign

Hi,

trying to build gnuradio on OS X 10.4, I get

—8<—
Extracting
/Users/alex/Documents/work/nc-projects/gr/gnuradio/gnuradio-core/src/lib/missing/.libs/libmissing.a
(cd .libs/libgnuradio-core-qa.lax/libmissing.a && ar x
/Users/alex/Documents/work/nc-projects/gr/gnuradio/gnuradio-core/src/lib/missing/.libs/libmissing.a)
g++ -dynamiclib -single_module ${wl}-flat_namespace ${wl}-undefined
${wl}suppress -o .libs/libgnuradio-core-qa.0.0.0.dylib
.libs/bug_work_around_6.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_ccomplex_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_complex_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_filter.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_float_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_ccc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_ccf.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_fcc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_fff.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_scc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_rotator.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gri_mmse_fir_interpolator.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gri_mmse_fir_interpolator_cc.o

.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_general.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_circular_file.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_firdes.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt_nco.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt_vco.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_math.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gri_lfsr.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_block.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_buffer.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_flowgraph.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_hier_block2.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_hier_block2_derived.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_io_signature.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_top_block.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_vmcircbuf.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_runtime.o
.libs/libgnuradio-core-qa.lax/libmissing.a/bug_work_around_8.o
.libs/libgnuradio-core-qa.lax/libmissing.a/posix_memalign.o
-L/Users/alex/Documents/work/nc-projects/gr/lib -L/opt/local/lib
./.libs/libgnuradio-core.dylib
/Users/alex/Documents/work/nc-projects/gr/gnuradio/omnithread/.libs/libgromnithread.dylib
/Users/alex/Documents/work/nc-projects/gr/gnuradio/gruel/src/lib/.libs/libgruel.dylib
/opt/local/lib/libfftw3f.dylib /opt/local/lib/libgsl.dylib
/opt/local/lib/libgslcblas.dylib /opt/local/lib/libcppunit.dylib -ldl
-install_name
/Users/alex/Documents/work/nc-projects/gr/lib/libgnuradio-core-qa.0.dylib
-Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
ld: multiple definitions of symbol _posix_memalign
.libs/libgnuradio-core-qa.lax/libmissing.a/posix_memalign.o definition
of _posix_memalign in section (__TEXT,__text)
./.libs/libgnuradio-core.dylib(single module) definition of
_posix_memalign
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libgnuradio-core-qa.la] Error 1
make: *** [all-recursive] Error 1

—8<—
$ svn info
Path: .
URL: http://gnuradio.org/svn/gnuradio/trunk
Repository Root: http://gnuradio.org/svn
Repository UUID: 221aa14e-8319-0410-a670-987f0aec2ac5
Revision: 11082
Node Kind: directory
Schedule: normal
Last Changed Author: jcorgan
Last Changed Rev: 11082
Last Changed Date: 2009-05-21 18:21:10 +0200 (Thu, 21 May 2009)

$ uname -a
Darwin computer.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10
18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386

Tried with 3.2 as well, same story:

—8<—
Extracting
/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/gnuradio-core/src/lib/missing/.libs/libmissing.a
(cd .libs/libgnuradio-core-qa.lax/libmissing.a && ar x
/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/gnuradio-core/src/lib/missing/.libs/libmissing.a)
g++ -dynamiclib -single_module ${wl}-flat_namespace ${wl}-undefined
${wl}suppress -o .libs/libgnuradio-core-qa.0.0.0.dylib
.libs/bug_work_around_6.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_ccomplex_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_complex_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_filter.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_float_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_ccc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_ccf.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_fcc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_fff.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_scc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_rotator.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gri_mmse_fir_interpolator.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gri_mmse_fir_interpolator_cc.o

.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_general.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_circular_file.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_firdes.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt_nco.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt_vco.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_math.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gri_lfsr.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_block.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_buffer.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_flowgraph.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_hier_block2.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_hier_block2_derived.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_io_signature.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_top_block.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_vmcircbuf.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_runtime.o
.libs/libgnuradio-core-qa.lax/libmissing.a/bug_work_around_8.o
.libs/libgnuradio-core-qa.lax/libmissing.a/posix_memalign.o
-L/Users/alex/Documents/work/nc-projects/gr/lib -L/opt/local/lib
./.libs/libgnuradio-core.dylib
/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/omnithread/.libs/libgromnithread.dylib
/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/gruel/src/lib/.libs/libgruel.dylib
/opt/local/lib/libfftw3f.dylib /opt/local/lib/libgsl.dylib
/opt/local/lib/libgslcblas.dylib /opt/local/lib/libcppunit.dylib -ldl
-install_name
/Users/alex/Documents/work/nc-projects/gr/lib/libgnuradio-core-qa.0.dylib
-Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
ld: multiple definitions of symbol _posix_memalign
.libs/libgnuradio-core-qa.lax/libmissing.a/posix_memalign.o definition
of _posix_memalign in section (__TEXT,__text)
./.libs/libgnuradio-core.dylib(single module) definition of
_posix_memalign
/usr/bin/libtool: internal link edit command failed
make[5]: *** [libgnuradio-core-qa.la] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
—8<—

Any hints?

Alex

Hi Alex - In the file ‘gnuradio-core/src/lib/Makefile.am’, remove the
entry “missing/libmissing.la” from the entry for
“libgnuradio_core_qa_la_LIBADD”. Here’s the “svn diff”. Let me / the
list know if this works. - MLD

===================================================================
— gnuradio-core/src/lib/Makefile.am (revision 11081)
+++ gnuradio-core/src/lib/Makefile.am (working copy)
@@ -59,6 +59,5 @@
filter/libfilter-qa.la
general/libgeneral-qa.la
runtime/libruntime-qa.la \

  •   missing/libmissing.la           \
       libgnuradio-core.la             \
       $(CPPUNIT_LIBS)

Michael D. wrote:

Hi Alex - In the file ‘gnuradio-core/src/lib/Makefile.am’, remove the
entry “missing/libmissing.la” from the entry for
“libgnuradio_core_qa_la_LIBADD”. Here’s the “svn diff”. Let me / the
list know if this works. - MLD
Yep, that worked, thanks. But now I get another error for which I found
no solution on Google, and simply removing it from the Makefile didn’t
help this time…

—8<—
make[5]: *** No rule to make target gnuradio_swig_py_runtime.h', needed byall’. Stop.

This is how I ran configure:

$ ./configure --prefix=/Users/alex/Documents/work/nc-projects/gr
–disable-all-components --enable-gnuradio-core --enable-usrp
–enable-gr-usrp --enable-gr-wxgui --enable-gr-audio-osx
–enable-gnuradio-examples --enable-gr-utils
–enable-gr-how-to-write-a-block --enable-omnithread --enable-gruel
–enable-mblock --enable-pmt --enable-grc

—8<—

Alex

Alexander L. wrote:

–enable-gr-how-to-write-a-block --enable-omnithread --enable-gruel
–enable-mblock --enable-pmt --enable-grc

—8<—

OK, I reinstalled my MacBook with OS X 10.5.7, installed MacPorts and
dependencies according to instructions in http://de.pastebin.ca/1417306,
same story:

—8<—

libtool: link: g++ -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o
.libs/libgnuradio-core-qa.0.dylib .libs/bug_work_around_6.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_ccomplex_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_complex_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_filter.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_float_dotprod_x86.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_ccc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_ccf.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_fcc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_fff.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_fir_scc.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gr_rotator.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gri_mmse_fir_interpolator.o
.libs/libgnuradio-core-qa.lax/libfilter-qa.a/qa_gri_mmse_fir_interpolator_cc.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_general.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_circular_file.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_firdes.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt_nco.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_fxpt_vco.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gr_math.o
.libs/libgnuradio-core-qa.lax/libgeneral-qa.a/qa_gri_lfsr.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_block.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_buffer.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_flowgraph.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_hier_block2.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_hier_block2_derived.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_io_signature.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_top_block.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_gr_vmcircbuf.o
.libs/libgnuradio-core-qa.lax/libruntime-qa.a/qa_runtime.o
-L/Users/alex/Documents/work/nc-projects/gr/lib -L/opt/local/lib
./.libs/libgnuradio-core.dylib
/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/omnithread/.libs/libgromnithread.dylib
/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/gruel/src/lib/.libs/libgruel.dylib
-lboost_thread-mt-s /opt/local/lib/libfftw3f.dylib
/opt/local/lib/libgsl.dylib /opt/local/lib/libgslcblas.dylib -lcblas
/opt/local/lib/libcppunit.dylib -lm -ldl -Wl,-dylib_file
-Wl,/Users/alex/Documents/work/nc-projects/gr/lib/libgromnithread.0.dylib:/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/omnithread/.libs/libgromnithread.dylib
-Wl,-dylib_file
-Wl,/Users/alex/Documents/work/nc-projects/gr/lib/libgruel.0.dylib:/Users/alex/Documents/work/nc-projects/gr/gnuradio-3.2/gruel/src/lib/.libs/libgruel.dylib
-install_name
/Users/alex/Documents/work/nc-projects/gr/lib/libgnuradio-core-qa.0.dylib
-compatibility_version 1 -current_version 1.0 -Wl,-single_module
libtool: link: dsymutil .libs/libgnuradio-core-qa.0.dylib || :
libtool: link: (cd “.libs” && rm -f “libgnuradio-core-qa.dylib” && ln -s
“libgnuradio-core-qa.0.dylib” “libgnuradio-core-qa.dylib”)
libtool: link: rm -fr .libs/libgnuradio-core-qa.lax
libtool: link: ( cd “.libs” && rm -f “libgnuradio-core-qa.la” && ln -s
“…/libgnuradio-core-qa.la” “libgnuradio-core-qa.la” )
Making all in swig
make[5]: *** No rule to make target gnuradio_swig_py_runtime.h', needed by all’. Stop.
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
—8<—

Is anyone else using OS X and succeeds to build gnuradio 3.2 without
issues?

Alex

Alexander L. wrote:

Is anyone else using OS X and succeeds to build gnuradio 3.2 without issues?

A little while ago, I built 3.2 RC2 on a Macbook Pro running 10.4.11 and
didn’t encounter any problems (other than Macports installing all sorts
of extra stuff if you don’t set the swig install options right).
gnuradio built and installed fine from svn.

Cheers,
Jan

On May 24, 2009, at 4:24 PM, Alexander L. wrote:

Is anyone else using OS X and succeeds to build gnuradio 3.2 without
issues?

I’ve installed GNU Radio many times, latest being trunk revision 11081
(21 May 2009). I haven’t tried since then; I’ll be checking out the
3.2 release tomorrow. I see no reason in the Makefile.am system why
10.4 or 10.5 would not find the rule for gnuradio_swig_py_runtime.h ;
but I’ll check this all out tomorrow & can work with you to try out
different solutions. - MLD

Hi Alex -

On May 24, 2009, at 4:24 PM, Alexander L. wrote:

make[5]: *** No rule to make target gnuradio_swig_py_runtime.h', needed byall’. Stop.

The rule is located in gnuradio-core/src/lib/swig/Makefile.swig.gen ,
which is included in that directory’s Makefile.am directly; maybe
these files are too old or have been modified?

A couple of thoughts:

  • Try just “./configure --prefix=/Users/alex/Documents/work/nc-
    projects/gr” instead of all the disable and enable stuff; this should
    make no difference, but if it does please let the me / the list know
    so that this behavior can be corrected.

  • If you are working from the SVN trunk, try:

rm gnuradio-core/src/lib/swig/Makefile.swig.gen
rm gnuradio-core/src/lib/swig/Makefile.am
rm gnuradio-core/src/lib/swig/Makefile.in
svn up

These commands will restore those files to a correct, known-working
SVN version. Then go and try the bootstrap, configure, make again.

  • If you did not install all of the background libraries and
    applications via MacPorts, try using just MacPorts instead. Clean out
    the non-MacPorts installed stuff first.

If the problem persists after these, send me the results of “env” and
“port installed”, and I’ll see if anything pops out at me. - MLD

Hi Alex - Good to hear you’re up and running with GR on OSX. And,
you’re welcome. - MLD

'doh…

Forgot to reinstall swig after my Macbook reinstall. Did that, removed
the files as suggested, svn up, bootstrap etc. and it built fine…
added script to my MacPorts package install script so I don’t forget it
next time…

Now I’m running into some Python library version conflicts when trying
to run grc, but at least I have binaries :wink:

Will bother the list again if I’m stuck.

Thanks a lot for your help!

Alex