Browse Source

ULib: Newer compiler (#2905)

* Newer compiler

* ULib: Newer compiler
stefano casazza 8 years ago
parent
commit
dd3de71406

+ 1 - 1
frameworks/C++/ulib/setup_mongodb.sh

@@ -17,7 +17,7 @@ sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g" $IROOT
 
 
 # 2. Start ULib Server (userver_tcp)
 # 2. Start ULib Server (userver_tcp)
 export MONGODB_HOST=$DBHOST
 export MONGODB_HOST=$DBHOST
-export UMEMPOOL="1057,0,0,49,274,-14,-15,-24,40"
+export UMEMPOOL="96,0,0,47,16401,-14,-20,-18,26"
 
 
 # Never use setcap inside of TRAVIS 
 # Never use setcap inside of TRAVIS 
 [ "$TRAVIS" != "true" ] || { \
 [ "$TRAVIS" != "true" ] || { \

+ 1 - 1
frameworks/C++/ulib/setup_mysql.sh

@@ -17,7 +17,7 @@ sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g" $IROOT
 
 
 # 2. Start ULib Server (userver_tcp)
 # 2. Start ULib Server (userver_tcp)
 export ORM_DRIVER="mysql"
 export ORM_DRIVER="mysql"
-export UMEMPOOL="750,0,123,251,305,53,-6,-26,52"
+export UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
 
 
 # Never use setcap inside of TRAVIS 
 # Never use setcap inside of TRAVIS 

+ 1 - 1
frameworks/C++/ulib/setup_postgres.sh

@@ -12,7 +12,7 @@ sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g" $IROOT
 
 
 # 2. Start ULib Server (userver_tcp)
 # 2. Start ULib Server (userver_tcp)
 export ORM_DRIVER="pgsql"
 export ORM_DRIVER="pgsql"
-export UMEMPOOL="750,0,123,251,305,53,-6,-26,52"
+export UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 
 
 # Never use setcap inside of TRAVIS 
 # Never use setcap inside of TRAVIS 

+ 1 - 1
frameworks/C++/ulib/setup_sqlite.sh

@@ -17,7 +17,7 @@ sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g" $IROOT
 
 
 # 2. Start ULib Server (userver_tcp)
 # 2. Start ULib Server (userver_tcp)
 export ORM_DRIVER="sqlite"
 export ORM_DRIVER="sqlite"
-export UMEMPOOL="750,0,123,251,305,53,-6,-26,52"
+export UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=${IROOT}/ULib/db/%.*s"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=${IROOT}/ULib/db/%.*s"
 
 
 # Never use setcap inside of TRAVIS 
 # Never use setcap inside of TRAVIS 

+ 2 - 2
frameworks/C++/ulib/src/db.usp

@@ -35,13 +35,13 @@ static void usp_end_db()
 {
 {
    U_TRACE(5, "::usp_end_db()")
    U_TRACE(5, "::usp_end_db()")
 
 
-   delete psql_db;
-
    if (pstmt_db)
    if (pstmt_db)
       {
       {
       delete  pstmt_db;
       delete  pstmt_db;
       delete pworld_db;
       delete pworld_db;
       }
       }
+
+   delete psql_db;
 }
 }
 #endif
 #endif
 -->
 -->

+ 3 - 1
frameworks/C++/ulib/src/equery.usp

@@ -27,7 +27,7 @@ static void usp_fork_equery()
       return;
       return;
       }
       }
 
 
-   U_MEMCPY(buffer,  "{\"query\":{\"match\":{\"_id\":\"", QLEN);
+   U_MEMCPY(buffer, "{\"query\":{\"match\":{\"_id\":\"", QLEN);
 
 
 #ifndef AS_cpoll_cppsp_DO
 #ifndef AS_cpoll_cppsp_DO
    U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
    U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
@@ -55,6 +55,8 @@ uint32_t id;
 UString rnumber;
 UString rnumber;
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
+(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
+
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 USP_PUTS_CHAR('[');
 USP_PUTS_CHAR('[');
 #endif
 #endif

+ 2 - 0
frameworks/C++/ulib/src/eupdate.usp

@@ -64,6 +64,8 @@ Content-Type: application/json
 uint32_t len1, len2, id, rnum;
 uint32_t len1, len2, id, rnum;
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
+(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
+
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 USP_PUTS_CHAR('[');
 USP_PUTS_CHAR('[');
 #endif
 #endif

+ 48 - 53
frameworks/C++/ulib/src/fortune.usp

@@ -5,65 +5,60 @@ TechEmpower Web Framework Benchmarks
 <!--#declaration
 <!--#declaration
 #include "fortune.h"
 #include "fortune.h"
 
 
-static Fortune*			  pfortune;
+static Fortune*           pfortune;
 static Fortune*           pfortune2add;
 static Fortune*           pfortune2add;
 static UString*           pencoded;
 static UString*           pencoded;
-static UOrmSession*		  psql_fortune;
-static UOrmStatement*	  pstmt_fortune;
+static UOrmSession*       psql_fortune;
+static UOrmStatement*     pstmt_fortune;
 static UVector<Fortune*>* pvfortune;
 static UVector<Fortune*>* pvfortune;
 
 
 static void usp_fork_fortune()
 static void usp_fork_fortune()
 {
 {
-	U_TRACE(5, "::usp_fork_fortune()")
+   U_TRACE(5, "::usp_fork_fortune()")
 
 
-	U_NEW(UOrmSession, psql_fortune, UOrmSession(U_CONSTANT_TO_PARAM("fortune")));
+   U_NEW(UOrmSession, psql_fortune, UOrmSession(U_CONSTANT_TO_PARAM("fortune")));
 
 
-	U_INTERNAL_DUMP("psql_fortune = %p", psql_fortune)
+   if (psql_fortune->isReady() == false)
+      {
+      U_WARNING("usp_fork_fortune(): we cound't connect to db");
 
 
-	if (psql_fortune->isReady() == false)
-		{
-		U_WARNING("usp_fork_fortune(): we cound't connect to db");
+      return;
+      }
 
 
-		return;
-		}
+   U_NEW(UOrmStatement, pstmt_fortune, UOrmStatement(*psql_fortune, U_CONSTANT_TO_PARAM("SELECT id, message FROM Fortune")));
 
 
-	U_NEW(UOrmStatement, pstmt_fortune, UOrmStatement(*psql_fortune, U_CONSTANT_TO_PARAM("SELECT id, message FROM Fortune")));
+// if (UOrmDriver::isPGSQL()) *psql_fortune << "BEGIN ISOLATION LEVEL SERIALIZABLE; COMMIT";
 
 
-//	if (UOrmDriver::isPGSQL()) *psql_fortune << "BEGIN ISOLATION LEVEL SERIALIZABLE; COMMIT";
+   U_NEW(Fortune, pfortune, Fortune);
 
 
-	U_NEW(Fortune, pfortune, Fortune);
+   pstmt_fortune->into(*pfortune);
 
 
-	pstmt_fortune->into(*pfortune);
-
-	U_NEW(UString, pencoded, UString(100U));
-	U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
-	U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
+   U_NEW(UString, pencoded, UString(100U));
+   U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
+   U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
 }
 }
 
 
 #ifdef DEBUG
 #ifdef DEBUG
 static void usp_end_fortune()
 static void usp_end_fortune()
 {
 {
-	U_TRACE(5, "::usp_end_fortune()")
-
-	U_INTERNAL_DUMP("psql_fortune = %p", psql_fortune)
-
-	delete psql_fortune;
-
-	if (pstmt_fortune)
-		{
-		delete pstmt_fortune;
-		delete pfortune;
-		delete pencoded;
-		delete pvfortune;
-		delete pfortune2add;
-		}
+   U_TRACE(5, "::usp_end_fortune()")
+
+   if (pstmt_fortune)
+      {
+      delete pstmt_fortune;
+      delete pfortune;
+      delete pencoded;
+      delete pvfortune;
+      delete pfortune2add;
+      }
+
+   delete psql_fortune;
 }
 }
 #endif
 #endif
 -->
 -->
 <!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr><!--#code
 <!doctype html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr><!--#code
 uint32_t sz;
 uint32_t sz;
 Fortune* item;
 Fortune* item;
-char* s   = UClientImage_Base::wbuffer->data();
 char* ptr = UClientImage_Base::wbuffer->pend();
 char* ptr = UClientImage_Base::wbuffer->pend();
 
 
 U_NEW(Fortune, item, Fortune(*pfortune2add));
 U_NEW(Fortune, item, Fortune(*pfortune2add));
@@ -72,41 +67,41 @@ pvfortune->push_back(item);
 
 
 pstmt_fortune->execute();
 pstmt_fortune->execute();
 
 
-do	{
-	U_NEW(Fortune, item, Fortune(*pfortune));
+do {
+   U_NEW(Fortune, item, Fortune(*pfortune));
 
 
    pvfortune->push_back(item);
    pvfortune->push_back(item);
-	}
+   }
 while (pstmt_fortune->nextRow());
 while (pstmt_fortune->nextRow());
 
 
 pvfortune->sort(Fortune::cmp_obj);
 pvfortune->sort(Fortune::cmp_obj);
 
 
 for (uint32_t i = 0, n = pvfortune->size(); i < n; ++i)
 for (uint32_t i = 0, n = pvfortune->size(); i < n; ++i)
-	{
-	Fortune* elem = (*pvfortune)[i];
+   {
+   Fortune* elem = (*pvfortune)[i];
 
 
-	UXMLEscape::encode(elem->message, *pencoded);
+   UXMLEscape::encode(elem->message, *pencoded);
 
 
-	sz = pencoded->size();
+   sz = pencoded->size();
 
 
-	u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','t','r','>','<','t','d','>'));
+   u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','t','r','>','<','t','d','>'));
 
 
-	ptr = u_num2str32(elem->id, ptr+8);
+   ptr = u_num2str32(elem->id, ptr+8);
 
 
-	u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','t','d'));
-							 ptr += 8;
+   u_put_unalignedp64(ptr, U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','t','d'));
+                      ptr += 8;
 
 
-	*ptr++ = '>';
+   *ptr++ = '>';
 
 
-	(void) memcpy(ptr, pencoded->data(), sz);
-					  ptr +=					    sz;
+   (void) memcpy(ptr, pencoded->data(), sz);
+                 ptr +=                 sz;
 
 
-	u_put_unalignedp64(ptr,   U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t'));
-	u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('r','>'));
-							 ptr += 10;
-	}
+   u_put_unalignedp64(ptr,   U_MULTICHAR_CONSTANT64('<','/','t','d','>','<','/','t'));
+   u_put_unalignedp16(ptr+8, U_MULTICHAR_CONSTANT16('r','>'));
+                      ptr += 10;
+   }
 
 
-UClientImage_Base::wbuffer->size_adjust(ptr - s);
+UClientImage_Base::wbuffer->size_adjust(ptr);
 
 
 pvfortune->clear();
 pvfortune->clear();
 --></table></body></html>
 --></table></body></html>

+ 1 - 2
frameworks/C++/ulib/src/mdb.usp

@@ -54,7 +54,6 @@ UString result;
 (void) U_JFIND(mc->vitem[0], "randomNumber", result);
 (void) U_JFIND(mc->vitem[0], "randomNumber", result);
 
 
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
-char* s     = UClientImage_Base::wbuffer->data();
 char* ptr   = UClientImage_Base::wbuffer->pend();
 char* ptr   = UClientImage_Base::wbuffer->pend();
 uint32_t sz = result.size();
 uint32_t sz = result.size();
 
 
@@ -72,7 +71,7 @@ u_put_unalignedp64(ptr+8, U_MULTICHAR_CONSTANT64('N','u','m','b','e','r','"',':'
 
 
 *ptr++ = '}';
 *ptr++ = '}';
 
 
-UClientImage_Base::wbuffer->size_adjust(ptr - s);
+UClientImage_Base::wbuffer->size_adjust(ptr);
 #else
 #else
 World world(id, result.strtoul());
 World world(id, result.strtoul());
 USP_OBJ_JSON_stringify(world);
 USP_OBJ_JSON_stringify(world);

+ 1 - 2
frameworks/C++/ulib/src/mfortune.usp

@@ -55,7 +55,6 @@ static void usp_end_mfortune()
 Fortune* item;
 Fortune* item;
 UString result;
 UString result;
 uint32_t i, n, sz;
 uint32_t i, n, sz;
-char* s   = UClientImage_Base::wbuffer->data();
 char* ptr = UClientImage_Base::wbuffer->pend();
 char* ptr = UClientImage_Base::wbuffer->pend();
 
 
 U_NEW(Fortune, item, Fortune(*pfortune2add));
 U_NEW(Fortune, item, Fortune(*pfortune2add));
@@ -102,7 +101,7 @@ for (i = 0, ++n; i < n; ++i)
                       ptr += 10;
                       ptr += 10;
    }
    }
 
 
-UClientImage_Base::wbuffer->size_adjust(ptr - s);
+UClientImage_Base::wbuffer->size_adjust(ptr);
 
 
 pvfortune->clear();
 pvfortune->clear();
 --></table></body></html>
 --></table></body></html>

+ 2 - 3
frameworks/C++/ulib/src/mquery.usp

@@ -62,10 +62,9 @@ uint32_t id;
 UString rnumber;
 UString rnumber;
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
-#ifdef AS_cpoll_cppsp_DO
 (void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
 (void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
 
 
-char* s   = UClientImage_Base::wbuffer->data();
+#ifdef AS_cpoll_cppsp_DO
 char* ptr = UClientImage_Base::wbuffer->pend();
 char* ptr = UClientImage_Base::wbuffer->pend();
 
 
 *ptr++ = '[';
 *ptr++ = '[';
@@ -113,7 +112,7 @@ while (true)
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 *ptr++ = ']';
 *ptr++ = ']';
 
 
-UClientImage_Base::wbuffer->size_adjust(ptr - s);
+UClientImage_Base::wbuffer->size_adjust(ptr);
 #else
 #else
 USP_OBJ_JSON_stringify(*pvworld_query);
 USP_OBJ_JSON_stringify(*pvworld_query);
 pvworld_query->clear();
 pvworld_query->clear();

+ 2 - 3
frameworks/C++/ulib/src/mupdate.usp

@@ -62,10 +62,9 @@ uint32_t id, rnum;
 //mongoc_bulk_operation_t* bulk = mc->createBulk(false);
 //mongoc_bulk_operation_t* bulk = mc->createBulk(false);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
-#ifdef AS_cpoll_cppsp_DO
 (void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
 (void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
 
 
-char* s   = UClientImage_Base::wbuffer->data();
+#ifdef AS_cpoll_cppsp_DO
 char* ptr = UClientImage_Base::wbuffer->pend();
 char* ptr = UClientImage_Base::wbuffer->pend();
 
 
 *ptr++ = '[';
 *ptr++ = '[';
@@ -111,7 +110,7 @@ while (true)
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 *ptr++ = ']';
 *ptr++ = ']';
 
 
-UClientImage_Base::wbuffer->size_adjust(ptr - s);
+UClientImage_Base::wbuffer->size_adjust(ptr);
 #else
 #else
 USP_OBJ_JSON_stringify(*pvworld_update);
 USP_OBJ_JSON_stringify(*pvworld_update);
 pvworld_update->clear();
 pvworld_update->clear();

+ 4 - 2
frameworks/C++/ulib/src/query.usp

@@ -45,8 +45,6 @@ static void usp_end_query()
 {
 {
    U_TRACE(5, "::usp_end_query()")
    U_TRACE(5, "::usp_end_query()")
 
 
-   delete psql_query;
-
    if (pstmt_query)
    if (pstmt_query)
       {
       {
       delete pstmt_query;
       delete pstmt_query;
@@ -56,6 +54,8 @@ static void usp_end_query()
       delete pvworld_query;
       delete pvworld_query;
 #  endif
 #  endif
       }
       }
+
+   delete psql_query;
 }
 }
 #endif
 #endif
 -->
 -->
@@ -65,6 +65,8 @@ Content-Type: application/json
 <!--#code
 <!--#code
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
+(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
+
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 USP_PUTS_CHAR('[');
 USP_PUTS_CHAR('[');
 #endif
 #endif

+ 2 - 0
frameworks/C++/ulib/src/rquery.usp

@@ -45,6 +45,8 @@ UStringRep* rep;
 char* pbuffer = buffer;
 char* pbuffer = buffer;
 int i, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
+(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
+
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 USP_PUTS_CHAR('[');
 USP_PUTS_CHAR('[');
 #endif
 #endif

+ 2 - 0
frameworks/C++/ulib/src/rupdate.usp

@@ -44,6 +44,8 @@ World* pworld;
 char* pbuffer = buffer;
 char* pbuffer = buffer;
 int i, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
+(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
+
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 USP_PUTS_CHAR('[');
 USP_PUTS_CHAR('[');
 #endif
 #endif

+ 5 - 6
frameworks/C++/ulib/src/update.usp

@@ -47,8 +47,6 @@ static void usp_end_update()
 {
 {
    U_TRACE(5, "::usp_end_update()")
    U_TRACE(5, "::usp_end_update()")
 
 
-   delete psql_update;
-
    if (pstmt)
    if (pstmt)
       {
       {
       delete pstmt;
       delete pstmt;
@@ -57,6 +55,8 @@ static void usp_end_update()
 
 
       if (bpgsql == false) delete pstmt1;
       if (bpgsql == false) delete pstmt1;
       }
       }
+
+   delete psql_update;
 }
 }
 #endif
 #endif
 -->
 -->
@@ -69,6 +69,8 @@ World* pworld;
 char query[8192];
 char query[8192];
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 int i = 0, num_queries = UHTTP::getFormFirstNumericValue(1, 500);
 
 
+(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
+
 if (bpgsql)
 if (bpgsql)
    {
    {
    (void) memcpy(query,          "UPDATE World SET randomNumber = v.randomNumber FROM (VALUES",
    (void) memcpy(query,          "UPDATE World SET randomNumber = v.randomNumber FROM (VALUES",
@@ -94,9 +96,6 @@ while (true)
    }
    }
 
 
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
-(void) UClientImage_Base::wbuffer->reserve(36U * num_queries);
-
-char* s = UClientImage_Base::wbuffer->data();
 char* p = UClientImage_Base::wbuffer->pend();
 char* p = UClientImage_Base::wbuffer->pend();
 
 
 *p++ = '[';
 *p++ = '[';
@@ -148,7 +147,7 @@ while (true)
 #ifdef AS_cpoll_cppsp_DO
 #ifdef AS_cpoll_cppsp_DO
 *p++ = ']';
 *p++ = ']';
 
 
-UClientImage_Base::wbuffer->size_adjust(p - s);
+UClientImage_Base::wbuffer->size_adjust(p);
 #else
 #else
 USP_OBJ_JSON_stringify(*pvworld_update);
 USP_OBJ_JSON_stringify(*pvworld_update);
 #endif
 #endif

+ 14 - 18
toolset/setup/linux/frameworks/ulib.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends gcc-4.9
+fw_depends gcc-6
 
 
 fw_installed ulib && return 0
 fw_installed ulib && return 0
 
 
@@ -25,20 +25,10 @@ sudo apt-get install -y postgresql-server-dev-all
   sudo apt-get install -y libcap2-bin
   sudo apt-get install -y libcap2-bin
 #fi
 #fi
 
 
-# Check for the compiler support (We want at least g++ 4.8)
-CC=gcc  # C   compiler command
-CXX=g++ # C++ compiler command
-
-gcc_version=`g++ -dumpversion`
-
-case "$gcc_version" in
-  3*|4.0*|4.1*|4.2*|4.3*|4.4*|4.5*|4.6*|4.7*|4.8*)
-	  CC='gcc-4.9'
-	 CXX='g++-4.9'
-  ;;
-esac
-
-export CC CXX
+export CC=gcc-6
+export CXX=g++-6
+export AR=gcc-ar-6
+export RANLIB=gcc-ranlib-6
 
 
 # We need to install mongo-c-driver (we don't have a ubuntu package)
 # We need to install mongo-c-driver (we don't have a ubuntu package)
 RETCODE=$(fw_exists ${IROOT}/mongo-c-driver.installed)
 RETCODE=$(fw_exists ${IROOT}/mongo-c-driver.installed)
@@ -51,10 +41,16 @@ if [ "$RETCODE" != 0 ]; then
   touch ${IROOT}/mongo-c-driver.installed
   touch ${IROOT}/mongo-c-driver.installed
 fi
 fi
 
 
-# 1. Download ULib
 cd $IROOT
 cd $IROOT
-fw_get -o ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz 
-fw_untar  ULib-${ULIB_VERSION}.tar.gz
+
+if [ -e ../results/ULib-${ULIB_VERSION}.tar.gz ]; then
+	mv ../results/ULib-${ULIB_VERSION}.tar.gz .
+else
+	# 1. Download ULib
+	fw_get -o ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz 
+fi
+
+fw_untar ULib-${ULIB_VERSION}.tar.gz
 
 
 # 2. Compile application (userver_tcp)
 # 2. Compile application (userver_tcp)
 cd ULib-$ULIB_VERSION
 cd ULib-$ULIB_VERSION

+ 1 - 1
toolset/setup/linux/systools/gcc-6.sh

@@ -4,6 +4,6 @@ fw_installed gcc-6 && return 0
 
 
 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
 sudo apt-get -yq update
 sudo apt-get -yq update
-sudo apt-get install -qqy gcc-6
+sudo apt-get install -qqy gcc-6 g++-6
 
 
 touch $IROOT/gcc-6.installed
 touch $IROOT/gcc-6.installed