|
我的makefile如下
CXX=g++
CFLAGS= -O3
GF=gfortran
BLLIB=lib/libblas.a
CBLIB=lib/cblas_LINUX.a
Objects=Main.o\
Matrix.o\
mycode:$(Objects)
$(CXX) $(CFLAGS) -o mycode $(Objects)
Main.o:Main.cpp
$(CXX) $(CFLAGS) -c Main.cpp -o Main.o
Matrix:Matrix.cpp Matrix.h
$(CXX) $(CFLAGS) -c -Iinclude Matrix.cpp
gfortran -o cblas Matrix.o $(CBLIB) $(BLLIB)
请问怎么正确链接cblas的静态库?用上面的makefile编译得到以下的错误提示:
g++ -O3 -o mycode Main.o Matrix.o
Matrix.o: In function `CMatrix::operator*(CMatrix const&) const':
Matrix.cpp:(.text+0xbb8): undefined reference to `cblas_dgemm'
collect2: error: ld returned 1 exit status
Makefile:10: recipe for target 'mycode' failed
文件说明:
cblas.h 在 ./include/
cblas_LINUX.a 和libblas.a在 ./lib/
其他cpp文件和makefile 文件在 ./
|
|