Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not link shared library #214

Open
mehdiBabamehdi opened this issue Jan 27, 2020 · 1 comment
Open

Can not link shared library #214

mehdiBabamehdi opened this issue Jan 27, 2020 · 1 comment

Comments

@mehdiBabamehdi
Copy link

mehdiBabamehdi commented Jan 27, 2020

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants