[go: up one dir, main page]

Menu

[r353]: / release-3 / configure.sh  Maximize  Restore  History

Download this file

145 lines (132 with data), 4.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# Check for nVidias CUDA compiler
echo "Testing for 'nvcc' compiler ..."
if test "$(which nvcc)" == ""
then
echo
echo "*** FAILED TO LOCATE CUDA COMPILER ***"
echo
echo "The CUDA compiler 'nvcc' is not in the current path."
echo "To compile cocolib and the examples, download and install the"
echo "CUDA toolkit version 4.2 or higher from the CUDA zone on"
echo
echo "www.nvidia.com".
echo
echo "After installation, make sure your PATH variable includes the"
echo "install path to the 'nvcc' executable (default /usr/local/cuda/bin)."
echo
exit
else
echo " nVidia CUDA compiler detected ... " `which nvcc`
fi
# Check for supported toolkit version
nvcc_test=$(nvcc --version | grep "release 4.2")
if [ -z "$nvcc_test" ]; then
echo "WARNING: CUDA toolkit is not version 4.2."
echo " If you have a lower version number,"
echo " you have to make sure to use gcc version 4.4"
echo " or older."
else
echo " CUDA toolkit version 4.2 detected."
fi
# Check if minimal example compiles
echo "Testing minimal example compilation ..."
nvcc -o ./config_tests/test_compute_capability ./config_tests/test_compute_capability.cu -lcudart
if [ $? -ne 0 ]; then
echo " ERROR: compiler returned an error."
exit
else
echo " compiled successfully."
fi
# Check compute capability of the device
./config_tests/test_compute_capability
if [ $? -lt 21 ]; then
echo "WARNING: Your GPU has compute capability less than 2.1."
echo " This is not supported by cocolib - some algorithms may fail."
else
echo " GPU compute capability at least 2.1, which is good."
fi
# Check for GSL library
echo "Testing for GSL library ..."
nvcc -o ./config_tests/test_gsl ./config_tests/test_gsl.cu -lgsl -lgslcblas
if [ $? -ne 0 ]; then
echo " ERROR: compiler returned an error."
echo " GSL library might not be installed."
echo " On Ubuntu systems, this is the package libgsl0-dev."
exit
else
echo " compiled successfully."
fi
./config_tests/test_gsl
if [ $? -ne 0 ]; then
echo "WARNING: GSL example returned an error code."
echo " Something might be wrong with the installation."
else
echo " run successfully."
fi
# Create new cocolib defs file
cp cocolib/defs.h.in cocolib/defs.h
rm -f extra_libs.inc
touch extra_libs.inc
# Check for ANN library
echo "Testing for ANN library ..."
nvcc -o ./config_tests/test_ann ./config_tests/test_ann.cu -lann
if [ $? -ne 0 ]; then
echo " failed to compile ANN library example."
echo " the library is probably not installed,"
echo " cocolib will compile without ANN support."
echo "//#define LIB_ANN" >> cocolib/defs.h
else
echo " compiled successfully, library seems to be installed."
echo "#define LIB_ANN" >> cocolib/defs.h
echo "LIBS += -lann" >> extra_libs.inc
fi
# Check for CUDPP library
echo "Testing for CUDPP library ..."
nvcc -o ./config_tests/test_cudpp ./config_tests/test_cudpp.cu -lcudpp
if [ $? -ne 0 ]; then
echo " failed to compile CUDPP library example."
echo " the library is probably not installed,"
echo " cocolib will compile without CUDPP support."
echo ""
echo " WARNING: this means all reduction operations"
echo " will run using a slow hack."
echo ""
echo " If you want to avoid this, you need"
echo " to manually install CUDPP from"
echo ""
echo " http://code.google.com/p/cudpp/"
echo ""
echo " an reconfigure cocolib."
echo ""
echo "//#define LIB_CUDPP" >> cocolib/defs.h
else
echo " compiled successfully, library seems to be installed."
echo "#define LIB_CUDPP" >> cocolib/defs.h
echo "LIBS += -lcudpp" >> extra_libs.inc
fi
echo "#endif" >> cocolib/defs.h
# QT4 development tools
echo "Testing for qt4 development tools ..."
qt4_test=$(qmake-qt4 --version | grep "version 4.")
if [ -z "$qt4_test" ]; then
echo " ERROR: failed to detect Qt4."
echo " Make sure you have libqt4-dev installed."
exit
else
echo " success."
fi
# run qmake to create Makefile
echo "Running 'qmake-qt4' for cocolib ..."
qmake-qt4 cocolib.pro
if [ $? -ne 0 ]; then
echo " ERROR: qmake-qt4 returned an error."
exit
else
echo " success."
fi
# clean up
echo "Cleaning up previous builds ..."
make --quiet clean
# done.
echo "Ready, run 'make' to build cocolib."