下载PS-Lite源码
cd /Users/admin/git
git clone https://github.com/dmlc/ps-lite.git
安装CLion
编译源码
> /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ps-lite
-- The C compiler identification is AppleClang 10.0.0.10001044
-- The CXX compiler identification is AppleClang 10.0.0.10001044
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/admin/git
make
编译出错
- make: *** [/Users/admin/git/ps-lite/deps/include/zmq.h] Error 1
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/gawk
Reason: image not found
./config.status: line 1295: 37136 Done(141) eval sed \"\$ac_sed_extra\" "$ac_file_inputs"
37137 Abort trap: 6 | $AWK -f "$ac_tmp/subs.awk" > $ac_tmp/out
config.status: error: could not create Makefile
make: *** [/Users/admin/git/ps-lite/deps/include/zmq.h] Error 1
原因是未安装zeromq,安装命令如下:
cd zeromq-4.1.4
./configure
make check
make
make install
- Referenced from: /usr/local/bin/awk
checking dynamic linker characteristics... dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/awk
Reason: image not found
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/awk
Reason: image not found
darwin18.0.0 dyld
原因是未安装awk
brew install awk
- No package 'libsodium' found
configure: error: Package requirements (libsodium) were not met:
No package 'libsodium' found
原因是未安装libsodium
brew install libsodium
- make: *** [/Users/admin/git/ps-lite/deps/include/google/protobuf/message.h] Error 2
make[3]: *** [unittest_proto_middleman] Error 134
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [/Users/admin/git/ps-lite/deps/include/google/protobuf/message.h] Error 2
原因是protobuf未安装,安装命令如下:
解决方案:https://www.jianshu.com/p/fd7372cffb88