Set GLPATH permanently

CUDA sample code requires a compound command line statement for compiling OpenGL-based samples:

GLPATH=/usr/lib make

Not exactly sure how that particular command works (pointer to docs would be useful here). Setting GLPATH manually does not work.

Is there a way to set GLPATH permanently, or does this really need to be part of the ‘make’ command line? (Not sure why that would be the case)

It’s an environment variable. To set it “permanently” you could:

  1. Just do

export GLPATH=/usr/lib

and then it will be set for as long as you are logged in, but only in the shell/command prompt where you issue it. For instance, after doing that, in the same shell/command prompt, if you just typed make, it should behave the same way as if you typed GLPATH=/usr/lib make

  1. edit some file like .bashrc to add that export command “permanently”, i.e. to make it effective for any login under that user name.

Note that discussion of environment variables is really just about linux, not about CUDA specifically, so google is your friend.

Having said all that, this specific environment variable should really only be needed when using a particular Makefile. It is not needed generally to make OpenGL “work”.