This command does not look right to me:
g++ -m64 -o shallowwater shallowwater.o shallowwatercudamain.o -L -lcudart
And this command does not look right to me:
g++ -m64 -o shallowwater shallowwater.o shallowwatercudamain.o -L -L/usr/local/cuda/lib64
This command looks right to me:
g++ -m64 -o shallowwater shallowwater.o shallowwatercudamain.o -L/usr/local/cuda/lib64 -lcudart
You need to tell g++ where to look for the cudart library, that is what the -L/usr/local/cuda/lib64
switch is for (so it needs a path, you cannot just use -L
by itself) and you need to tell g++ the name of the library to use, that is what the -lcudart
is for.