Opened 6 years ago

Closed 11 months ago

#48009 closed defect (fixed)

volk @20150521_0 Undefined symbols for architecture x86_64

Reported by: jpdevillers@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: fluzzygib@…, w3sz73@…
Port: volk

Description

  • Xcode 4.6.3

When trying to upgrade Volk, I get the following error:

:info:build Undefined symbols for architecture x86_64:
:info:build   "___cpuid_count", referenced from:
:info:build       _i_can_has_avx2 in volk_cpu.c.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)

Attachments (4)

main.log (149.6 KB) - added by jpdevillers@… 6 years ago.
main.2.log (273.9 KB) - added by w3sz73@… 5 years ago.
volk log using gcc5
main.3.log (387.5 KB) - added by w3sz73@… 5 years ago.
volk log using clang
main.4.log (386.6 KB) - added by w3sz73@… 5 years ago.
volk log using clang, boost1.59+universal, python27

Download all attachments as: .zip

Change History (29)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to michaelld@…
Port: volk added; Volk removed

In the future, please Cc the port maintainers (port info --maintainers volk), if any. Please attach the complete main.log file after running port clean on the port

Changed 6 years ago by jpdevillers@…

Attachment: main.log added

comment:2 Changed 6 years ago by jpdevillers@…

Thanks, just added the main.log

comment:3 Changed 6 years ago by jpdevillers@…

The only way it would compile was using configure.compiler=macports-gcc-4.7

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

I'm running 10.8 also, but using the latest (or very recent) Xcode (AppleClang 5.1.0.5030040) & Volk builds fine for me. I believe that the older Clang (AppleClang 4.2.0.4250028) has some issues with what it #define's that make it looks like GCC & hence this issue. The code in issue should correctly distinguish between GCC and non-GCC via defined macros. Is there any way you can update Xcode to a newer version?

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

Cc: fluzzygib@… added

Has duplicate #48261.

comment:6 Changed 5 years ago by daniel@…

I have the same problem on OS X Lion (Darwin 11.4.2), where Xcode 4.6.3 is the latest version; see XcodeVersionInfo. My workaround was to build variant +cxx11 which also blacklists clang and then builds with gcc49.

The solution going forward will likely be to blacklist all "old" clang versions (<5.0 from your experience).

comment:7 Changed 5 years ago by w3sz73@…

Volk fails to build for me with the "ld: symbol(s) not found for architecture x86_64" error with OS X El Capitan 10.11.6 with XCode 7.3.1 with command line tools 7.3.1 (7D1014) when using: clang gcc5 gcc4.9 gcc4.8 gcc4.7

I will attach a copy of the log file for gcc5.

Changed 5 years ago by w3sz73@…

Attachment: main.2.log added

volk log using gcc5

comment:8 Changed 5 years ago by w3sz73@…

Cc: w3sz73@… added

Log files are similar when other compilers listed are used. The"ld: symbol(s) not found for architecture x86_64" error is consistent across compiler versions.

Last edited 5 years ago by w3sz73@… (previous) (diff)

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

Can you do the following:

sudo port clean volk
sudo port selfupdate
sudo port install volk

and see if that works. The log file for GCC5 is not unsurprising given that you're building on a setup (OS X 10.11) that required Clang's libc++. Clang should work for building Volk on any 10.9 or newer setup. Older Clang and some older GCCs have issues building Volk.

Changed 5 years ago by w3sz73@…

Attachment: main.3.log added

volk log using clang

comment:10 Changed 5 years ago by w3sz73@…

I get the same result after doing as suggested. I posted the log file for this most recent attempt as main.3.log.

I don't know if the following info is diagnostically helpful:

Typing in the terminal window "clang --version" gives:

Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

which would be a problem as its an old version of clang, but according to the log for this most recent attempt:

:info:configure -- The C compiler identification is AppleClang 7.3.0.7030031
:info:configure -- The CXX compiler identification is AppleClang 7.3.0.7030031

which should be OK as its a newer version of clang.

Also, the log notes this potential issue which I did not fix:

:info:configure CMake Warning at /opt/local/share/cmake-3.6/Modules/Platform/Darwin.cmake:197 (message):
:info:configure   The SDK Library/Frameworks path
:info:configure 
:info:configure    //Library/Frameworks
:info:configure 
:info:configure   is not set up correctly on this system.  This is known to occur when
:info:configure   installing Xcode 3.2.6:
:info:configure 
:info:configure    http://bugs.python.org/issue14018
:info:configure 
:info:configure   The problem may cause build errors that report missing system frameworks.
:info:configure   Fix your SDK symlinks to resolve this issue and avoid this warning.

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

If you're running OS X 10.11, then there should not be any Xcode oriented stuff in /Library/Frameworks/. At all. Nothing. Some other stuff is normal. What does

ls -lAF /Library/Frameworks

return for you?

comment:12 Changed 5 years ago by w3sz73@…

Here is what I have:

