clMathLibraries / clSPARSE

a software library containing Sparse functions written in OpenCL
Apache License 2.0
173 stars 60 forks source link

Can not link shared library #214

Open mehdiBabamehdi opened 4 years ago

mehdiBabamehdi commented 4 years ago

I tried to installed clSPARSE library on Ubuntu 14.04, and I did the following steps

cd src 
mkdir build 
cd build 
cmake .. 
make

and in dir build/library libclSPARSE.so was generated and I added the address to $LD_LIBRARY_PATH, but when I compile a code in which I include clSPARSE.h I got the error 'clSPARSE.h' can not be found Since it was installed locally I can not use ldconfig -p | grep 'libclSPARSE' to check if it is installed on the machine. Is there any way I can find out if it was installed and can be linked correctly? The makefile I used is

CXX = g++-9

FLAGS = -Wall -pedantic

INCLUDE = /usr/local/cuda-7.5/include

LFLAGS = /usr/local/cuda-7.5/lib

INCLUDESPARSE = /home/mehdi/clSPARSE/src/library/include

LFLAGSSPARSE = /home/mehdi/clSPARSE/src/build/library

LIBS = -lOpenCL -lclBLAS -I$(INCLUDESPARSE) -L$(LFLAGSSPARSE) -lclSPARSE -lm

TARGETDIR = ../exe/
TARGET= spmv
SRC = $(TARGET).cc

.PHONY: all, clean

all: $(TARGET)

$(TARGET):$(SRC)
        $(CXX) $(STD) $(FLAGS) $< -I$(INCLUDE) -L$(LFLAGS) $(LIBS) -o $(TARGETDIR)$@

clean:
        rm -rf $(TARGETDIR)$(TARGET) *.o

`

tingxingdong commented 4 years ago

This is not a clSparse question. This is a Linux programming question. Copy clSPARSE.h from github and past to /usr/include