ffead-cpp-framework.sh 2.6 KB

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