MacOS – Help on setting path right

gpumacospath

I'm following these instructions to install CUDA on my Mac and need some help concerning path variables.

I already installed the package but need to set up the required environment variables:

export PATH=/Developer/NVIDIA/CUDA-6.0/bin:$PATH
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-6.0/lib:$DYLD_LIBRARY_PATH

I just followed the instructions from this site to set the environment variables but seemingly it doesn't work that way.

I mean does the folder containing my environment.plist file need to be in a specific directory? I just installed it to my home directory. Also I put in my plist file in the ROOT column the name of the variable (f.ex. PATH) and in the Value column I typed in the exact string which is specified above behind the "="-sign (f.ex. /Developer/NVIDIA/CUDA-6.0/bin:$PATH).

Best Answer

This is how it worked for me: 1. Render invisible files visible. 2. Then open the bash_profile in your home directory with any text editor and write down whatever you need to, f.ex.: 'export PATH = /this/is/some/complete/path/name:$PATH' Adding ':$PATH' lets the system search for other pathnames stored somewhere else (so do that only when editing system variables). ':' in general enables you to ad multiple paths. 3. Don't forget to reload the affected files by typing into the bash 'source /filename', for the changes to take effect.

Other problems you might encounter: When defining multiple variables be aware that it parses in order, so if you use f.ex. 'export PATH = $ANOTHERPATH/some/directory' make sure to define ANOTHERPATH before defining PATH.

And make sure you really know your OS's file system.