ls -lAF /Library/Frameworks
total 48
lrwxr-xr-x  1 root    wheel   71 Oct 21  2015 AEProfiling.framework@ -> ../../Applications/Motion.app/Contents/Frameworks/AEProfiling.framework
lrwxr-xr-x  1 root    wheel   74 Oct 21  2015 AERegistration.framework@ -> ../../Applications/Motion.app/Contents/Frameworks/AERegistration.framework
lrwxr-xr-x  1 root    wheel   74 Oct 21  2015 AudioMixEngine.framework@ -> ../../Applications/Motion.app/Contents/Frameworks/AudioMixEngine.framework
drwxr-xr-x  5 root    admin  170 Jan 24  2010 DivX Toolkit.framework/
drwxrwxrwx  5 73w3sz  admin  170 Jun 12  2009 EWSMac.framework/
lrwxr-xr-x  1 root    wheel   19 Mar 26  2011 Frameworks@ -> /Library/Frameworks
drwxrwxr-x  8 root    admin  272 Jun 26  2009 HPDeviceModel.framework/
drwxrwxr-x  6 root    admin  204 Jun 26  2009 HPPml.framework/
drwxrwxr-x  7 root    admin  238 Jun 26  2009 HPServicesInterface.framework/
lrwxrwxr-x  1 root    admin   54 Sep 10  2010 HPSmartPrint.framework@ -> /Library/Printers/hp/Frameworks/HPSmartPrint.framework
drwxrwxr-x  6 73w3sz  admin  204 Dec 15  2009 Jackmp.framework/
drwxrwxr-x  6 73w3sz  admin  204 Dec 15  2009 Jackservermp.framework/
lrwxr-xr-x  1 root    wheel   60 Oct 21  2015 NyxAudioAnalysis.framework@ -> /System/Library/PrivateFrameworks/NyxAudioAnalysis.framework
drwxrwxr-x  6 73w3sz  admin  204 Aug  5  2010 Panda.framework/
drwxr-xr-x  5 root    wheel  170 Oct 21  2015 PluginManager.framework/
drwxrwxr-x  6 root    wheel  204 Oct 24  2012 SRFrameBufferConnection.framework/
drwxr-xr-x@ 6 73w3sz  admin  204 Jun 18  2005 XOSL.framework/
drwxr-xr-x  8 root    wheel  272 Jul  7 04:55 iTunesLibrary.framework/

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

OK; you can get rid of the CMake Warning, by doing the following:

cd /Library/Frameworks
sudo rm Frameworks

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

As for the primary issue, the errors are now such as:

:info:build Undefined symbols for architecture x86_64:
:info:build   "boost::filesystem::detail::status_api(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::system::error_code&)", referenced from:
:info:build       boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::filesystem::path_traits> const&) in volk_profile.cc.o
...

which implies to me that Boost is not properly installed. What does "port installed boost" return?

comment:15 Changed 5 years ago by w3sz73@…

Here is what I get:

$ port installed boost
The following ports are currently installed:
  boost @1.59.0_2+no_single+no_static+python27 (active)
  boost @1.59.0_2+no_single+no_static+python27+universal

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

OK. what does "ls -lAF /opt/local/var/macports/software/boost/" return?

comment:17 Changed 5 years ago by w3sz73@…

Here is what I get:

ls -lAF /opt/local/var/macports/software/boost/
total 192752
-rw-r--r--  1 macports  admin  52269304 Jul 17 14:12 boost-1.59.0_2+no_single+no_static+python27+universal.darwin_15.i386-x86_64.tbz2
-rw-r--r--  1 macports  admin  46412730 Jul 17 14:12 boost-1.59.0_2+no_single+no_static+python27.darwin_15.x86_64.tbz2

comment:18 Changed 5 years ago by jpdevillers@…

Cc: jpdevillers@… added

Cc Me!

comment:19 Changed 5 years ago by jpdevillers@…

Cc: jpdevillers@… removed

Cc Me!

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

OK; good. What happens with the following:

sudo port activate boost @1.59.0_2+no_single+no_static+python27+universal
sudo port clean volk
sudo port install volk

Changed 5 years ago by w3sz73@…

Attachment: main.4.log added

volk log using clang, boost1.59+universal, python27

comment:21 Changed 5 years ago by w3sz73@…

Thanks again for the quick responses!

There is a similar result. I put newest log at main.4.log Still getting the error of the form:

:info:build Undefined symbols for architecture x86_64:
:info:build   "boost::filesystem::detail::status_api(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::system::error_code&)", referenced from:
:info:build    boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::filesystem::path_traits> >, bool>::type 

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

OK. Looking more carefully at the log file, I see:

:info:build In file included from /opt/local/include/boost_1_43_0/boost/program_options.hpp:15:

If you do

port contents boost | grep "include/boost_1_43_0"

you should get back nothing.

Likewise, if you do:

port provides /opt/local/include/boost_1_43_0/boost/program_options.hpp

it should return something like that this file "is not provided by a MacPorts port".

If both of the above are true, then I'd recommend removing that directory:

cd /opt/local/include
sudo rm -rf boost_1_43_0

as it looks like cruft left behind by some previous install somehow.

After removing it, you'll want to "clean volk" and then try again.

comment:23 Changed 5 years ago by w3sz73@…

You are a master :)

That did the trick and volk is now installed without error.

Thank you VERY much for your help and I VERY much appreciate that you took the time to get this working for me even though it ended up not being a volk bug but rather a problem with junk left behind on my machine by a previous install.

Thanks again and have a great week!!

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

NP. Glad that worked. I wish the rest of this ticket were as simple as your issue ...

comment:25 Changed 11 months ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

I strongly believe this issue is no longer relevant, so I'm closing this ticket. If it still is an issue, please reopen and provide a build log and/or other compelling information to help me debug it.

Note: See TracTickets for help on using tickets.