Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#45813 closed defect (fixed)

uhd undefined symbols for architecture x86_64

Reported by: mail@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.3.2
Keywords: Cc: petrrr
Port: uhd

Description (last modified by larryv (Lawrence Velázquez))

I'm having trouble upgrading uhd on OSX 10.6.8 Im getting:

:info:build Undefined symbols for architecture x86_64:
:info:build   "uhd::niusrprio::niriok_proxy_impl_v1::NIRIO_RESOURCE::INPUT_FIFO", referenced from:
:info:build       uhd::niusrprio::niriok_proxy_impl_v1::add_fifo_resource(uhd::niusrprio::nirio_fifo_info_t const&)in niriok_proxy_impl_v1.cpp.o
:info:build   "uhd::niusrprio::niriok_proxy_impl_v1::NIRIO_RESOURCE::OUTPUT_FIFO", referenced from:
:info:build       uhd::niusrprio::niriok_proxy_impl_v1::add_fifo_resource(uhd::niusrprio::nirio_fifo_info_t const&)in niriok_proxy_impl_v1.cpp.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build collect2: ld returned 1 exit status

Attachments (1)

main.log (20.6 KB) - added by mail@… 10 years ago.
main.log

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by mail@…

Attachment: main.log added

main.log

comment:1 Changed 10 years ago by larryv (Lawrence Velázquez)

Description: modified (diff)
Owner: changed from macports-tickets@… to michaelld@…
Port: uhd added

Thanks. In future tickets, please Cc any port maintainers (port info --maintainers uhd).

comment:2 Changed 10 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:3 Changed 10 years ago by p.ohanlon@…

It would appear that it may be down to some subtle compiler bug (I'm using /usr/bin/llvm-g++-4.2 on OSX10.7) as when I reimplemented the offending ternary condition using a normal if statement it compiled ok - here's my diff -u:

--- /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_uhd/uhd/work/uhd-003_008_000/host/lib/transport/nirio/niriok_proxy_impl_v1.cpp	2014-11-24 11:01:01.000000000 +0000
+++ /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_uhd/uhd/work/uhd-003_008_000/host/lib/transport/nirio/niriok_proxy_impl_v1.cpp.orig	2014-11-24 10:59:29.000000000 +0000
@@ -285,10 +285,9 @@
        niriok_proxy_impl_v1::nirio_syncop_out_params_t out = {};

        in.function    = niriok_proxy_impl_v1::NIRIO_FUNC::ADD_RESOURCE;
-       if (fifo_info.direction == OUTPUT_FIFO)
-                in.subfunction = niriok_proxy_impl_v1::NIRIO_RESOURCE::OUTPUT_FIFO;
-       else
-                in.subfunction = niriok_proxy_impl_v1::NIRIO_RESOURCE::INPUT_FIFO;
+       in.subfunction = (fifo_info.direction == OUTPUT_FIFO) ?
+               niriok_proxy_impl_v1::NIRIO_RESOURCE::OUTPUT_FIFO :
+               niriok_proxy_impl_v1::NIRIO_RESOURCE::INPUT_FIFO;

        in.params.add.fifoWithDataType.channel        = fifo_info.channel;
        in.params.add.fifoWithDataType.baseAddress    = fifo_info.base_addr;

comment:4 Changed 10 years ago by michaelld (Michael Dickens)

Interesting. I like your way better, and if it works better than that's a double win. Of course, this code isn't actually used on OSX ;)

comment:5 Changed 10 years ago by michaelld (Michael Dickens)

Did you maybe diff the wrong way? The code currently reads with the "+" from your patch.

If so, can you try, say, adding "()" around the whole "?" stuff:

((fifo_info.direcion ... ::INPUT_FIFO);

and see if that works? I like the use of "?" here; not sure why it doesn't work.

comment:6 Changed 10 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Your fix (reverse of the patch above) was the only change I could get to work, and it seems to work well across various compilers.

Thus, I've committed it in r128624, and will push the change to Ettus for their consideration. Thanks!

comment:7 in reply to:  5 Changed 10 years ago by p.ohanlon@…

Replying to michaelld@…:

Did you maybe diff the wrong way? The code currently reads with the "+" from your patch.

If so, can you try, say, adding "()" around the whole "?" stuff:

((fifo_info.direcion ... ::INPUT_FIFO);

and see if that works? I like the use of "?" here; not sure why it doesn't work.

Yeah you're right. Anyway glad it [reversed] fixed it for people.

Note: See TracTickets for help on using tickets.