Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.4k stars 4.16k forks source link

如何在mac中安装ncnn #67

Closed ghost closed 7 years ago

ghost commented 7 years ago

参考http://blog.csdn.net/best_coder/article/details/76201275中 在cmake ..中出现 -- CMAKE_INSTALL_PREFIX = /Users/yangguangdejianjian/code/ncnn/build/install -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) WITH_LAYER_absval = ON WITH_LAYER_argmax = OFF WITH_LAYER_batchnorm = ON WITH_LAYER_bias = ON WITH_LAYER_bnll = ON WITH_LAYER_concat = ON WITH_LAYER_convolution = ON WITH_LAYER_crop = ON WITH_LAYER_deconvolution = ON WITH_LAYER_dropout = ON WITH_LAYER_eltwise = ON WITH_LAYER_elu = ON WITH_LAYER_embed = OFF WITH_LAYER_exp = ON WITH_LAYER_flatten = ON WITH_LAYER_innerproduct = ON WITH_LAYER_input = ON WITH_LAYER_log = ON WITH_LAYER_lrn = ON WITH_LAYER_memorydata = OFF WITH_LAYER_mvn = ON WITH_LAYER_pooling = ON WITH_LAYER_power = ON WITH_LAYER_prelu = ON WITH_LAYER_proposal = OFF WITH_LAYER_reduction = OFF WITH_LAYER_relu = ON WITH_LAYER_reshape = OFF WITH_LAYER_roipooling = OFF WITH_LAYER_scale = ON WITH_LAYER_sigmoid = ON WITH_LAYER_slice = ON WITH_LAYER_softmax = ON WITH_LAYER_split = ON WITH_LAYER_spp = OFF WITH_LAYER_tanh = ON WITH_LAYER_threshold = ON WITH_LAYER_tile = OFF WITH_LAYER_rnn = OFF WITH_LAYER_lstm = OFF -- Configuring done -- Generating done -- Build files have been written to: /Users/yangguangdejianjian/code/ncnn/build

请教如何解决

ko1o commented 7 years ago

@jj8401 在根目录下的CMakeLists.txt 文件中 关闭openmp 如下

option(NCNN_OPENMP "openmp support" OFF)

ghost commented 7 years ago

感谢老铁

BiranLi commented 7 years ago

或者你考虑在机子上装个openmp呗

AirFishWang commented 7 years ago

-- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)

使用gcc4.9.4时, 检测openmp成功了,为什么Could NOT find OpenMP?

logic1988 commented 7 years ago

在mac上采用brew install gcc --without-multilib装了支持openmp的g++后, 采用export CXX=g++-7 CC=gcc-7 && cmake ..命令编译会提示成功找到openmp, 但会出现中一样的protobuf错误 , 即使切换回非openmp版g++还会出错, 除非手动指定-DNCNN_OPENMP=OFF后才能成功编译.