summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-03-06 14:28:16 -0700
committerJens Axboe <axboe@kernel.dk>2018-03-06 14:28:16 -0700
commita817dc3b3b5a0efc95aaca366875eac67607cd5b (patch)
treed891bdbb645f26520c91eb93c1fa0692bad4c9eb /configure
parent825b0a75ded0b3bec4d70ea8ea50af3cad7abab5 (diff)
downloadfio-a817dc3b3b5a0efc95aaca366875eac67607cd5b.tar.gz
fio-a817dc3b3b5a0efc95aaca366875eac67607cd5b.tar.bz2
Default to building native code
If the local compiler supports it, use -march=native to ensure we take full advantage of a local build. If building distro packages, or otherwise for a different platform than the host, then use --disable-native with configure to remove this optimization. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure b/configure
index 2e8eb180..eb673adc 100755
--- a/configure
+++ b/configure
@@ -145,6 +145,7 @@ devdax="no"
pmem="no"
disable_lex=""
disable_pmem="no"
+disable_native="no"
prefix=/usr/local
# parse options
@@ -195,6 +196,8 @@ for opt do
;;
--enable-cuda) enable_cuda="yes"
;;
+ --disable-native) disable_native="yes"
+ ;;
--help)
show_help="yes"
;;
@@ -224,6 +227,7 @@ if test "$show_help" = "yes" ; then
echo "--disable-shm Disable SHM support"
echo "--disable-optimizations Don't enable compiler optimizations"
echo "--enable-cuda Enable GPUDirect RDMA support"
+ echo "--disable-native Don't build for native host"
exit $exit_val
fi
@@ -2131,6 +2135,20 @@ if compile_prog "" "" "mkdir(a, b)"; then
fi
print_config "mkdir(a, b)" "$mkdir_two"
+##########################################
+# check for cc -march=native
+build_native="no"
+cat > $TMPC << EOF
+int main(int argc, char **argv)
+{
+ return 0;
+}
+EOF
+if test "$disable_native" = "no" && compile_prog "-march=native" "" "march=native"; then
+ build_native="yes"
+fi
+print_config "Build march=native" "$build_native"
+
#############################################################################
if test "$wordsize" = "64" ; then
@@ -2377,6 +2395,9 @@ fi
if test "$mkdir_two" = "yes" ; then
output_sym "CONFIG_HAVE_MKDIR_TWO"
fi
+if test "$build_native" = "yes" ; then
+ output_sym "CONFIG_BUILD_NATIVE"
+fi
echo "LIBS+=$LIBS" >> $config_host_mak
echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak