compile-batch.sh 1.4 KB

1234567891011121314151617181920212223242526272829
  1. #! /bin/sh
  2. DB_FLAG=$1
  3. COMMIT=10b72ad8ce16528ff642f802e266a975964d06f9
  4. COMMIT="$2"
  5. MONOTHREAD=$2
  6. if [ "$COMMIT" = "" ]; then
  7. COMMIT="10b72ad8ce16528ff642f802e266a975964d06f9"
  8. fi
  9. if [ $DB_FLAG = "TFB_MYSQL" ]; then
  10. echo "ERROR: Only Postgres has pipelining support for now."
  11. exit 1
  12. CXX_FLAGS="-I /usr/include/mariadb -lmariadbclient "
  13. wget -nv https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_mysql.hh
  14. elif [ $DB_FLAG = "TFB_PGSQL" ]; then
  15. CXX_FLAGS="-lpthread -L/usr/lib -lpq -I/postgres-bab150045bd9766869f471ede88734ea0989261c/src/include"
  16. wget -nv https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_pgsql.hh
  17. fi
  18. wget https://raw.githubusercontent.com/matt-42/lithium/$COMMIT/single_headers/lithium_http_backend.hh
  19. clang++ -fprofile-instr-generate=./profile.prof -flto -DLITHIUM_SERVER_NAME=l -DPROFILE_MODE -DN_SQL_CONNECTIONS=1 -DNDEBUG -D$DB_FLAG -O3 -march=native -std=c++17 ./lithium_batch.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
  20. /lithium_tbf tfb-database 8081
  21. llvm-profdata-10 merge -output=./profile.pgo ./profile.prof
  22. clang++ -fprofile-instr-use=./profile.pgo -flto -DLITHIUM_SERVER_NAME=l -DNDEBUG -D$DB_FLAG -DN_SQL_CONNECTIONS=1 -O3 -march=native -std=c++17 ./lithium_batch.cc $CXX_FLAGS -lpthread -lboost_context -lssl -lcrypto -o /lithium_tbf
  23. /lithium_tbf tfb-database 8080