echo "Usage: build.sh \"options\""
echo " where options may be any of the following:"
echo " -t make target"
- echo " -c <C compiler name> Possible values are: gcc,clang"
+ echo " -c <C compiler name> Possible values are: gcc,clang,icc"
echo " -x <C++ compiler name> (e.g. g++, CC)"
echo " -p <Processor architecture> Possible values are:"
echo " x86, amd64 (x86_64), sparc, ia64"
cppcompiler=clang++
fi
;;
+ icc)
+ if test $cppcompiler = ''; then
+ cppcompiler=icc
+ fi
+ ;;
*)
echo "ERROR: Unknown compiler: $ccompiler"
exit $ERROR_EXIT_CODE
;;
esac
- cppcompiler_version=`$cppcompiler -dumpversion`
- echo g++ version=$gcc_version
+ #cppcompiler_version=`$cppcompiler -dumpversion`
+ #echo compiler version=$cppcompiler $cppcompiler_version
# Setup target options
# buildCXXflags="-std=gnu++0x $buildCXXflags"
- cxx_debug_options="-D_DEBUG -O0 -g $cxx_debug_options"
- cxx_release_options="-DNDEBUG $cxx_release_optimization $cxx_release_options"
+ #cxx_debug_options="-D_DEBUG -O0 -g $cxx_debug_options"
+ #cxx_release_options="-DNDEBUG $cxx_release_optimization $cxx_release_options"
+ ;;
+ icc)
+ case $processor_arch in
+ amd64)
+ case $OS_FAMILY in
+ linux)
+ buildCXXflags="-fPIC -march=$ArchFlag $amd64_cxx_options"
+ buildCflags="-fPIC -march=$ArchFlag $amd64_cxx_options"
+ buildLDflags="-fPIC"
+ buildTestLDflags="-fPIC"
+ ;;
+ *)
+ echo "Warning: cannot determine compiler flags for processor $processor_arch, OS $OS_FAMILY, and compiler $ccompiler"
+ #exit ${ERROR_EXIT_CODE}
+ ;;
+ esac
+ ;;
+ x86)
+ case $OS_FAMILY in
+ linux)
+ buildCXXflags="-fPIC -march=$ArchFlag"
+ buildCflags="-fPIC -march=$ArchFlag"
+ buildLDflags="-fPIC"
+ buildTestLDflags="-fPIC"
+ ;;
+ *)
+ echo "Warning: cannot determine compiler flags for processor $processor_arch, OS $OS_FAMILY, and compiler $ccompiler"
+ #exit ${ERROR_EXIT_CODE}
+ ;;
+ esac
+ ;;
+ *)
+ echo "Warning: cannot determine compiler flags for processor $processor_arch and compiler $ccompiler"
+ #exit ${ERROR_EXIT_CODE}
+ ;;
+ esac
;;
*)
echo "ERROR: Unknown compiler: $ccompiler"
;;
esac
+cppcompiler_version=`$cppcompiler -dumpversion`
+echo compiler version=$cppcompiler $cppcompiler_version
+
+# Setup target options
+# buildCXXflags="-std=gnu++0x $buildCXXflags"
+cxx_debug_options="-D_DEBUG -O0 -g $cxx_debug_options"
+cxx_release_options="-DNDEBUG $cxx_release_optimization $cxx_release_options"
+
+
if test $BOOST_INCLUDE_PATH != ''; then
buildCXXflags="$buildCXXflags -I$BOOST_INCLUDE_PATH"
fi
#ifndef __CDS_COMPILER_ICL_COMPILER_BARRIERS_H
#define __CDS_COMPILER_ICL_COMPILER_BARRIERS_H
-#if _MSC_VER > 0
-# if _MSC_VER < 1700
- // VC++ up to vc10
-# include <intrin.h>
+#if defined(_MSC_VER) && _MSC_VER < 1700
+ // VC++ up to vc10
+# include <intrin.h>
-# pragma intrinsic(_ReadWriteBarrier)
-# pragma intrinsic(_ReadBarrier)
-# pragma intrinsic(_WriteBarrier)
+# pragma intrinsic(_ReadWriteBarrier)
+# pragma intrinsic(_ReadBarrier)
+# pragma intrinsic(_WriteBarrier)
-# define CDS_COMPILER_RW_BARRIER _ReadWriteBarrier()
-# define CDS_COMPILER_R_BARRIER _ReadBarrier()
-# define CDS_COMPILER_W_BARRIER _WriteBarrier()
+# define CDS_COMPILER_RW_BARRIER _ReadWriteBarrier()
+# define CDS_COMPILER_R_BARRIER _ReadBarrier()
+# define CDS_COMPILER_W_BARRIER _WriteBarrier()
-# else
- // MS VC11+
-# include <atomic>
+#else
+ // MS VC11+, linux
+# include <atomic>
-# define CDS_COMPILER_RW_BARRIER std::atomic_thread_fence( std::memory_order_acq_rel )
-# define CDS_COMPILER_R_BARRIER CDS_COMPILER_RW_BARRIER
-# define CDS_COMPILER_W_BARRIER CDS_COMPILER_RW_BARRIER
-
-# endif
+# define CDS_COMPILER_RW_BARRIER std::atomic_thread_fence( std::memory_order_acq_rel )
+# define CDS_COMPILER_R_BARRIER CDS_COMPILER_RW_BARRIER
+# define CDS_COMPILER_W_BARRIER CDS_COMPILER_RW_BARRIER
#endif
#endif // #ifndef __CDS_COMPILER_ICL_COMPILER_BARRIERS_H
#endif
// Processor architecture
-#if defined(_M_X64) || defined(_M_AMD64)
+#if defined(_M_X64) || defined(_M_AMD64) || defined(__amd64__) || defined(__amd64)
# define CDS_BUILD_BITS 64
# define CDS_PROCESSOR_ARCH CDS_PROCESSOR_AMD64
# define CDS_PROCESSOR__NAME "AMD64"
# define CDS_PROCESSOR__NICK "amd64"
-#elif defined(_M_IX86)
+#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
# define CDS_BUILD_BITS 32
# define CDS_PROCESSOR_ARCH CDS_PROCESSOR_X86
# define CDS_PROCESSOR__NAME "Intel x86"
#define __CDS_CONTAINER_STRIPED_MAP_STD_HASH_MAP_ADAPTER_H
#include <cds/container/striped_set/adapter.h>
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600 // MS VC 2008
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600 // MS VC 2008
# include <cds/container/striped_map/std_hash_map_vc.h>
#else
# include <cds/container/striped_map/std_hash_map_std.h>
#define __CDS_CONTAINER_STRIPED_SET_STD_HASH_SET_ADAPTER_H
#include <cds/container/striped_set/adapter.h>
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600 // MS VC 2008
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600 // MS VC 2008
# include <cds/container/striped_set/std_hash_set_vc.h>
#else
# include <cds/container/striped_set/std_hash_set_std.h>
{
if ( !bCond ) {
char buf[4096];
-# if CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL
+# if CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CS_OSI_WINDOWS)
_snprintf_s( buf, sizeof(buf)/sizeof(buf[0]), _TRUNCATE, pszMsg, pszFile, nLine );
# else
snprintf( buf, sizeof(buf)/sizeof(buf[0]), pszMsg, pszFile, nLine );
#ifndef __CDS_THREADING_DETAILS_MSVC_MANAGER_H
#define __CDS_THREADING_DETAILS_MSVC_MANAGER_H
-#if !( CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL )
+#if !( CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS))
# error "threading/details/msvc_manager.h may be used only with Microsoft Visual C++ / Intel C++ compiler"
#endif
#include <cds/container/striped_map.h>
#include <cds/lock/spinlock.h>
-#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600)
+#if !((CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600)
namespace map {
#include <cds/container/striped_map.h>
#include <cds/lock/spinlock.h>
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
namespace map {
#include <cds/container/striped_map.h>
#include <cds/lock/spinlock.h>
-#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600)
+#if !((CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600)
namespace map {
#include <cds/container/striped_map.h>
#include <cds/lock/spinlock.h>
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
namespace map {
CPPUNIT_ASSERT( val[3] == nHash + 4 );
CPPUNIT_ASSERT( val[4] == nHash + 5 );
-#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1700)
+#if !((CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER == 1700)
// MS VC 11: std::tuple suports up to 5 template params only
cds::opt::hash< std::tuple< hashing, hash2, hash3, hash4, hash5, hash6 > >::pack<cds::opt::none>::hash h6;
#include <cds/container/striped_set.h>
#include <cds/lock/spinlock.h>
-#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600)
+#if !((CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600)
namespace set {
#include <cds/container/striped_set.h>
#include <cds/lock/spinlock.h>
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
namespace stdext {
inline size_t hash_value(set::StripedSetHdrTest::item const& _Keyval)
#include <cds/container/striped_set.h>
#include <cds/lock/spinlock.h>
-#if !((CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600)
+#if !((CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600)
namespace set {
#include <cds/container/striped_set.h>
#include <cds/lock/spinlock.h>
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
namespace stdext {
inline size_t hash_value(set::StripedSetHdrTest::item const& _Keyval)
, co::less< less >
> StripedMap_list;
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
typedef StripedHashMap_ord<
stdext::hash_map< Key, Value, stdext::hash_compare<Key, less > >
, co::hash< hash2 >
, co::hash< hash2 >
> RefinableMap_map;
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
typedef RefinableHashMap_ord<
stdext::hash_map< Key, Value, stdext::hash_compare<Key, less > >
, co::hash< hash2 >
}
};
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
struct hash_less: public stdext::hash_compare< key_type, std::less<key_type> >
{
typedef stdext::hash_compare< key_type, std::less<key_type> > base_class;
, co::hash< hash2 >
> StripedSet_set;
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
typedef StripedHashSet_ord<
stdext::hash_set< key_val, hash_less >
, co::hash< hash2 >
, co::hash< hash2 >
> RefinableSet_set;
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER < 1600
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER < 1600
typedef RefinableHashSet_ord<
stdext::hash_set< key_val, hash_less >
, co::hash< hash2 >
#ifndef __CDSUNIT_STD_HASH_SET_H
#define __CDSUNIT_STD_HASH_SET_H
-#if (CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL) && _MSC_VER == 1500
+#if (CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)) && _MSC_VER == 1500
# include "set2/std_hash_set_vc9.h"
#else
# include "set2/std_hash_set_std.h"