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
echo ---------------------------------
echo Make debug library
-CXXFLAGS="$compileroptions $cxx_debug_options $EXTRA_CXXFLAGS"
-export CXXFLAGS
-CFLAGS="$compileroptions $cxx_debug_options $EXTRA_CFLAGS $debugflag "
-export CFLAGS
-LDFLAGS="$linkeroptions -shared $ld_debug_options $ld_libs $EXTRA_LDFLAGS "
-export LDFLAGS
+#CXXFLAGS="$compileroptions $cxx_debug_options $EXTRA_CXXFLAGS"
+#export CXXFLAGS
+#CFLAGS="$compileroptions $cxx_debug_options $EXTRA_CFLAGS $debugflag "
+#export CFLAGS
+#LDFLAGS="$linkeroptions -shared $ld_debug_options $EXTRA_LDFLAGS "
+#export LDFLAGS
mkdir -p $OBJ_PATH/debug
+CXXFLAGS="$compileroptions $cxx_debug_options $EXTRA_CXXFLAGS" \
+CFLAGS="$compileroptions $cxx_debug_options $EXTRA_CFLAGS $debugflag " \
+LDLIBS="$ld_libs" \
+LDFLAGS="$linkeroptions -shared $ld_debug_options $EXTRA_LDFLAGS " \
$MAKE -f Makefile \
platform=$OS_FAMILY \
BIN_PATH=$BIN_PATH \
echo ---------------------------------
echo Make release library
-CXXFLAGS="$compileroptions $cxx_release_options $EXTRA_CXXFLAGS "
-export CXXFLAGS
-CFLAGS="$compileroptions $cxx_release_options $EXTRA_CFLAGS "
-export CFLAGS
-LDFLAGS="$linkeroptions -shared $ld_resease_options $ld_libs $EXTRA_LDFLAGS "
-export LDFLAGS
+#CXXFLAGS="$compileroptions $cxx_release_options $EXTRA_CXXFLAGS "
+#export CXXFLAGS
+#CFLAGS="$compileroptions $cxx_release_options $EXTRA_CFLAGS "
+#export CFLAGS
+#LDFLAGS="$linkeroptions -shared $ld_resease_options $ld_libs $EXTRA_LDFLAGS "
+#export LDFLAGS
mkdir -p $OBJ_PATH/release
+CXXFLAGS="$compileroptions $cxx_release_options $EXTRA_CXXFLAGS " \
+CFLAGS="$compileroptions $cxx_release_options $EXTRA_CFLAGS " \
+LDFLAGS="$linkeroptions -shared $ld_resease_options $EXTRA_LDFLAGS " \
+LDLIBS="$ld_libs" \
$MAKE -f Makefile \
platform=$OS_FAMILY \
BIN_PATH=$BIN_PATH \