ffead-cpp-framework.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. #From https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/C%2B%2B/ulib/setup_json.sh
  3. MAX_THREADS=$(( 3 * nproc / 2 ))
  4. WRIT_THREADS=$(( $MAX_THREADS / 3 ))
  5. SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS ))
  6. cd $IROOT
  7. wget -q https://github.com/sumeetchhetri/ffead-cpp/archive/master.zip
  8. unzip master.zip
  9. mv ffead-cpp-master ffead-cpp-src
  10. cd ffead-cpp-src/
  11. #
  12. # In the current version of the ffead-cpp framework, when the framework figures
  13. # out the column name for each data entity property, it forces all the column
  14. # names to lowercase. This is a problem for our MongoDB tests because it will
  15. # lead to records being written to the "world" collection that have a
  16. # "randomnumber" attribute rather than the expected "randomNumber" (capital "N")
  17. # even though we specify the correct capitalization in the test implementation.
  18. # This causes the implementation to fail the updates test verification.
  19. #
  20. # There doesn't seem to be any way to work around this problem in the test
  21. # implementation, so instead we modify the framework, making it trust the
  22. # provided capitalization of all column names.
  23. #
  24. # TODO: Address this problem in the ffead-cpp framework itself.
  25. #
  26. sed -i 's|toLowerCopy|trimCopy|g' src/modules/sdorm/DataSourceMapping.cpp
  27. chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh
  28. rm -rf web/te-benchmark
  29. cp -f ${TROOT}/server.sh script/
  30. cp -rf ${TROOT}/te-benchmark web/
  31. sed -i 's|THRD_PSIZ=6|THRD_PSIZ='${SERV_THREADS}'|g' resources/server.prop
  32. sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop
  33. sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop
  34. sed -i 's|localhost|tfb-database|g' resources/server.prop
  35. ./autogen.sh
  36. ./configure --enable-apachemod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT}"
  37. make install
  38. rm -rf ${IROOT}/ffead-cpp-2.0
  39. cp -rf ffead-cpp-2.0-bin ${IROOT}/ffead-cpp-2.0
  40. sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdorm.xml
  41. sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmongo.xml
  42. sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormmysql.xml
  43. sed -i 's|localhost|tfb-database|g' web/te-benchmark/config/sdormpostgresql.xml
  44. sed -i 's|localhost|tfb-database|g' resources/sample-odbcinst.ini
  45. sed -i 's|localhost|tfb-database|g' resources/sample-odbc.ini
  46. cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini
  47. cp resources/sample-odbc.ini ${IROOT}/odbc.ini