Reputation: 23
I am trying to install the python package pycuda on a Mac OS Mojave with python 3.8.1 using pip. I write:
python -m pip install pycuda
but after many trials I always end with the same error:
error: command 'clang' failed with exit status 1
I made: export CC=/usr/bin/clang export CXX=/usr/bin/clang++ in my .profile file but this did not helped.
The last part of the text written on the terminal says:
90 warnings generated.
clang -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-3.8/src/cpp/cuda.o build/temp.macosx-10.14-x86_64-3.8/src/cpp/bitlog.o build/temp.macosx-10.14-x86_64-3.8/src/wrapper/wrap_cudadrv.o build/temp.macosx-10.14-x86_64-3.8/src/wrapper/mempool.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/converter/builtin_converters.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/converter/type_id.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/converter/from_python.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/converter/registry.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/converter/arg_to_python_base.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/life_support.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/iterator.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/stl_iterator.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/function_doc_signature.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/pickle_support.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/function.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/enum.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/class.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object/inheritance.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/wrapper.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object_protocol.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/long.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/module.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/slice.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/dict.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/exec.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/numeric.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/object_operators.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/tuple.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/list.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/errors.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/str.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/python/src/import.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/smart_ptr/src/sp_collector.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/smart_ptr/src/sp_debug_hooks.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/system/src/error_code.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/thread/src/pthread/thread.o build/temp.macosx-10.14-x86_64-3.8/bpl-subset/bpl_subset/libs/thread/src/pthread/once.o build/temp.macosx-10.14-x86_64-3.8/src/wrapper/wrap_curand.o -L/Developer/NVIDIA/CUDA-10.2/lib -L/Developer/NVIDIA/CUDA-10.2/lib -L/Developer/NVIDIA/CUDA-10.2/lib/stubs -L/Developer/NVIDIA/CUDA-10.2/lib/stubs -L/usr/local/cuda/lib -L/Developer/NVIDIA/CUDA-10.2/lib -L/Developer/NVIDIA/CUDA-10.2/lib -L/Developer/NVIDIA/CUDA-10.2/lib/stubs -L/Developer/NVIDIA/CUDA-10.2/lib/stubs -L/usr/local/cuda/lib -lcuda -lcurand -o build/lib.macosx-10.14-x86_64-3.8/pycuda/_driver.cpython-38-darwin.so -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-10.2/lib -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-10.2/lib -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-10.2/lib/stubs -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-10.2/lib/stubs -Xlinker -rpath -Xlinker /usr/local/cuda/lib
ld: library not found for -lcuda
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p8/mxnrzwqj51z51zx_qql90bvr0000gn/T/pip-install-dkd5hqzy/pycuda/setup.py'"'"'; file='"'"'/private/var/folders/p8/mxnrzwqj51z51zx_qql90bvr0000gn/T/pip-install-dkd5hqzy/pycuda/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/p8/mxnrzwqj51z51zx_qql90bvr0000gn/T/pip-record-efvcjkkh/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/marce/Library/Python/3.8/include/python3.8/pycuda Check the logs for full command output.
Upvotes: 0
Views: 1015
Reputation: 1552
This is the actual error:
ld: library not found for -lcuda
The compiler cannot find your CUDA C library. You will have to install it first, and / or make sure that it's in a location where the compiler can find it.
See also this question on how to install CUDA on OSX.
If you use conda, you can also do
$ conda install cudatoolkit
to install a version of the CUDA toolkit.
Upvotes: 0