Mac os x lion compilation error


#1

Hi,
after installation of cudpp to /usr/local, the compilation of jcuda 0.4.2 fails in linking libjCudpp; here is the complete log, Please help:
admin@admins-Mac-Pro:/Users/Projects/JCuda/JCuda-All-0.4.2-src$ ls /usr/local/lib/
cudpp-config-version.cmake cudpp-targets-noconfig.cmake libcudpp.a
cudpp-config.cmake cudpp-targets.cmake libcudpp_hash.a

admin@admins-Mac-Pro:/Users/Projects/JCuda/JCuda-All-0.4.2-src$ ls /usr/local/include/
cudpp.h cudpp_config.h cudpp_hash.h

admin@admins-Mac-Pro:/Users/Projects/JCuda/JCuda-All-0.4.2-src$ cmake -G “Unix Makefiles” CMakeLists.txt
– The C compiler identification is GNU 4.2.1
– The CXX compiler identification is Clang 4.0.0
– Checking whether C compiler has -isysroot
– Checking whether C compiler has -isysroot - yes
– Checking whether C compiler supports OSX deployment target flag
– Checking whether C compiler supports OSX deployment target flag - yes
– Check for working C compiler: /usr/bin/gcc
– Check for working C compiler: /usr/bin/gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Found CUDA: /usr/local/cuda (Required is at least version “4.0”)
– Found JNI: -framework JavaVM
– Configuring done
– Generating done
– Build files have been written to: /Users/Projects/JCuda/JCuda-All-0.4.2-src

