Get C function name by keyword - shell

As below C sample, Is any shell command could get/parsing founction
name based on insided keyword.
such as below C, then
$ foo netif_carrier_on
then output
mii_check_link
484 void mii_check_link (struct mii_if_info *mii)
485 {
486 int cur_link = mii_link_ok(mii);
487 int prev_link = netif_carrier_ok(mii->dev);
488
489 if (cur_link && !prev_link)
490 netif_carrier_on(mii->dev);
491 else if (prev_link && !cur_link)
492 netif_carrier_off(mii->dev);
493 }

Related

Getting HTTPError: HTTP Error 404: Not Found error when loaded a dataset using seaborn

I have a dataset with name "haberman.csv" in my current directory and upon trying to load the dataset with below load_dataset function then it throws an error saying HTTPError: HTTP Error 404: Not Found.
But when loaded a different dataset with name "tips.csv" in the same directory it works well.
What is the reason behind this error that one dataset when loaded works and another doesn't.
import seaborn as sns
sns.set()
haberman_plot = sns.load_dataset("haberman")
Error:
<ipython-input-58-fb9fa2439b0a> in <module>()
4
5 sns.set()
----> 6 haberman_plot = sns.load_dataset("haberman")
~/.local/lib/python3.6/site-packages/seaborn/utils.py in load_dataset(name, cache, data_home, **kws)
426 os.path.basename(full_path))
427 if not os.path.exists(cache_path):
--> 428 urlretrieve(full_path, cache_path)
429 full_path = cache_path
430
~/anaconda3/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data)
246 url_type, path = splittype(url)
247
--> 248 with contextlib.closing(urlopen(url, data)) as fp:
249 headers = fp.info()
250
~/anaconda3/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
221 else:
222 opener = _opener
--> 223 return opener.open(url, data, timeout)
224
225 def install_opener(opener):
~/anaconda3/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
530 for processor in self.process_response.get(protocol, []):
531 meth = getattr(processor, meth_name)
--> 532 response = meth(req, response)
533
534 return response
~/anaconda3/lib/python3.6/urllib/request.py in http_response(self, request, response)
640 if not (200 <= code < 300):
641 response = self.parent.error(
--> 642 'http', request, response, code, msg, hdrs)
643
644 return response
~/anaconda3/lib/python3.6/urllib/request.py in error(self, proto, *args)
568 if http_err:
569 args = (dict, 'default', 'http_error_default') + orig_args
--> 570 return self._call_chain(*args)
571
572 # XXX probably also want an abstract factory that knows when it makes
~/anaconda3/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
502 for handler in handlers:
503 func = getattr(handler, meth_name)
--> 504 result = func(*args)
505 if result is not None:
506 return result
~/anaconda3/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
648 class HTTPDefaultErrorHandler(BaseHandler):
649 def http_error_default(self, req, fp, code, msg, hdrs):
--> 650 raise HTTPError(req.full_url, code, msg, hdrs, fp)
651
652 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found```

What does $INSIDE_EMACS do for bash

I saw here that bash 4.4 looks for the variable $INSIDE_EMACS to determine if it is running in a comint mode buffer. However I can't seem to find what this changes about bash behavior. What changes does $INSIDE_EMACS make?
According to emacs doc:
Emacs sets the environment variable INSIDE_EMACS in the subshell to version,comint, where version is the Emacs version (e.g., 24.1). Programs can check this variable to determine whether they are running inside an Emacs subshell.
Took a look at bash's source code and there's no much magic:
575 /*
576 * M-x term -> TERM=eterm-color INSIDE_EMACS='251,term:0.96' (eterm)
577 * M-x shell -> TERM='dumb' INSIDE_EMACS='25.1,comint' (no line editing)
578 *
579 * Older versions of Emacs may set EMACS to 't' or to something like
580 * '22.1 (term:0.96)' instead of (or in addition to) setting INSIDE_EMACS.
581 * They may set TERM to 'eterm' instead of 'eterm-color'. They may have
582 * a now-obsolete command that sets neither EMACS nor INSIDE_EMACS:
583 * M-x terminal -> TERM='emacs-em7955' (line editing)
584 */
585 if (interactive_shell)
586 {
587 char *term, *emacs, *inside_emacs;;
588 int emacs_term, in_emacs;
589
590 term = get_string_value ("TERM");
591 emacs = get_string_value ("EMACS");
592 inside_emacs = get_string_value ("INSIDE_EMACS");
593
594 if (inside_emacs)
595 {
596 emacs_term = strstr (inside_emacs, ",term:") != 0;
597 in_emacs = 1;
598 }
599 else if (emacs)
600 {
601 /* Infer whether we are in an older Emacs. */
602 emacs_term = strstr (emacs, " (term:") != 0;
603 in_emacs = emacs_term || STREQ (emacs, "t");
604 }
605 else
606 in_emacs = emacs_term = 0;
607
608 /* Not sure any emacs terminal emulator sets TERM=emacs any more */
609 no_line_editing |= STREQ (term, "emacs");
610 no_line_editing |= in_emacs && STREQ (term, "dumb");
611
612 /* running_under_emacs == 2 for `eterm' */
613 running_under_emacs = in_emacs || STREQN (term, "emacs", 5);
614 running_under_emacs += emacs_term && STREQN (term, "eterm", 5);
615
616 if (running_under_emacs)
617 gnu_error_format = 1;
618 }
UPDATE:
Just found the original request (in bug-bash mailing list) for bash to deal with INSIDE_EMACS: Bash should look at INSIDE_EMACS not just EMACS
At the very least, it causes bash to disable line editing, since presumably you will be using emacs's own editing facilities to edit a command line.

