This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CBLAS Linker Error

Other Parts Discussed in Thread: FFTLIB

I keep getting unresolved symbol errors when I try to use the libcblas.a libraries.

**** Build of configuration Debug for project 6678Test ****

/home/ankit/ti/ccsv5/utils/bin/gmake -k all
Building target: 6678Test.out
Invoking: C6000 Linker
"/home/ankit/ti/ti-cgt-c6000_8.0.0/bin/cl6x" -mv6600 --abi=eabi -g --display_error_number --diag_warning=225 --diag_wrap=off --openmp -z -m"6678Test.map" -i"/home/ankit/ti/ti-cgt-c6000_8.0.0/lib" -i"/home/ankit/ti/ti-cgt-c6000_8.0.0/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="6678Test_linkInfo.xml" --rom_model -o "6678Test.out"  "./main.obj" "../C6678.cmd" -l"libc.a" -l/home/ankit/ti/blas_c66x_3_11_0_3/packages/ti/blas/lib/libcblas.a -l/home/ankit/ti/fftlib_k2hx_2_0_1_3/packages/ti/fftlib/lib/fftlib.lib -l/home/ankit/ti/dsplib_c66x_3_4_0_0/packages/ti/dsplib/lib/dsplib.lib
<Linking>
warning #10247-D: creating output section ".tdata" without a SECTIONS specification
warning #10247-D: creating output section ".TI.tls_init" without a SECTIONS specification
warning #10247-D: creating output section ".text" without a SECTIONS specification
warning #10247-D: creating output section ".const" without a SECTIONS specification
warning #10247-D: creating output section ".stack" without a SECTIONS specification
warning #10247-D: creating output section ".fardata" without a SECTIONS specification
warning #10247-D: creating output section ".sysmem" without a SECTIONS specification
warning #10247-D: creating output section ".cio" without a SECTIONS specification
warning #10247-D: creating output section ".far:.common" without a SECTIONS specification
warning #10247-D: creating output section ".cinit" without a SECTIONS specification
warning #10210-D: creating ".stack" section with default size of 0x400; use the -stack option to change the default size
warning #10210-D: creating ".sysmem" section with default size of 0x400; use the -heap option to change the default size

 undefined      first referenced                                                                
  symbol            in file                                                                     
 ---------      ----------------                                                                
 ATL_cgemm      /home/ankit/ti/blas_c66x_3_11_0_3/packages/ti/blas/lib/libcblas.a<cblas_cgemm.o>
 ATL_csyreflect /home/ankit/ti/blas_c66x_3_11_0_3/packages/ti/blas/lib/libcblas.a<cblas_cgemm.o>
 ATL_csyrk      /home/ankit/ti/blas_c66x_3_11_0_3/packages/ti/blas/lib/libcblas.a<cblas_cgemm.o>

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "6678Test.out" not built

>> Compilation failure
gmake: *** [6678Test.out] Error 1
gmake: Target `all' not remade because of errors.

My setup: CCSv5.5 on Ubuntu 12.04, board is the K2H EVM set to DSP no-boot. Other code compiles fine. I've successfully used DSPLIB and I've used my own code without issue. I can't imagine where it's going wrong. Below is my code. Thank you in advance for any and all help.

#include <c6x.h>
#include <stdio.h>
#include <stdlib.h>
#include "ti/blas/inc/cblas.h"

int m = 24;
int n = 20;


#pragma DATA_ALIGN(x1, 8);
#pragma DATA_ALIGN(x2, 8);
#pragma DATA_ALIGN(y , 8);
float x1[24*2];
float x2[20*24*2];
float y[20*2];


int main()
{

	printf("Starting main\n");

	int i;
	for(i = 0; i < 48; i++)
		x1[i] = (rand()%10000)/100.0;

	for(i = 0; i < 20*24*2; i++)
		x2[i] = (rand()%10000)/100.0;

	long t1, t2;

	int lda = 24;
	int ldb = 20;
	int ldc = 20;

	float alpha[2] = {1.0, 1.0};
	float beta[2] = {0.0, 0.0};

	t1 = _itoll(TSCH,TSCL);
	cblas_cgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 1, 20, 24, alpha, x1, lda, x2, ldb, beta, y, ldc);
	t2 = _itoll(TSCH,TSCL);

	printf("Prelim result: %d\n", t2-t1);

	return(0);
}

  • Ankit,

    There is a sgemm exmaple under ti/blas_c66x_3_11_0_3/packages/ti/blas/example, the Makefile uses additional libraries to link: ../lib/libcblas.a ../lib/libtstatlas.a ../lib/libatlas.a.

    Maybe this is the case for cgemm as well. Please add those libraries and use a linker command file: adapting "C6678_unified.cmd" to your K2H and build.

    Regards, Eric