2

I have installed ArrayFire and am trying to get it working within Canopy. I followed these instructions and entered

export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH

in a Canopy terminal (launched using the 'Tools' menu). Directory /usr/local is the one where ArrayFire libraries are:

 ls /usr/local/lib/libaf*

 /usr/local/lib/libaf.3.4.2.dylib
 /usr/local/lib/libafcpu.3.4.2.dylib
 /usr/local/lib/libafcuda.3.4.2.dylib
 /usr/local/lib/libafopencl.3.4.2.dylib
 /usr/local/lib/libaf.3.dylib
 /usr/local/lib/libafcpu.3.dylib    
 /usr/local/lib/libafcuda.3.dylib
 /usr/local/lib/libafopencl.3.dylib
 /usr/local/lib/libaf.dylib
 /usr/local/lib/libafcpu.dylib
 /usr/local/lib/libafcuda.dylib
 /usr/local/lib/libafopencl.dylib

After pip-installing arrayfire in the terminal, running python and trying

import arrayfire

does not work:

 RuntimeError: Could not load any ArrayFire libraries.
 Please look at https://github.com/arrayfire/arrayfire-python/wiki for more information. 

I tried instructions in this post and also this one from Enthought support and created the following file ~/Library/LaunchAgents/environment.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>my.startup</string>
  <key>ProgramArguments</key>
  <array>
    <string>sh</string>
    <string>-c</string>
    <string>
    launchctl setenv DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH:/usr/local/lib
    </string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

without success.

Doing the same in a non-Canopy python is working ok, arrayfire can be imported.

Any idea?

Community
  • 1
  • 1
Yves Surrel
  • 193
  • 1
  • 10

0 Answers0