Compiling OpenMM on Ubuntu Linux
Posted: Wed Jul 14, 2010 1:51 pm
I'm having some problems compiling OpenMM (from the SVN rev 2355 and 2356) on two different Ubuntu Linux machines (10.04). One has a GTX 480 and the other has a GTX 260. Both machines have the Cuda 3.1 drivers and runtimes.
I've set LD_LIBRARY_PATH to point to the cuda lib and PATH to point to the cuda bin directory. When I run 'cmake .' from within the OpenMM directory, I get:
cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- 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
GPU check failed
Change Dir: /home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build
make[1]: Entering directory `/home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/has_cuda_gpu.c.o
/usr/bin/gcc -I/usr/local/cuda/include -o CMakeFiles/cmTryCompileExec.dir/has_cuda_gpu.c.o -c /home/jadelman/code/OpenMM_r2356/platforms/cuda/tests/has_cuda_gpu.c
Linking C executable cmTryCompileExec
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/usr/bin/gcc CMakeFiles/cmTryCompileExec.dir/has_cuda_gpu.c.o -o cmTryCompileExec -rdynamic /usr/local/cuda/lib/libcudart.so -Wl,-rpath,/usr/local/cuda/lib
/usr/local/cuda/lib/libcudart.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [cmTryCompileExec] Error 1
make[1]: Leaving directory `/home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec/fast] Error 2
-- Found OPENCL: /usr/lib/libOpenCL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jadelman/code/OpenMM_r2356
The line that reads "could not read symbols: File in wrong format" may be due to a 32 vs 64-bit issue, so I switch LD_LIBRARY_PATH to point to /usr/local/cuda/lib64 and start a fresh build, but cmake still populates CMakeCache.txt with references to the /lib directory.
I've also tried editing CMakeCache by hand to point to all of the proper cuda-related lib files, but I continue to get a message that the GPU check has failed (I also get No OpenCL platforms found.' errors, even if cmake finds /usr/lib64/libOpenCL.so). After hand-editing the CMakeCache file, I can get it to run through the make sequence, getting lines like:
[ 71%] Converting NVCC dependency to CMake (/home/jla65/code/OpenMM_r2355/src/cuda/kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp.depend)
[ 71%] Building (Device) NVCC /home/jla65/code/OpenMM_r2355/platforms/cuda/./src/kernels//kCalculateCDLJForces.cu: /home/jla65/code/OpenMM_r2355/src/cuda/kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp
Scanning dependencies of target OpenMMCuda
[ 72%] Building CXX object platforms/cuda/sharedTarget/CMakeFiles/OpenMMCuda.dir/__/src/kernels/rng.cpp.o
[ 72%] Building CXX object platforms/cuda/sharedTarget/CMakeFiles/OpenMMCuda.dir/__/src/kernels/gpu.cpp.o
but then it doesn't generate any of the Cuda tests for 'make test'.
I haven't had any problems with the cmake tool setting things up properly on various OSX platforms or a RHEL machine.
Does anyone have any advice on how to proceed on an Ubuntu machine or have had similar experiences?
I've set LD_LIBRARY_PATH to point to the cuda lib and PATH to point to the cuda bin directory. When I run 'cmake .' from within the OpenMM directory, I get:
cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- 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
GPU check failed
Change Dir: /home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build
make[1]: Entering directory `/home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/has_cuda_gpu.c.o
/usr/bin/gcc -I/usr/local/cuda/include -o CMakeFiles/cmTryCompileExec.dir/has_cuda_gpu.c.o -c /home/jadelman/code/OpenMM_r2356/platforms/cuda/tests/has_cuda_gpu.c
Linking C executable cmTryCompileExec
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/usr/bin/gcc CMakeFiles/cmTryCompileExec.dir/has_cuda_gpu.c.o -o cmTryCompileExec -rdynamic /usr/local/cuda/lib/libcudart.so -Wl,-rpath,/usr/local/cuda/lib
/usr/local/cuda/lib/libcudart.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [cmTryCompileExec] Error 1
make[1]: Leaving directory `/home/jadelman/code/OpenMM_r2356/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec/fast] Error 2
-- Found OPENCL: /usr/lib/libOpenCL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jadelman/code/OpenMM_r2356
The line that reads "could not read symbols: File in wrong format" may be due to a 32 vs 64-bit issue, so I switch LD_LIBRARY_PATH to point to /usr/local/cuda/lib64 and start a fresh build, but cmake still populates CMakeCache.txt with references to the /lib directory.
I've also tried editing CMakeCache by hand to point to all of the proper cuda-related lib files, but I continue to get a message that the GPU check has failed (I also get No OpenCL platforms found.' errors, even if cmake finds /usr/lib64/libOpenCL.so). After hand-editing the CMakeCache file, I can get it to run through the make sequence, getting lines like:
[ 71%] Converting NVCC dependency to CMake (/home/jla65/code/OpenMM_r2355/src/cuda/kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp.depend)
[ 71%] Building (Device) NVCC /home/jla65/code/OpenMM_r2355/platforms/cuda/./src/kernels//kCalculateCDLJForces.cu: /home/jla65/code/OpenMM_r2355/src/cuda/kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp
Scanning dependencies of target OpenMMCuda
[ 72%] Building CXX object platforms/cuda/sharedTarget/CMakeFiles/OpenMMCuda.dir/__/src/kernels/rng.cpp.o
[ 72%] Building CXX object platforms/cuda/sharedTarget/CMakeFiles/OpenMMCuda.dir/__/src/kernels/gpu.cpp.o
but then it doesn't generate any of the Cuda tests for 'make test'.
I haven't had any problems with the cmake tool setting things up properly on various OSX platforms or a RHEL machine.
Does anyone have any advice on how to proceed on an Ubuntu machine or have had similar experiences?