YAC linking Problem

bruce.labitt at autoliv.com bruce.labitt at autoliv.com
Mon May 10 10:21:50 EDT 2010


Fellow list members, I've got a linux linking problem, which has me 
stumped.  Since I've been coding mostly in python, lately, my 'C' brain 
has atrophied...

I've got a C (umm actually C++) program that won't link to some ATLAS 
libraries which I recently compiled.  The program itself will compile, 
link and run if I link to the baseline (non-optimized) ATLAS libraries.  I 
think it even gives the expected result, as an added bonus!

However, if I use "/usr/local/atlas/include/cblas.h" instead of the system 
"/usr/include/cblas.h" in the code snippet below,

extern "C"{
#include "/usr/local/atlas/include/cblas.h"
}

the build reports:
$ ./build_cblas_test
Building cblas1
/tmp/ccSMmtzW.o: In function `main':
cbas_tb.cpp:(.text+0x899): undefined reference to `cblas_zgemm'
collect2: ld returned 1 exit status
Build complete

My build file --> not a make file yet because it is just a one liner, is:

g++ -O3 -m64 -I/usr/local/atlas/include -L/usr/local/atlas/lib -lcblas -lm 
-Wall -Wcast-qual -o cblas1 cblas_tb.cpp

I've tried copying the include file and lib file and stuffing them in the 
same directory as the cpp file, but to no avail.  (Yes I modified the 
command above.)

Before anyone asks, yes, there are files at the locations.  The new 
cblas.h file looks very close to the old, although I have not run a diff 
on them.  ( cblas_zgemm is in the new header, I looked.)  The library is 
static.  Is there a tool to look inside an .a file? 

I figure the problem is probably an operator error, sigh, but I'm not sure 
what it is.  If someone could point me in the right direction, I'd 
appreciate it.  Assume nothing - it is probably basic.  :(

I can post the code if people think it would help.  (Just didn't want to 
make this email any longer than necessary.)

-Bruce


******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail.  Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************



More information about the gnhlug-discuss mailing list