Building 0.4.2 OS X

Hi

I am trying to build JCuda 0.4.2 on OS X. I have CUDA 4.2 drivers and the SDK installed. When I run

cmake -G “Xcode” CMakeLists.txt

or

cmake -G “Unix Makefiles” CMakeLists.txt

I get the following error

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_CUDPP_HASH_LIBRARY (ADVANCED)
linked by target “JCudpp-apple-x86_64” in directory /Users/conrad/Downloads/JCuda-All-0.4.2-src/JCudppJNI
CUDA_CUDPP_INCLUDE_DIR (ADVANCED)
used as include directory in directory /Users/conrad/Downloads/JCuda-All-0.4.2-src/JCudppJNI
CUDA_CUDPP_LIBRARY (ADVANCED)
linked by target “JCudpp-apple-x86_64” in directory /Users/conrad/Downloads/JCuda-All-0.4.2-src/JCudppJNI

In the readme it says I need the SDK installed for the cudapp library, which I have, but I have no idea how to set the value for these variables.

Please could you advise.

Conrad Winchester

Hello

Sorry, I just noticed that this information from the Readme.txt is slightly out-dated: The CUDPP library was part of the CUDA SDK for a while, but unfortunately, in the latest versions, NVIDIA does no longer include the CUDPP library in the SDK -_- So in order to compile the native JCudpp libraries, you may also have to manually compile the CUDPP library. This is also menitoned on the JCudpp site, but I’ll have to update the Readme.txt accordingly.

So concerning the error message: Admittedly, I’d also have to look up how to set these from the command line - usually, I use “cmake-gui”, which allows you to select them in a nice GUI.
One option could be to use
set(CUDA_CUDPP_HASH_LIBRARY path/and/filename)
in the CMakeLists.txt. Alternatively, it should ask for these options when you start it with the “-i” parameter. But I assume that there is a cmake-gui on MacOS as well…?

Actually, I even considered splitting JCudpp from the “core” JCuda libraries, because compiling it may be a hassle, and I think that there are not many people who really want to use it. Are you planning to use JCudpp specifically? Maybe I can create an alternative CMakeList.txt, where CUDPP is omitted.

Sorry for the inconveniences…
Marco

EDIT: Just to clarify this, in case you want to compile CUDPP: There will be two libraries created when compiling CUDPP. One is the main CUDPP library, and one is the library containing the hashtable functions. The variables that CUDPP complained about have to point to these files, and to the CUDPP include directory, respectively.

Thanks

I will try a build today and let you know if I succeed.

I’ll send you the jars too.

Conrad

Hello

Actually, the JARs do not need to be modified or recompiled. The existing JARs just try to load different native libraries on different operating systems. But I don’t have access to a Mac or Linux, so any native libraries for these OSes are appreciated.

bye
Marco

[QUOTE=Marco13]
So concerning the error message: Admittedly, I’d also have to look up how to set these from the command line - usually, I use “cmake-gui”, which allows you to select them in a nice GUI.
One option could be to use
set(CUDA_CUDPP_HASH_LIBRARY path/and/filename)
in the CMakeLists.txt. Alternatively, it should ask for these options when you start it with the “-i” parameter. But I assume that there is a cmake-gui on MacOS as well…?

EDIT: Just to clarify this, in case you want to compile CUDPP: There will be two libraries created when compiling CUDPP. One is the main CUDPP library, and one is the library containing the hashtable functions. The variables that CUDPP complained about have to point to these files, and to the CUDPP include directory, respectively.[/QUOTE]

Thanks for the hint, I’m getting the same error messages in Kubuntu 11.04, cuda 4.2.

I dowloaded cudpp and generated cudpp makefiles using cmake-gui setting the option to generate shared objects. Otherwise make in Jcuda complains:

Linking CXX shared library …/lib/libJCudpp-linux-x86_64.so
/usr/bin/ld: /cudpp_src_2.0/lib/libcudpp.a(cudpp_plan.cpp.o): relocation R_X86_64_32S against `.rodata’ can not be used when making a shared object; recompile with -fPIC
cudpp_src_2.0/lib/libcudpp.a: could not read symbols: Bad value

Another minor problem is that cudpp makefiles do not install cudpp_config.h in /usr/local/include, and make in Jcuda complains with CUDA_CUDPP_INCLUDE_DIR set as

Variable Name: CUDA_CUDPP_INCLUDE_DIR
Description: Location of cudpp.h
Current Value: /usr/local/include

This is a known minor issue with make install in cudpp.

ww

I’ll probably split the libraries, into the “Core” Libraries (which are supported by the NVIDIA Toolkit itself) and “Extension” libraries, like CUDPP or others that are not contained in the Toolkit (or not yet fully supported, like NPP). Compiling CUDPP and JCudpp is often rather complicated…