Conversion of Windows Project to work on OS X Errors in Link Stage as well as Confusion over uint

Hi All,

I am going to be using a framework for Agent Based Modelling with CUDA that the developer has running on a windows machine. I am trying to convert the compilation and linking of the project so that it will work on OS X. To do this I want to create a makefile that will duplicate the actions taken in the build script that visual studio uses to create the executable. I am having errors at the link stage however:

[font=“Courier New”]nvcc -L/usr/local/cuda/lib -L/Developer/CUDA/common/lib -L/Developer/CUDA/CUDPP/common/lib main.o io.o FLAMEGPU_kernals.o radix_Kernals.o simulation.o -o main

ld: duplicate symbol ___device_stub__Z25RadixAddOffsetsAndShuffleP12KeyValuePairS

0_jji in simulation.o and radix_Kernals.o

collect2: ld returned 1 exit status[/font]

Needless to say, I do not really understand what is going on here since I do not understand the code, I am merely trying to get the framework to compile with a simple implementation. I thought that it may have something to do with linking libraries based on similar problems in another thread http://forums.nvidia.com/index.php?showtop…mp;#entry486011

I had to change a few things to get the code to compile and perhaps this might be a cause of the problem also:

    The CUT_DEVICE_INIT function passed 2 arguments but takes 0, so I removed the two parameters wherever this was used

    strcpy_s was used, however I just changed it to strcpy as strcpy_s is an MS extension

    uint is used, however I have found it is used in some of the SDK examples and cannot find the header file that it is declared in, so I changed the declaration of all uint to unsigned integer, I do not know if this is not correct.

Any of these three changes could feasibly cause an error in linking, but as a CUDA novice I am not sure if this is true. As you can see in the compile switches I have added the CUDA libraries to link, but I do not know if this is correct, I have tried to link with and without, but there is no difference in error message. Does anyone have any ideas to the cause of the link error? I have a makefile but the forum won’t let me upload it, I can provide it if anyone thinks that it may be the culprit. I also have a file that is generated by visual studio that I have been working off to create the makefile, so the error could be caused by inconsistency between the syntax for compilation and linking in windows vs unix (Mac OS X)

Many thanks,

Lawrence
BuildLog.htm (16.6 KB)