Open ayyoitsp opened 7 years ago
-- BUILD_SHARED_LIBS : OFF -- BUILD_PYTHON : OFF -- Python version : -- Python library : -- USE_CUDA : OFF -- USE_NERVANA_GPU : OFF -- USE_GLOG : OFF -- USE_GFLAGS : OFF -- USE_LMDB : OFF -- USE_LEVELDB : OFF -- USE_OPENCV : ON -- OpenCV version : 2.4.13 -- USE_FFMPEG : -- USE_ZMQ : OFF -- USE_ROCKSDB : OFF -- USE_MPI : OFF -- USE_NCCL : OFF -- USE_NNPACK : ON -- USE_OPENMP : OFF -- USE_REDIS : OFF -- USE_GLOO : OFF
CAFFE2_WHITELIST should be a text file in which each line is a needed source file or directory. https://github.com/caffe2/caffe2/blob/e80e8b28c31dd788a21aee9907de69b68ffa5073/cmake/Whitelist.cmake
How can I determine which files should be whitelisted?
All or most of the core and operators modules. https://github.com/caffe2/caffe2/tree/master/caffe2/core https://github.com/caffe2/caffe2/tree/master/caffe2/operators
I'm not sure. https://github.com/caffe2/caffe2/issues/663
the format of whitelist can be something like this:
caffe2/core/asan.h
caffe2/core/blob.h
caffe2/core/blob_serialization.cc
caffe2/core/blob_serialization.h
caffe2/core/blob_serializer_base.h
caffe2/core/blob_stats.cc
caffe2/core/blob_stats.h
caffe2/core/blob_test.cc
caffe2/core/common.h
caffe2/core/db.cc
caffe2/core/common_cudnn.cc
caffe2/core/common_cudnn.h
caffe2/core/common_gpu.cc
caffe2/core/common_gpu.h
caffe2/core/common_omp.h
caffe2/core/context.cc
caffe2/core/context.h
Since you are compiling for iOS and since you set -fembed-bitcode
on the compiler command line, I believe what you are seeing is XCode building a fat binary and not a Caffe2 problem. Try to disable bitcode.
Building caffe2 results in libCaffe2_CPU.a being 170MB. This is a show-stopper for delivering a build to the app store that is a reasonable size.
571 is a similar issue on Android, suggesting adding the -O3 flags to builds, which I have done with little success. I have also tried -Os, but builds are the same size.
285 suggests using CAFFE2_WHITELIST, but there are no examples of how to use this parameter.