admin@admins-Mac-Pro:/Users/Projects/JCuda/JCuda-All-0.4.2-src$ make -j8
Scanning dependencies of target CommonJNI
[ 25%] [ 25%] [ 25%] Building CXX object CommonJNI/CMakeFiles/CommonJNI.dir/src/PointerUtils.cpp.o
Building CXX object CommonJNI/CMakeFiles/CommonJNI.dir/src/Logger.cpp.o
Building CXX object CommonJNI/CMakeFiles/CommonJNI.dir/src/JNIUtils.cpp.o
/Users/Projects/JCuda/JCuda-All-0.4.2-src/CommonJNI/src/PointerUtils.cpp:112:9: warning: delete called on ‘PointerData’ that is abstract but has
non-virtual destructor [-Wdelete-non-virtual-dtor]
delete pointerData;
^
/Users/Projects/JCuda/JCuda-All-0.4.2-src/CommonJNI/src/PointerUtils.cpp:173:23: warning: comparison between NULL and non-pointer
(‘jlong’ (aka ‘long long’) and NULL) [-Wnull-arithmetic]
if (nativePointer != NULL)
~~~~~~~~~~~~~ ^ ~~~~
/Users/Projects/JCuda/JCuda-All-0.4.2-src/CommonJNI/src/PointerUtils.cpp:257:5: warning: delete called on ‘PointerData’ that is abstract but has
non-virtual destructor [-Wdelete-non-virtual-dtor]
delete pointerData;
^
/Users/Projects/JCuda/JCuda-All-0.4.2-src/CommonJNI/src/PointerUtils.cpp:299:23: warning: comparison between NULL and non-pointer
(‘jlong’ (aka ‘long long’) and NULL) [-Wnull-arithmetic]
if (nativePointer != NULL)
~~~~~~~~~~~~~ ^ ~~~~
4 warnings generated.
Linking CXX static library …/lib/libCommonJNI.a
[ 25%] Built target CommonJNI
Scanning dependencies of target JCudaRuntime-apple-x86_64
Scanning dependencies of target JCudaDriver-apple-x86_64
Scanning dependencies of target JCublas2-apple-x86_64
Scanning dependencies of target JCublas-apple-x86_64
Scanning dependencies of target JCurand-apple-x86_64
Scanning dependencies of target JCufft-apple-x86_64
Scanning dependencies of target JCusparse-apple-x86_64
Scanning dependencies of target JCusparse2-apple-x86_64
[ 33%] Building CXX object JCusparseJNI/CMakeFiles/JCusparse-apple-x86_64.dir/src/JCusparse.cpp.o
[ 50%] [ 50%] [ 58%] [ 66%] Building CXX object JCusparse2JNI/CMakeFiles/JCusparse2-apple-x86_64.dir/src/JCusparse2.cpp.o
Building CXX object JCublas2JNI/CMakeFiles/JCublas2-apple-x86_64.dir/src/JCublas2.cpp.o
[ 75%] Building CXX object JCurandJNI/CMakeFiles/JCurand-apple-x86_64.dir/src/JCurand.cpp.o
Building CXX object JCufftJNI/CMakeFiles/JCufft-apple-x86_64.dir/src/JCufft.cpp.o
Building CXX object JCudaDriverJNI/CMakeFiles/JCudaDriver-apple-x86_64.dir/src/JCudaDriver.cpp.o
[ 83%] [ 91%] Building CXX object JCudaRuntimeJNI/CMakeFiles/JCudaRuntime-apple-x86_64.dir/src/JCudaRuntime.cpp.o
Building CXX object JCublasJNI/CMakeFiles/JCublas-apple-x86_64.dir/src/JCublas.cpp.o
Linking CXX shared library …/lib/libJCufft-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCurand-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCudaDriver-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCudaRuntime-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCusparse-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCublas-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCusparse2-apple-x86_64.dylib
Linking CXX shared library …/lib/libJCublas2-apple-x86_64.dylib
[ 91%] [ 91%] [ 91%] Built target JCusparse2-apple-x86_64
Built target JCusparse-apple-x86_64
Built target JCudaDriver-apple-x86_64
Scanning dependencies of target JCudpp-apple-x86_64
[ 91%] Built target JCudaRuntime-apple-x86_64
[100%] Building CXX object JCudppJNI/CMakeFiles/JCudpp-apple-x86_64.dir/src/JCudpp.cpp.o
Linking CXX shared library …/lib/libJCudpp-apple-x86_64.dylib
Undefined symbols for architecture x86_64:
“cudppHashTable(unsigned long, unsigned long*, CUDPPHashTableConfig const*)”, referenced from:
_Java_jcuda_jcudpp_JCudpp_cudppHashTableNative in JCudpp.cpp.o
"cudppHashInsert(unsigned long, void const*, void const*, unsigned long)", referenced from:
_Java_jcuda_jcudpp_JCudpp_cudppHashInsertNative in JCudpp.cpp.o
"cudppHashRetrieve(unsigned long, void const*, void*, unsigned long)", referenced from:
_Java_jcuda_jcudpp_JCudpp_cudppHashRetrieveNative in JCudpp.cpp.o
"cudppDestroyHashTable(unsigned long, unsigned long)", referenced from:
_Java_jcuda_jcudpp_JCudpp_cudppDestroyHashTableNative in JCudpp.cpp.o
"cudppMultivalueHashGetAllValues(unsigned long, unsigned int**)", referenced from:
_Java_jcuda_jcudpp_JCudpp_cudppMultivalueHashGetAllValuesNative in JCudpp.cpp.o
"cudppMultivalueHashGetValuesSize(unsigned long, unsigned int*)", referenced from:
_Java_jcuda_jcudpp_JCudpp_cudppMultivalueHashGetValuesSizeNative in JCudpp.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libJCudpp-apple-x86_64.dylib] Error 1
make[1]: *** [JCudppJNI/CMakeFiles/JCudpp-apple-x86_64.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[100%] Built target JCublas2-apple-x86_64
[100%] Built target JCublas-apple-x86_64
[100%] Built target JCurand-apple-x86_64
[100%] Built target JCufft-apple-x86_64
make: *** [all] Error 2


#2

Hello

The error message does not say much, only reporting “Undefined symbols”. Did the CUDPP compilation work without any issues? (At least on Windows, there was some hassle: Even for 32bit, it reuqires a 64bit machine for building). Note that CUDPP has to be compiled as a library, and not as an application.
However, the “Undefined symbols” are all referring to the new hashing functions that have been introduced in CUDPP 2.0 (and no “Undefined symbols” are reported for the other CUDPP functions). CMake should ask for two CUDPP libraries during the configuration: The main ‘cudpp’ library, and the ‘cudpp_hash’ library. Did you specify the latter as an input?

BTW: If you don’t specifically need JCudpp, you may also omit it (in doubt, by just removing the line
add_subdirectory(JCudppJNI)
from the main CMake file)

bye
Marco


#3

Hello,
the library cudpp was compiled and installed without any errors.
teh $DYLD_LIBRARY_PATH was modified to add /usr/local/lib where cudpp libraries were installed
here is the log:
admin@admins-Mac-Pro:/Users/Projects/cpp/cudpp/cudpp_src_2.0$ cmake -G “Unix Makefiles” CMakeLists.txt
– The C compiler identification is GNU 4.2.1
– The CXX compiler identification is Clang 4.0.0
– Checking whether C compiler has -isysroot
– Checking whether C compiler has -isysroot - yes
– Checking whether C compiler supports OSX deployment target flag
– Checking whether C compiler supports OSX deployment target flag - yes
– Check for working C compiler: /usr/bin/gcc
– Check for working C compiler: /usr/bin/gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Found CUDA: /usr/local/cuda (found version “4.2”)
– Configuring done
– Generating done
– Build files have been written to: /Users/Projects/cpp/cudpp/cudpp_src_2.0

admin@admins-Mac-Pro:/Users/Projects/cpp/cudpp/cudpp_src_2.0$ make -j8
[ 31%] [ 27%] [ 22%] [ 36%] [ 36%] [ 36%] [ 36%] [ 22%] Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_compact_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_reduce_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_rand_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_spmvmult_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_scan_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_radixsort_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_segmented_scan_app.cu.o
Building NVCC (Device) object src/cudpp/CMakeFiles/cudpp.dir/app/./cudpp_generated_tridiagonal_app.cu.o
ptxas /tmp/tmpxft_00008a1a_00000000-7_tridiagonal_app.compute_10.ptx, line 609; warning : Double is not supported. Demoting to float
ptxas /tmp/tmpxft_00008a1c_00000000-2_compact_app.compute_10.ptx, line 2771; warning : Double is not supported. Demoting to float
ptxas /tmp/tmpxft_00008a1d_00000000-7_reduce_app.compute_10.ptx, line 23142; warning : Double is not supported. Demoting to float
ptxas /tmp/tmpxft_00008a1e_00000000-7_scan_app.compute_10.ptx, line 39590; warning : Double is not supported. Demoting to float
ptxas /tmp/tmpxft_00008b8c_00000000-2_radixsort_app.compute_10.ptx, line 766; warning : Double is not supported. Demoting to float
ptxas /tmp/tmpxft_00008a1b_00000000-2_segmented_scan_app.compute_10.ptx, line 192591; warning : Double is not supported. Demoting to float
Scanning dependencies of target cudpp
[ 50%] [ 50%] [ 50%] Building CXX object src/cudpp/CMakeFiles/cudpp.dir/cudpp_manager.cpp.o
Building CXX object src/cudpp/CMakeFiles/cudpp.dir/cudpp.cpp.o
Building CXX object src/cudpp/CMakeFiles/cudpp.dir/cudpp_plan.cpp.o
Linking CXX static library …/…/lib/libcudpp.a
[ 50%] Built target cudpp
[ 63%] [ 63%] [ 72%] [ 72%] [ 72%] Building NVCC (Device) object src/cudpp_hash/CMakeFiles/cudpp_hash.dir//./cudpp_hash_generated_hash_multivalue.cu.o
Building NVCC (Device) object src/cudpp_hash/CMakeFiles/cudpp_hash.dir//./cudpp_hash_generated_hash_table.cu.o
Building NVCC (Device) object src/cudpp_hash/CMakeFiles/cudpp_hash.dir//./cudpp_hash_generated_hash_functions.cu.o
Building NVCC (Device) object src/cudpp_hash/CMakeFiles/cudpp_hash.dir//./cudpp_hash_generated_hash_compacting.cu.o
Building NVCC (Device) object src/cudpp_hash/CMakeFiles/cudpp_hash.dir//./cudpp_hash_generated_debugging.cu.o
Scanning dependencies of target cudpp_hash
[ 86%] [ 90%] [ 95%] [ 95%] [100%] [100%] Building CXX object src/cudpp_hash/CMakeFiles/cudpp_hash.dir/cudpp_hash.cpp.o
Building CXX object src/cudpp_hash/CMakeFiles/cudpp_hash.dir/mt19937ar.cpp.o
Building CXX object src/cudpp_hash/CMakeFiles/cudpp_hash.dir/hash_compacting.cpp.o
Building CXX object src/cudpp_hash/CMakeFiles/cudpp_hash.dir/debugging.cpp.o
Building CXX object src/cudpp_hash/CMakeFiles/cudpp_hash.dir/hash_multivalue.cpp.o
Building CXX object src/cudpp_hash/CMakeFiles/cudpp_hash.dir/hash_table.cpp.o
Linking CXX static library …/…/lib/libcudpp_hash.a
[100%] Built target cudpp_hash

admin@admins-Mac-Pro:/Users/Projects/cpp/cudpp/cudpp_src_2.0$ ls lib
cudpp-config-version.cmake cudpp-config.cmake.install libcudpp.a
cudpp-config.cmake cudpp-targets.cmake libcudpp_hash.a

Thanks for the help


#4

OK, I can’t see what might be wrong there. It seems to properly generate the cudpp_hash library.

And when you start cmake-gui for configuring the JCuda build, it should print something like


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-linux-x86" in directory /home/user/Develop/JCuda-All-0.4.2-src/JCudppJNI
CUDA_CUDPP_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/user/Develop/JCuda-All-0.4.2-src/JCudppJNI
CUDA_CUDPP_LIBRARY (ADVANCED)
    linked by target "JCudpp-linux-x86" in directory /home/user/Develop/JCuda-All-0.4.2-src/JCudppJNI

Did you change the appropriate entries in the parameter list from
CUDA_CUDPP_INCLUDE_DIR-NOTFOUND —to—> The complete path to the cudpp include directory
CUDA_CUDPP_HASH_LIBRARY-NOTFOUND —to—> The complete path to the cudpp_hash.a file and
CUDA_CUDPP_LIBRARY-NOTFOUND —to—> The complete path to the cudpp.a file
?
(I still don’t understand why it should only complain about the hash-functions, and not about the other CUDPP functions…)

(I’ll probably omit JCudpp in future releases. It’s always a hassle compiling it, and probably not used by many people anyhow. It might be one of several, so to say, “extension” libraries, which could include CUDPP, NPP, and probably others in the future…)

bye
Marco