arm/tensorflowコンパイル問題要約

8654 ワード

1.undecl ared inclusion(s) in rule '@protobuf_archive//:python/google/protobuf/internal/_api_implementation.so':
missing dependency declarations for the following files included by 'external/protobuf/python/google/protobuf/internal/api_implementation.cc'
undeclared inclusion(s) in rule '@com_google_protobuf//:protoc_lib' 
undeclared inclusion(s) in rule '@protobuf_archive//:python/google/protobuf/internal/_api_implementation.so'
C++ compilation of rule '@boringssl//:crypto' failed (Exit 1): gcc failed: er
tensorflow use option -std=c99 or -std=gnu99 to compile your code
答え:1、bazel build --conlyopt=-std=c99  2、 gcc/g++ https://www.jianshu.com/p/8ac4e50d182d;https://blog.csdn.net/u011181989/article/details/91334478
 
2./lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found 
回答:参考https://www.jianshu.com/p/28a0c98027a8
https://blog.csdn.net/GUI1259802368/article/details/84934075
3.pythonインポートパケット時報エラーImportError:/lib 64/libstdc+.so.6: version `CXXABI_1.3.8'not foundの解決方法
回答:参考https://blog.csdn.net/zerow__/article/details/88845192
4. error: ‘dynamic_init_dummy_src_2fproto_2fgrpc_2fcore_2fstats_2eproto’ defined but not used [-Werror=unused-variable
回答:
エラーは次のとおりです.
/grpc/gens/src/proto/grpc/core/stats.pb.cc:187:13: error: ‘dynamic_init_dummy_src_2fproto_2fgrpc_2fcore_2fstats_2eproto’ defined but not used [-Werror=unused-variable]  static bool dynamic_init_dummy_src_2fproto_2fgrpc_2fcore_2fstats_2 eproto=[]()^cc 1 plus:all warnings being treated as errors Makefileを見つけ、その中から-Werrorを取り除き、再コンパイルします.
5.centos pythonソースインストールopencv 2.4.5
回答:参考https://blog.csdn.net/10km/article/details/52815957
6.error: 'for' loop initial declarations are only allowed in C99 mode;
tensorflow use option -std=c99 or -std=gnu99 to compile your code
答え:1、gcc/g++を高バージョンの参考にアップグレードするhttps://www.jianshu.com/p/8ac4e50d182d;https://blog.csdn.net/u011181989/article/details/91334478
2、または次の操作を行います.
gccコンパイルコードを使用すると、レポートされます.
error: 'for' loop initial declarations are only allowed in C99 mode
note: use option -std=c99 or -std=gnu99 to compile your code
これは、gccでforサイクルでインクリメンタルが直接初期化されているためです.
for(int i=0;i}この構文はgccでエラーであり、まずi変数を定義する必要があります.
int i; for(i=0;i   }
これは、gccがc 89規格に基づいて、C 99規格に変換すればforサイクル内でi変数を定義できるからである.
gcc src.c -std=c99 -o src
7.linux which: no javac in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
答:jdkをインストールし、インストール手順の参考
https://www.cnblogs.com/Warren-Zheng/p/8609214.html
8.LinuxでのOpenSSLのインストール
リファレンスhttps://blog.csdn.net/u013898698/article/details/79174029/
9.Bazelインストール
bazelのWebサイト:
https://github.com/bazelbuild/bazel/releases/tag
10.centos libgflagsのインストール
回答:
glogとgflags 1をインストールします.ダウンロード
git clone https://github.com/google/glog
2.構成
sudo apt-get install autoconf automake libtool
3.コンパイル&インストール
ソースルートディレクトリ(glogフォルダ)に入ります./autogen.sh  ./configure  make -j 24  sudo make install
4..gflagsのダウンロード
git clone https://github.com/gflags/gflags
ソースディレクトリ(gflagsフォルダ)cmakeにコンパイル&インストールする.  make -j 24  sudo make install
6.簡単な例
#include//#include int main(int argc,char*argv[]){//次のapiを使用するには、追加のgflagsをインストールし、上のコメントを追加するヘッダファイル//google::ParseCommandLineFlags(&argc,&argv,true);
   //Initialize Google's logging library.       google::InitGoogleLogging(argv[0]);  
//このディレクトリの下に「log」というフォルダを作成する必要があります.そうしないと、FLAGS_log_dir = "./log";    //or  google::SetLogDestination(google::GLOG_INFO, "./log_");  
    LOG(INFO) << "hello world";  
    return 0; }コンパイル時にglogのダイナミックライブラリを追加
例:g++test.cc -lglog -lgflags -lpthread -o test
注意、再度注意して、logディレクトリは事前に作成してからプログラムで指定しなければなりません.
その後、このプログラムを実行すると、logフォルダにファイルが見つかり、「hello world」に関するログ情報を記録できます.11.KERN_の修正DIRパス
 :    liunx    :uname -r
KERN_DIR=/usr/src/kernels/`uname -r`

12.kernel-devel.aarch 64インストール指定バージョン
13.centos included by 'external/grpc/src/core/lib/gpr/string_w
答え:grpcリファレンスのインストールhttps://www.jianshu.com/p/efc9167e7044
14.linuxでのコンパイル命令makeとmake clean
回答:
makeの場合、objectsが再生成されます.つまり、新しいobjectが上書きされるとobjectsが得られます.
make cleanは古いobjectsを削除します.
だからmakeにはmake cleanの機能が含まれているはずです.
しかし、実際に使用する場合は、たとえば複数回のコンパイルデバッグを実行したり、make cleanを一度にしなければならない場合があります.直接make、前回残したエラーはきれいにできないようです. 15.undeclared inclusion(s) in rule '@grpc//:alts_proto':
this rule is missing dependency declarations for the following files included by 'external/grpc/src/core/tsi/alts/handshaker/transport_security_common.pb.c'
回答:参考:https://stackoverflow.com/questions/35256110/tensorflow-build-fails-with-missing-dependency-error
Bazel complaints of system header files because compiler uses -MD (as opposed to -MMD) flag when generating dependences. While using -MD is reasonable for an environment that changes often, listing dependency on system header files causes the 'missing dependency declarations' errors.
What helped me was converting the '-MD' flag into '-MMD' flag in the compiler wrapper files third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl just before 'subprocess.call([CPU_COMPILER]...)':
cpu_compiler_flags = ['-MMD' if flag == '-MD' else flag for flag in cpu_compiler_flags]

and third_party/sycl/crosstool/computecpp.tpl, similar place:
computecpp_device_compiler_flags = ['-MMD' if flag == '-MD' else flag for flag in computecpp_device_compiler_flags]

16.ndeclared inclusion(s) in rule '@jpeg//:jpeg'
...1コンパイルされたターゲットファイル(e.g. libtensorflow_cc.so)のBUILDファイルに対応するモジュール定義(e.g. cc_library...)において、depsフィールドに依存が追加され、前例のバグはcc_librarydepsに追加されるべきである.
@jpeg//:simd_armv7a

...2グローバル可視性を提供するための新しいフィールドvisibilityを同時に追加します.
visibility = ["//visibility:public"],

...3次に、この@jpegサードパーティライブラリBUILDの下のsimd_armv7aモジュールを修正する.
注意Tensorflowのサードパーティライブラリはtensorflow/bazel-tensorflow/external/に配置されています.
したがって、tensorflow/bazel-tensorflow/external/jpegの下にBUILD.bazelファイルが見つかり、simd_armv7aモジュールが変更されます.
上記errorlogは、このsimd_armv7aフィールドに'external/jpeg/jpegint.h''external/jpeg/jerror.h'の2つのソースコード依存性が欠けていることを意味する.したがって、nameフィールドがsimd_armv7acc_libraryモジュールのsrcsフィールドに追加する必要があります.
"jpegint.h",
"jerror.h",

ここでは、jpegint.hjerror.hの2つのファイルとBUILDが1つのディレクトリの下にあるため、前のパスはありません(external/jpeg/).
...4その後、このcc_libraryモジュールに新しいフィールドvisibilityを追加し、グローバル可視化を提供する
visibility = ["//visibility:public"],
17. error in grpcio setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
error in grpcio setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
答:pip install setuptools-U
18.ERROR: ipapython 4.6.4 has requirement dnspython>=1.15
ERROR: ipapython 4.6.4 has requirement python-ldap>=3.0.0b1, but you'll have python-ldap 2.4.15 which is incompatible.
回答:参考https://www.cnblogs.com/caowenhao/p/7807871.html
19.TensorFlowのインストール問題解決Cannot uninstall'wrapt'It is a distutils installed project
1.出会った
ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
方法1:pip install-U--ignore-installed wrapt enum 34 simplejson netaddrを入力する
参照先:https://www.cnblogs.com/xiaowei2092/p/11025155.html
 
2.出会った
ERROR: tensorboard 1.14.0 has requirement setuptools>=41.0.0, but you'll have setuptools 39.1.0 which is incompatible.
理由:setuptoolsバージョンが低すぎる
方法:setuptoolsバージョンを更新pip install--upgrade setuptoolsを入力
20.pydot、protobuf、graphvizをインストールし、libprotocを含むバージョンを表示します.
回答:参考https://blog.csdn.net/ShuqiaoS/article/details/83382590