diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-07-26 07:43:46 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-07-26 07:43:46 -0600 |
commit | 6feb475a9e775db911ee766a9671f244b8c1d35e (patch) | |
tree | ec9b8fa6d3611360a1770e430583ad7d25e95847 | |
parent | e235e74dfd0627b17690194f957da509b8ace808 (diff) | |
parent | af5d13633f982eedb3899cb2cda2a6ad2a78b21f (diff) | |
download | fio-6feb475a9e775db911ee766a9671f244b8c1d35e.tar.gz fio-6feb475a9e775db911ee766a9671f244b8c1d35e.tar.bz2 |
Merge branch 'travis_cleanup' of https://github.com/sitsofe/fio
* 'travis_cleanup' of https://github.com/sitsofe/fio:
Makefile: fix incorrectly set libiscsi cflags
memory: fix incorrect pointer comparison when freeing cuda memory
travis: make CI install script bail out on first error
travis: enable libiscsi and cuda ioengines
travis: add dependency for cuda ioengine
travis: use install section instead of before_install section
configure: check for Debian/Ubuntu tcmalloc_minimal
travis: improve installation dependencies
travis: simplify yml file
-rw-r--r-- | .travis.yml | 18 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | ci/travis-build.sh | 23 | ||||
-rwxr-xr-x | ci/travis-install.sh | 26 | ||||
-rwxr-xr-x | configure | 15 | ||||
-rw-r--r-- | memory.c | 2 |
6 files changed, 53 insertions, 33 deletions
diff --git a/.travis.yml b/.travis.yml index b64f0a95..e35aff39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,36 +9,28 @@ arch: - amd64 - arm64 env: - matrix: - - BUILD_ARCH="x86" - - BUILD_ARCH="x86_64" global: - MAKEFLAGS="-j 2" matrix: include: + - os: linux + compiler: gcc + arch: amd64 + env: BUILD_ARCH="x86" # Only do the gcc x86 build to reduce clutter # Default xcode image - os: osx compiler: clang # Workaround travis setting CC=["clang", "gcc"] - env: BUILD_ARCH="x86_64" arch: amd64 # Latest xcode image (needs periodic updating) - os: osx compiler: clang osx_image: xcode11.2 - env: BUILD_ARCH="x86_64" arch: amd64 exclude: - os: osx compiler: gcc - - os: linux - compiler: clang - arch: amd64 - env: BUILD_ARCH="x86" # Only do the gcc x86 build to reduce clutter - - os: linux - env: BUILD_ARCH="x86" - arch: arm64 -before_install: +install: - ci/travis-install.sh script: @@ -62,7 +62,7 @@ endif ifdef CONFIG_LIBISCSI iscsi_SRCS = engines/libiscsi.c iscsi_LIBS = $(LIBISCSI_LIBS) - iscsi_CFLAGS = $(LIBISCSI_LIBS) + iscsi_CFLAGS = $(LIBISCSI_CFLAGS) ENGINES += iscsi endif diff --git a/ci/travis-build.sh b/ci/travis-build.sh index 06012e89..231417e2 100755 --- a/ci/travis-build.sh +++ b/ci/travis-build.sh @@ -1,16 +1,29 @@ #!/bin/bash +CI_TARGET_ARCH="${BUILD_ARCH:-$TRAVIS_CPU_ARCH}" EXTRA_CFLAGS="-Werror" PYTHONUNBUFFERED=TRUE +CONFIGURE_FLAGS=() -if [[ "$BUILD_ARCH" == "x86" ]]; then - EXTRA_CFLAGS="${EXTRA_CFLAGS} -m32" -fi +case "$TRAVIS_OS_NAME" in + "linux") + CONFIGURE_FLAGS+=(--enable-libiscsi) + case "$CI_TARGET_ARCH" in + "x86") + EXTRA_CFLAGS="${EXTRA_CFLAGS} -m32" + ;; + "amd64") + CONFIGURE_FLAGS+=(--enable-cuda) + ;; + esac + ;; +esac +CONFIGURE_FLAGS+=(--extra-cflags="${EXTRA_CFLAGS}") -./configure --extra-cflags="${EXTRA_CFLAGS}" && +./configure "${CONFIGURE_FLAGS[@]}" && make && make test && - if [[ "$TRAVIS_CPU_ARCH" == "arm64" ]]; then + if [[ "$CI_TARGET_ARCH" == "arm64" ]]; then sudo python3 t/run-fio-tests.py --skip 6 1007 1008 --debug -p 1010:"--skip 15 16 17 18 19 20" else sudo python3 t/run-fio-tests.py --skip 6 1007 1008 --debug diff --git a/ci/travis-install.sh b/ci/travis-install.sh index 232ab6b1..f76d5d40 100755 --- a/ci/travis-install.sh +++ b/ci/travis-install.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e +CI_TARGET_ARCH="${BUILD_ARCH:-$TRAVIS_CPU_ARCH}" case "$TRAVIS_OS_NAME" in "linux") # Architecture-dependent packages. @@ -7,7 +9,8 @@ case "$TRAVIS_OS_NAME" in libaio-dev libcunit1 libcunit1-dev - libgoogle-perftools4 + libfl-dev + libgoogle-perftools-dev libibverbs-dev libiscsi-dev libnuma-dev @@ -15,15 +18,23 @@ case "$TRAVIS_OS_NAME" in librdmacm-dev libz-dev ) - if [[ "$BUILD_ARCH" == "x86" ]]; then - pkgs=("${pkgs[@]/%/:i386}") - pkgs+=(gcc-multilib) - else - pkgs+=(glusterfs-common) + case "$CI_TARGET_ARCH" in + "x86") + pkgs=("${pkgs[@]/%/:i386}") + pkgs+=(gcc-multilib) + ;; + "amd64") + pkgs+=(nvidia-cuda-dev) + ;; + esac + if [[ $CI_TARGET_ARCH != "x86" ]]; then + pkgs+=(glusterfs-common) fi # Architecture-independent packages and packages for which we don't # care about the architecture. pkgs+=( + bison + flex python3 python3-scipy python3-six @@ -34,8 +45,7 @@ case "$TRAVIS_OS_NAME" in "osx") brew update >/dev/null 2>&1 brew install cunit - pip3 install scipy - pip3 install six + pip3 install scipy six ;; esac @@ -3006,11 +3006,16 @@ int main(int argc, char **argv) return 0; } EOF -if test "$disable_tcmalloc" != "yes" && compile_prog "" "-ltcmalloc" "tcmalloc"; then - LIBS="-ltcmalloc $LIBS" - tcmalloc="yes" -else - tcmalloc="no" +if test "$disable_tcmalloc" != "yes"; then + if compile_prog "" "-ltcmalloc" "tcmalloc"; then + tcmalloc="yes" + LIBS="-ltcmalloc $LIBS" + elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then + tcmalloc="yes" + LIBS="-l:libtcmalloc_minimal.so.4 $LIBS" + else + tcmalloc="no" + fi fi print_config "TCMalloc support" "$tcmalloc" @@ -274,7 +274,7 @@ static int alloc_mem_cudamalloc(struct thread_data *td, size_t total_mem) static void free_mem_cudamalloc(struct thread_data *td) { #ifdef CONFIG_CUDA - if (td->dev_mem_ptr != NULL) + if (td->dev_mem_ptr) cuMemFree(td->dev_mem_ptr); if (cuCtxDestroy(td->cu_ctx) != CUDA_SUCCESS) |