Jupyter notebook Conda error running MoviePy code

On my macOS v 10.11.6, I got an error running moviepy on jupyter notebook
Python v 3.5.2
Conda v 4.3.8
Jupyter 4.2.1
I'm importing and running a simple cell:
from moviepy.editor import VideoFileClip
from IPython.display import HTML
new_clip_output = 'test_output.mp4'
test_clip = VideoFileClip("test.mp4")
new_clip = test_clip.fl_image(lambda x: cv2.cvtColor(x, cv2.COLOR_RGB2YUV)) #NOTE: this function expects color images!!
%time new_clip.write_videofile(new_clip_output, audio=False)
The error is:
TypeError Traceback (most recent call last)
<ipython-input-8-27aee53c99d8> in <module>()
1 new_clip_output = 'test_output.mp4'
--> 2 test_clip = VideoFileClip("test.mp4")
3 new_clip = test_clip.fl_image(lambda x: cv2.cvtColor(x, cv2.COLOR_RGB2YUV)) #NOTE: this function expects color images!!
4 get_ipython().magic('time new_clip.write_videofile(new_clip_output, audio=False)')
/Users/<username>/anaconda3/envs/carnd-term1/lib/python3.5/site-packages/moviepy/video/io/VideoFileClip.py in __init__(self, filename, has_mask, audio, audio_buffersize, audio_fps, audio_nbytes, verbose)
80 buffersize= audio_buffersize,
81 fps = audio_fps,
--> 82 nbytes = audio_nbytes)
83
84 def __del__(self):
/Users/<username>/anaconda3/envs/carnd-term1/lib/python3.5/site-packages/moviepy/audio/io/AudioFileClip.py in __init__(self, filename, buffersize, nbytes, fps)
61 self.filename = filename
62 reader = FFMPEG_AudioReader(filename,fps=fps,nbytes=nbytes,
--> 63 buffersize=buffersize)
64
65 self.reader = reader
/Users/<username>/anaconda3/envs/carnd-term1/lib/python3.5/site-packages/moviepy/audio/io/readers.py in __init__(self, filename, buffersize, print_infos, fps, nbytes, nchannels)
68 self.buffer_startframe = 1
69 self.initialize()
--> 70 self.buffer_around(1)
71
72
/Users/<username>/anaconda3/envs/carnd-term1/lib/python3.5/site-packages/moviepy/audio/io/readers.py in buffer_around(self, framenumber)
232 else:
233 self.seek(new_bufferstart)
--> 234 self.buffer = self.read_chunk(self.buffersize)
235
236 self.buffer_startframe = new_bufferstart
/Users/<username>/anaconda3/envs/carnd-term1/lib/python3.5/site-packages/moviepy/audio/io/readers.py in read_chunk(self, chunksize)
121 result = (1.0*result / 2**(8*self.nbytes-1)).\
122 reshape((len(result)/self.nchannels,
--> 123 self.nchannels))
124 #self.proc.stdout.flush()
125 self.pos = self.pos+chunksize
TypeError: 'float' object cannot be interpreted as an integer
Is it because of some conflict in versions of various libraries?

Monte Carlo solver in parallel with QuTiP

