[Bug 993991] Re: nm and ld cannot find symbols in libblas.so and other files

Jaguar bmarsh at netspace.net.au
Wed Jun 20 04:24:19 UTC 2012


I've just has a similar problem. I could compile correctly on lucid, but the same command-line would not compile on precise.
After posting to Stack Overflow, the issue was that I had the -l options before the object files.

Changing the command-line from:
g++ -o installertest \
	-lsybdb \
	-lxmlrpc \
	-lxmlrpc_cpp \
	-lxmlrpc_xmlparse \
	-lxmlrpc_xmltok \
	-lxmlrpc_util \
	-lxmlrpc++ \
	-lxmlrpc_server_cgi \
	-lcrypto \
	-std=c++0x \
	ContractData.o installertest.o

to:
g++ -o installertest \
	ContractData.o installertest.o \
	-lsybdb \
	-lxmlrpc \
	-lxmlrpc_cpp \
	-lxmlrpc_xmlparse \
	-lxmlrpc_xmltok \
	-lxmlrpc_util \
	-lxmlrpc++ \
	-lxmlrpc_server_cgi \
	-lcrypto \
	-std=c++0x

Worked around the problem.

Apparently, this is some kind of implementation change between versions.
Not sure if this is an Ubuntu-specific issue, or a general gcc issue.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to binutils in Ubuntu.
https://bugs.launchpad.net/bugs/993991

Title:
  nm and ld cannot find symbols in libblas.so and other files

Status in “binutils” package in Ubuntu:
  Incomplete

Bug description:
  After the upgrade to 12.04, I am unable to link against the libblas.so
  (and friends), libatlas.so (and friends), libcblas.so, libopenblas.so,
  and other files. These are from different packages such as libblas-
  dev, libatlas-base-dev, libopenblas-dev, etc. I do not know if this is
  a problem with other libraries as well. I have been able to build and
  link most other software like normal, these are the only ones I find
  that are problematic.

  When I type "nm /usr/lib/libblas.so" I get this error message: "nm:
  /usr/lib/libblas.so: no symbols"

  However, when I type the command "objdump -T /usr/lib/libblas.so", I
  get a readout of several hundred exported symbols. Here's a sample of
  those (which are the few that I am trying to link against):

  000000000000f860 g    DF .text	0000000000000365  Base        cblas_dgemm
  000000000001cb20 g    DF .text	000000000000033a  Base        cblas_zgemm

  This suggests to me that the libraries are exporting symbols
  correctly, but that nm is not able to read them for some reason.
  Please correct me if this interpretation is incorrect.

  Likewise, when I try to link against this library with gcc and ld, the
  linking happens with no errors, but I get this error at runtime:

  "symbol lookup error: dynext/linalg_group.so: undefined symbol:
  cblas_dgemm"

  ldd on my library doesn't even show that libblas.so is being linked,
  probably because ld couldn't find any symbols:

  linux-vdso.so.1 =>  (0x00007fff551ff000)
  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdb1e43a000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fdb1ea2c000)

  Notice that this same exact build and test sequence, with the same
  packages, does work perfectly on Ubuntu 11.10 and earlier (tests as
  far back as 10.04 seem to work in my VM).

  Please let me know if I need to include any additional information.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: binutils 2.22-6ubuntu1
  ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
  Uname: Linux 3.2.0-24-generic x86_64
  ApportVersion: 2.0.1-0ubuntu6
  Architecture: amd64
  Date: Thu May  3 09:35:38 2012
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
  SourcePackage: binutils
  UpgradeStatus: Upgraded to precise on 2012-04-27 (5 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/993991/+subscriptions




More information about the foundations-bugs mailing list