resolving X-related SDK compile problems

Hello to everyone. I think CUDA has a great community already and I am so glad to join as this is my first post.

I would like to post my experiences while I try to compile SDK examples.

We have a Centos 5 machine with Quadro FX-570 card in the lab.

After installing beta 174.55 driver, toolkit and SDK; I compiled non-graphic examples with no problem.

Then I had to download & compile glut for graphical ones.

And after that Centos gave me errors like:

Undefined reference to “XOpenDevice” “XFreeDeviceList” bla bla bla…

After some googling I found this is because it is not linked with X libraries so I had to

manually edit the common.mk file which is included from the Makefiles of the examples.

The change that I made:

after the USEGLLIB check (ifeq check)

i added the red options

OPENGLLIB:= -lXmu -lXi -lGL -lGLU

But now it said it cant find libXi.

When I check /usr/lib I saw that I had to make a sym.link from libXi.so.6 to libXi.so

This resolved my problems.

Hope this helps to some other people.

The only example not working right now is threadMigration. I will look into it after lunch:) [i am already late]

I had no compile problems on our RHEL5 systems with 2.0b. You just need to make sure you have all the libs and devel packages installed. No modification of common.mk is necessary.

As for the compile problem with threadMigration.cpp here’s a diff that will fix the errors, warnings still remain but it will compile and run:

--- threadMigration.cpp 2008-06-11 13:45:06.051000000 -0500

+++ threadMigration.cpp.bak     2008-06-11 13:33:46.390000000 -0500

@@ -97,8 +97,6 @@

     CUmodule   hcuModule   = 0;

     CUfunction hcuFunction = 0;

-    char *module_path = cutFindFilePath("threadMigration.cubin", argv);

-

     // cuCtxCreate: Function works on floating contexts and current context

     CUresult status = cuCtxCreate( &hcuContext, 0, hcuDevice );

     if ( CUDA_SUCCESS != status ) {

@@ -113,6 +111,7 @@

                goto Error;

     }

+    char *module_path = cutFindFilePath("threadMigration.cubin", argv);

     if (module_path == NULL) {

         fprintf( stderr, "cutFindFilePath() unable to find threadMigration.cubin\n" );

         goto Error;