I'm trying to run some code in QuTiP, but when I run a function in parallel with parfor I am getting an error.
results= parfor(func2, range(len(delta)))
Error:
AssertionError
Traceback (most recent call last)
<ipython-input-206-6c2ffcb32b4f> in <module>()
----> 1 results= parfor(func2, range(len(delta)))
/usr/lib/python2.7/dist-packages/qutip/parallel.pyc in parfor(func, *args, **kwargs)
119 try:
120 map_args = ((func, v, os.getpid()) for v in var)
--> 121 par_return = list(pool.map(task_func, map_args))
122
123 pool.terminate()
/usr/lib/python2.7/multiprocessing/pool.py in map(self, func, iterable, chunksize)
249 '''
250 assert self._state == RUN
--> 251 return self.map_async(func, iterable, chunksize).get()
252
253 def imap(self, func, iterable, chunksize=1):
/usr/lib/python2.7/multiprocessing/pool.py in get(self, timeout)
556 return self._value
557 else:
--> 558 raise self._value
559
560 def _set(self, i, obj):
AssertionError: daemonic processes are not allowed to have children
Here is my code:
def func2(x):
def H1_coeff(t,args):
return exp(-((t-4)/2.0) ** 2)
H0 = np.pi*w * a.dag() *a
Hi= delta[x]*(a.dag())
H = [H0, [Hi,H1_coeff]]
result = mesolve(H, psi0, tlist, c_ops, [])
numer=expect(n,result.states)
print delta[x], "done"
return numer
Does anybody know what's wrong here?
I think you need to move the definition of H1_coeff outside of func2.

Can't get Theano to link against CUDNN on OSX

After a big battle I was finally able to get Theano to use the GPU in OSX.
But now, I've tried everything I can remember and Theano still can't use CuDNN.
I installed CUDA version 7 and CUDNN version 3.
I tried copying the libraries to /usr/local/cuda/lib and also to /usr/local/cuda/lib64, the include file was copied to /usr/local/cuda/include
My .theanorc is
[global]
floatX = float32
device = gpu
force_device = True
allow_gc = False
optimizer_including=cudnn
# warn_float64 = warn
# openmp = True
[nvcc]
fastmath = True
flags = -L/Users/morgado/anaconda/lib/
[cuda]
root = /usr/local/cuda
[gcc]
cxxflags = -L/usr/local/cuda/lib64
And my .profile has the relevant parts:
# CUDA
CUDA_ROOT=/usr/local/cuda
export PATH=$CUDA_ROOT/bin:$PATH
export DYLD_LIBRARY_PATH=$CUDA_ROOT/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$CUDA_ROOT/lib:$CUDA_ROOT/lib64:$LD_LIBRARY_PATH
But still when I try to get Theano to use CUDNN the further I get (with the files in lib64) gives me the error:
Using gpu device 0: GeForce GT 750M
1 #include <Python.h>
2 #include <iostream>
3 #include "cudnn.h"
4 //////////////////////
5 //// Support Code
6 //////////////////////
7
8 #if PY_MAJOR_VERSION >= 3
9 #define PyInt_FromLong PyLong_FromLong
10 #endif
11
12
13 namespace {
14 struct __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715 {
15 PyObject* __ERROR;
16
17 PyObject* storage_V1;
18
19
20 __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715() {}
21 ~__struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715(void) {
22 cleanup();
23 }
24
25 int init(PyObject* __ERROR, PyObject* storage_V1) {
26 Py_XINCREF(storage_V1);
27 this->storage_V1 = storage_V1;
28
29
30
31 this->__ERROR = __ERROR;
32 return 0;
33 }
34 void cleanup(void) {
35 __label_1:
36
37 double __DUMMY_1;
38 __label_4:
39
40 double __DUMMY_4;
41
42 Py_XDECREF(this->storage_V1);
43 }
44 int run(void) {
45 int __failure = 0;
46
47 PyObject* py_V1;
48
49 PyObject* V1;
50
51 {
52
53 py_V1 = Py_None;
54 {Py_XINCREF(py_V1);}
55
56 V1 = NULL;
57
58 {
59 // Op class DnnVersion
60
61 #if defined(CUDNN_VERSION)
62 V1 = PyTuple_Pack(2, PyInt_FromLong(CUDNN_VERSION), PyInt_FromLong(cudnnGetVersion()));
63 #else
64 V1 = PyInt_FromLong(-1);
65 #endif
66 __label_3:
67
68 double __DUMMY_3;
69
70 }
71 __label_2:
72
73 if (!__failure) {
74
75 assert(py_V1->ob_refcnt > 1);
76 Py_DECREF(py_V1);
77 py_V1 = V1 ? V1 : Py_None;
78 Py_INCREF(py_V1);
79
80 PyObject* old = PyList_GET_ITEM(storage_V1, 0);
81 {Py_XINCREF(py_V1);}
82 PyList_SET_ITEM(storage_V1, 0, py_V1);
83 {Py_XDECREF(old);}
84 }
85
86 Py_XDECREF(V1);
87
88 {Py_XDECREF(py_V1);}
89
90 double __DUMMY_2;
91
92 }
93
94
95 if (__failure) {
96 // When there is a failure, this code puts the exception
97 // in __ERROR.
98 PyObject* err_type = NULL;
99 PyObject* err_msg = NULL;
100 PyObject* err_traceback = NULL;
101 PyErr_Fetch(&err_type, &err_msg, &err_traceback);
102 if (!err_type) {err_type = Py_None;Py_INCREF(Py_None);}
103 if (!err_msg) {err_msg = Py_None; Py_INCREF(Py_None);}
104 if (!err_traceback) {err_traceback = Py_None; Py_INCREF(Py_None);}
105 PyObject* old_err_type = PyList_GET_ITEM(__ERROR, 0);
106 PyObject* old_err_msg = PyList_GET_ITEM(__ERROR, 1);
107 PyObject* old_err_traceback = PyList_GET_ITEM(__ERROR, 2);
108 PyList_SET_ITEM(__ERROR, 0, err_type);
109 PyList_SET_ITEM(__ERROR, 1, err_msg);
110 PyList_SET_ITEM(__ERROR, 2, err_traceback);
111 {Py_XDECREF(old_err_type);}
112 {Py_XDECREF(old_err_msg);}
113 {Py_XDECREF(old_err_traceback);}
114 }
115 // The failure code is returned to index what code block failed.
116 return __failure;
117
118 }
119 };
120 }
121
122
123 static int __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715_executor(__struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715 *self) {
124 return self->run();
125 }
126
127 static void __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715_destructor(PyObject *capsule) {
128 __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715 *self = (__struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715 *)PyCapsule_GetContext(capsule);
129 delete self;
130 }
131
132 //////////////////////
133 //// Functions
134 //////////////////////
135 static PyObject * instantiate(PyObject * self, PyObject *argtuple) {
136 assert(PyTuple_Check(argtuple));
137 if (2 != PyTuple_Size(argtuple)){
138 PyErr_Format(PyExc_TypeError, "Wrong number of arguments, expected 2, got %i", (int)PyTuple_Size(argtuple));
139 return NULL;
140 }
141 __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715* struct_ptr = new __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715();
142 if (struct_ptr->init( PyTuple_GET_ITEM(argtuple, 0),PyTuple_GET_ITEM(argtuple, 1) ) != 0) {
143 delete struct_ptr;
144 return NULL;
145 }
146 PyObject* thunk = PyCapsule_New((void*)(&__struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715_executor), NULL, __struct_compiled_op_m086964a2c5561b842ea4c5d4a203a715_destructor);
147 if (thunk != NULL && PyCapsule_SetContext(thunk, struct_ptr) != 0) {
148 PyErr_Clear();
149 Py_DECREF(thunk);
150 thunk = NULL;
151 }
152
153 return thunk; }
154
155 //////////////////////
156 //// Module init
157 //////////////////////
158 static PyMethodDef MyMethods[] = {
159 {"instantiate", instantiate, METH_VARARGS, "undocumented"} ,
160 {NULL, NULL, 0, NULL}
161 };
162 static struct PyModuleDef moduledef = {
163 PyModuleDef_HEAD_INIT,
164 "m086964a2c5561b842ea4c5d4a203a715",
165 NULL,
166 -1,
167 MyMethods,
168 };
169
170 PyMODINIT_FUNC PyInit_m086964a2c5561b842ea4c5d4a203a715(void) {
171 PyObject *m = PyModule_Create(&moduledef);
172 return m;
173 }
174
===============================
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
clang: warning: argument unused during compilation: '-undefined dynamic_lookup'
ld: library not found for -lcudnn
clang: error: linker command failed with exit code 1 (use -v to see invocation)
['nvcc', '-shared', '-O3', '-L/Users/morgado/anaconda/lib/', '-use_fast_math', '-arch=sm_30', '-m64', '-Xcompiler', '-fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=m11b90075e2397c684f9dc0f7276eab8f,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC', '-Xlinker', '-rpath,/Users/morgado/.theano/compiledir_Darwin-14.4.0-x86_64-i386-64bit-i386-3.4.3-64/cuda_ndarray', '-Xlinker', '-rpath,/usr/local/cuda/lib', '-I/Users/morgado/anaconda/lib/python3.4/site-packages/numpy/core/include', '-I/Users/morgado/anaconda/include/python3.4m', '-I/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda', '-o', '/Users/morgado/.theano/compiledir_Darwin-14.4.0-x86_64-i386-64bit-i386-3.4.3-64/tmp578d03tw/m086964a2c5561b842ea4c5d4a203a715.so', 'mod.cu', '-lcudnn', '-lcudart', '-Xcompiler', '-undefined,dynamic_lookup', '-Xlinker', '-pie']
ERROR (theano.gof.opt): SeqOptimizer apply <theano.sandbox.cuda.dnn.NoCuDNNRaise object at 0x10ebb14e0>
ERROR (theano.gof.opt): Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/opt.py", line 196, in apply
sub_prof = optimizer.optimize(fgraph)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/opt.py", line 82, in optimize
ret = self.apply(fgraph, *args, **kwargs)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda/dnn.py", line 1682, in apply
if not dnn_available():
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda/dnn.py", line 75, in dnn_available
v = version()
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda/dnn.py", line 206, in version
theano.Mode(optimizer=None))
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/compile/function.py", line 266, in function
profile=profile)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/compile/pfunc.py", line 511, in pfunc
on_unused_input=on_unused_input)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/compile/function_module.py", line 1466, in orig_function
defaults)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/compile/function_module.py", line 1324, in create
input_storage=input_storage_lists)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/link.py", line 519, in make_thunk
output_storage=output_storage)[:3]
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/vm.py", line 897, in make_all
no_recycling))
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda/__init__.py", line 259, in make_thunk
compute_map, no_recycling)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/op.py", line 739, in make_thunk
output_storage=node_output_storage)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/cc.py", line 1073, in make_thunk
keep_lock=keep_lock)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/cc.py", line 1015, in __compile__
keep_lock=keep_lock)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/cc.py", line 1442, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/cmodule.py", line 1076, in module_from_key
module = lnk.compile_cmodule(location)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/gof/cc.py", line 1354, in compile_cmodule
preargs=preargs)
File "/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda/nvcc_compiler.py", line 423, in compile_str
'for cmd', ' '.join(cmd))
Exception: ('The following error happened while compiling the node', <theano.sandbox.cuda.dnn.DnnVersion object at 0x11549af98>(), '\n', 'nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -L/Users/morgado/anaconda/lib/ -use_fast_math -arch=sm_30 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=m11b90075e2397c684f9dc0f7276eab8f,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC -Xlinker -rpath,/Users/morgado/.theano/compiledir_Darwin-14.4.0-x86_64-i386-64bit-i386-3.4.3-64/cuda_ndarray -Xlinker -rpath,/usr/local/cuda/lib -I/Users/morgado/anaconda/lib/python3.4/site-packages/numpy/core/include -I/Users/morgado/anaconda/include/python3.4m -I/Users/morgado/anaconda/lib/python3.4/site-packages/theano/sandbox/cuda -o /Users/morgado/.theano/compiledir_Darwin-14.4.0-x86_64-i386-64bit-i386-3.4.3-64/tmp578d03tw/m086964a2c5561b842ea4c5d4a203a715.so mod.cu -lcudnn -lcudart -Xcompiler -undefined,dynamic_lookup -Xlinker -pie', '[<theano.sandbox.cuda.dnn.DnnVersion object at 0x11549af98>()]'
Seems like clang is not getting the cudnn library even when I specifically told it to check that path.
In your profile add:
export LIBRARY_PATH=$CUDA_ROOT/lib:$CUDA_ROOT/lib64:$LIBRARY_PATH
Including the lib on LIBRARY_PATH worked for me.
I had the same problem and could fix it by setting
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-7.5/lib:$DYLD_LIBRARY_PATH
in my .bashrc and running
sudo update_dyld_shared_cache
afterwards.

Resources