You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

4 years ago
4 years ago
  1. # Prepare the compilation environment on linux
  2. - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  3. - sudo apt-get update -qq
  4. - sudo apt-get install gcc-6 g++-6 libsnappy-dev zlib1g-dev libbz2-dev -qq
  5. - export CXX="g++-6" CC="gcc-6"
  6. - wget https://launchpad.net/ubuntu/+archive/primary/+files/libgflags2_2.0-1.1ubuntu1_amd64.deb
  7. - sudo dpkg -i libgflags2_2.0-1.1ubuntu1_amd64.deb
  8. - wget https://launchpad.net/ubuntu/+archive/primary/+files/libgflags-dev_2.0-1.1ubuntu1_amd64.deb
  9. - sudo dpkg -i libgflags-dev_2.0-1.1ubuntu1_amd64.deb
  10. # Prepare the compilation environment on mac os
  11. ```
  12. brew install snappy
  13. ```
  14. # install rocksdb:
  15. ```
  16. export ROCKSDB_HOME=/Users/chris/dev/rocksdb
  17. git clone https://github.com/facebook/rocksdb.git $ROCKSDB_HOME
  18. pushd $ROCKSDB_HOME
  19. make clean
  20. make install-static
  21. popd
  22. ```
  23. # install gorocksdb
  24. ```
  25. export CGO_CFLAGS="-I$ROCKSDB_HOME/include"
  26. export CGO_LDFLAGS="-L$ROCKSDB_HOME -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd"
  27. go get github.com/tecbot/gorocksdb
  28. ```
  29. # compile with rocksdb
  30. ```
  31. cd ~/go/src/github.com/chrislusf/seaweedfs/weed
  32. go install -tags rocksdb
  33. ```