ffead-cpp-framework.sh 2.8 KB

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