Back

# fatal error: FreeImage.h: No such file or directory #include “FreeImage.h” CentOS 7

fatal error: FreeImage.h: No such file or directory #include “FreeImage.h” CentOS 7

編譯mnistCUDNN,CuDnn的SAMPLE時出現問題,

cp -r /usr/src/cudnn_samples_v8/ $HOME
cd $HOME/cudnn_samples_v8/mnistCUDNN
# 
make clean && make

錯誤訊息:

test.c:1:23: fatal error: FreeImage.h: No such file or directory
 #include "FreeImage.h"
                       ^
compilation terminated.

原因

缺少freeimage這個library。

解決方法

安裝library,

sudo yum install freeimage
sudo yum install freeimage-devel

再編譯試試看:

make clean && make

成功編譯!

測試CuDnn

./mnistCUDNN
...
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 1.0000000 0.0000154 0.0000000 0.0000012 0.0000006

Result of classification: 1 3 5

Test passed!

顯示成功。

Licensed under CC BY-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy