1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- mkdir /tmp/profile-data
- rm -rf $IROOT/ffead-cpp-6.0-sql
- if [ "$1" = "batch-old" ]
- then
- apt remove -yqq libpq-dev
- apt autoremove -yqq
- rm -f /usr/local/lib/libpq.*
- rm -f /usr/include/postgres_ext.h /usr/include/pg_config_ext.h /usr/include/libpq-fe.h
- rm -f /usr/lib/x86_64-linux-gnu/libpq.*
- cd /tmp
- #wget -q https://github.com/an-tao/postgres/archive/batch_mode_ubuntu.tar.gz
- #tar -xzf batch_mode_ubuntu.tar.gz
- #cd postgres-batch_mode_ubuntu
- #./configure --prefix=/usr CFLAGS='-O2 -pipe -march=native'
- #make && make install
- wget -nv https://github.com/postgres/postgres/archive/b787d4ce6d910080065025bcd5f968544997271f.zip
- unzip -q b787d4ce6d910080065025bcd5f968544997271f.zip
- cd postgres-b787d4ce6d910080065025bcd5f968544997271f
- wget -nv https://www.postgresql.org/message-id/attachment/115223/v22-0001-libpq-batch.patch
- git apply ./v22-0001-libpq-batch.patch
- ./configure --prefix=/usr CFLAGS='-O3 -march=native -flto'
- cd src/interfaces/libpq
- make all install -j4
- cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h libpq-fe.h /usr/include
- fi
- if [ "$1" = "batch" ]
- then
- apt remove -yqq libpq-dev
- apt autoremove -yqq
- rm -f /usr/local/lib/libpq.*
- rm -f /usr/include/postgres_ext.h /usr/include/pg_config_ext.h /usr/include/libpq-fe.h
- rm -f /usr/lib/x86_64-linux-gnu/libpq.*
- PG_CMT=514b4c11d24701d2cc90ad75ed787bf1380af673
- wget -nv https://github.com/postgres/postgres/archive/$PG_CMT.zip
- unzip -q $PG_CMT.zip
- cd postgres-$PG_CMT
- ./configure --prefix=/usr CFLAGS='-O3 -march=native -flto'
- cd src/interfaces/libpq
- make all install -j4
- cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h /usr/include
- fi
- if [ "$2" = "clang" ]
- then
- apt update -yqq && apt install -yqq clang
- fi
- cd $IROOT/ffead-cpp-src/
- rm -rf $IROOT/ffead-cpp-sql-raw
- rm -rf CMakeCache.txt CMakeFiles
- rm -rf web/te-benchmark-um web/te-benchmark-um-mgr
- sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark-um)||g' CMakeLists.txt
- sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark-um-mgr)||g' CMakeLists.txt
- sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark-um/libte-benchmark-um${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
- sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark-um-mgr/libte-benchmark-um-mgr${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
- if [ "$3" = "async" ]
- then
- sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark-um-pq)||g' CMakeLists.txt
- sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark-um-pq/libte-benchmark-um-pq${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
- sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq-async/config/sdorm.xml
- rm -rf web/te-benchmark-um-pq
- if [ "$4" = "pool" ]
- then
- sed -i 's|"TeBkUmLpqAsyncRouter"|"TeBkUmLpqAsyncRouterPooled"|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq-async/config/application.xml
- sed -i 's|TeBkUmLpqAsyncRouter|TeBkUmLpqAsyncRouterPooled|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq-async/config/cachememory.xml
- fi
- else
- sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark-um-pq-async)||g' CMakeLists.txt
- sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark-um-pq-async/libte-benchmark-um-pq-async${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
- sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq/config/sdorm.xml
- rm -rf web/te-benchmark-um-pq-async
- fi
|