/usr/bin/ld: error: cannot find -lopenblas
aiworld opened this issue · 1 comments
aiworld commented
Just needed to remove openblas
from library_dirs
and add , '-L/opt/OpenBLAS/lib'
to extra_link_args
. Here's the whole working file.
from distutils.core import setup, Extension
import numpy
import os.path as path
module1 = Extension("overfeat",
include_dirs = ['../../src', numpy.get_include()],
library_dirs = ['../../src'],
libraries = ['TH', 'overfeat'],
sources = ['overfeatmodule.cpp'],
extra_compile_args=['-fopenmp'],
extra_link_args=['-lgomp', '-l%s'%(path.abspath('../../src/libTH.a')), '-L/opt/OpenBLAS/lib'])
setup(name = 'overfeat',
version = '1.0',
description = 'Python bindings for overfeat',
ext_modules = [module1],
install_requires = ['numpy'])
chrisranderson commented
Another option to fix this: run ld -lopenblas --verbose
to see where it's looking for the .so
file. Then find where yours is installed (via locate
or find
or something), and link it using ln -s <where the actual file is located> <where it's looking for it>
.