Skip to content

Commit

Permalink
Fix compiler flags 2 (#335)
Browse files Browse the repository at this point in the history
This patch fixes the error introduced by the last one.
It also enforces detection of VSX and ZVECTOR2.

Co-authored-by: shibatch <[email protected]>
  • Loading branch information
shibatch and shibatch authored Sep 15, 2020
1 parent 0a0877e commit cc4b021
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 21 deletions.
13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,21 @@ matrix:
- clang-8
env:
- LABEL="arm64-clang"
- os: linux
services: docker
env:
- LABEL="armhf-gcc"
- ENABLE_DOCKER="true"
- arch: ppc64le
dist: bionic
env:
- LABEL=common
- LABEL="ppc64le-gcc"
- OMP_WAIT_POLICY=passive CTEST_OUTPUT_ON_FAILURE=TRUE
- arch: ppc64le
compiler: clang
dist: bionic
env:
- LABEL=common
- LABEL="ppc64le-clang"
- OMP_WAIT_POLICY=passive CTEST_OUTPUT_ON_FAILURE=TRUE
- arch: s390x
dist: bionic
env:
- LABEL=common
- LABEL="s390x-gcc"
- OMP_WAIT_POLICY=passive CTEST_OUTPUT_ON_FAILURE=TRUE
- os: linux
arch: s390x
Expand All @@ -81,7 +76,7 @@ matrix:
packages:
- clang-8
env:
- LABEL="common"
- LABEL="s390x-clang"
- OMP_WAIT_POLICY=passive CTEST_OUTPUT_ON_FAILURE=TRUE

before_install:
Expand Down
18 changes: 9 additions & 9 deletions Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ option(DISABLE_SSE2 "Disable SSE2" OFF)
option(ENFORCE_SSE2 "Build fails if SSE2 is not supported by the compiler" OFF)

if(SLEEF_ARCH_X86 AND NOT DISABLE_SSE2)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_SSE2})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SSE2}")
CHECK_C_SOURCE_COMPILES("
#if defined(_MSC_VER)
#include <intrin.h>
Expand All @@ -519,7 +519,7 @@ option(DISABLE_SSE4 "Disable SSE4" OFF)
option(ENFORCE_SSE4 "Build fails if SSE4 is not supported by the compiler" OFF)

if(SLEEF_ARCH_X86 AND NOT DISABLE_SSE4)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_SSE4})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SSE4}")
CHECK_C_SOURCE_COMPILES("
#if defined(_MSC_VER)
#include <intrin.h>
Expand All @@ -541,7 +541,7 @@ option(ENFORCE_AVX "Disable AVX" OFF)
option(ENFORCE_AVX "Build fails if AVX is not supported by the compiler" OFF)

if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_AVX})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX}")
CHECK_C_SOURCE_COMPILES("
#if defined(_MSC_VER)
#include <intrin.h>
Expand All @@ -563,7 +563,7 @@ option(DISABLE_FMA4 "Disable FMA4" OFF)
option(ENFORCE_FMA4 "Build fails if FMA4 is not supported by the compiler" OFF)

if(SLEEF_ARCH_X86 AND NOT DISABLE_FMA4)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_FMA4})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_FMA4}")
CHECK_C_SOURCE_COMPILES("
#if defined(_MSC_VER)
#include <intrin.h>
Expand All @@ -585,7 +585,7 @@ option(DISABLE_AVX2 "Disable AVX2" OFF)
option(ENFORCE_AVX2 "Build fails if AVX2 is not supported by the compiler" OFF)

if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX2)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_AVX2})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX2}")
CHECK_C_SOURCE_COMPILES("
#if defined(_MSC_VER)
#include <intrin.h>
Expand All @@ -612,7 +612,7 @@ option(DISABLE_AVX512F "Disable AVX512F" OFF)
option(ENFORCE_AVX512F "Build fails if AVX512F is not supported by the compiler" OFF)

if(SLEEF_ARCH_X86 AND NOT DISABLE_AVX512F)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_AVX512F})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_AVX512F}")
CHECK_C_SOURCE_COMPILES("
#if defined(_MSC_VER)
#include <intrin.h>
Expand Down Expand Up @@ -644,7 +644,7 @@ option(DISABLE_SVE "Disable SVE" OFF)
option(ENFORCE_SVE "Build fails if SVE is not supported by the compiler" OFF)

if(SLEEF_ARCH_AARCH64 AND NOT DISABLE_SVE)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_SVE})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_SVE}")
CHECK_C_SOURCE_COMPILES("
#include <arm_sve.h>
int main() {
Expand All @@ -666,7 +666,7 @@ option(DISABLE_VSX "Disable VSX" OFF)
option(ENFORCE_VSX "Build fails if VSX is not supported by the compiler" OFF)

if(SLEEF_ARCH_PPC64 AND NOT DISABLE_VSX)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_VSX})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_VSX}")
CHECK_C_SOURCE_COMPILES("
#include <altivec.h>
#ifndef __LITTLE_ENDIAN__
Expand Down Expand Up @@ -696,7 +696,7 @@ option(DISABLE_ZVECTOR2 "Disable ZVECTOR2" OFF)
option(ENFORCE_ZVECTOR2 "Build fails if ZVECTOR2 is not supported by the compiler" OFF)

if(SLEEF_ARCH_S390X AND NOT DISABLE_ZVECTOR2)
set(CMAKE_REQUIRED_FLAGS ${FLAGS_ENABLE_ZVECTOR2})
string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${FLAGS_ENABLE_ZVECTOR2}")
CHECK_C_SOURCE_COMPILES("
#include <vecintrin.h>
int main() {
Expand Down
4 changes: 2 additions & 2 deletions src/libm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ if(BUILD_INLINE_HEADERS)
COMMAND ${SED_COMMAND} -e "s/^[[:space:]]*$//g" ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp4 # sed -e "s/^[[:space:]]*$//g" /build/src/libm/sleefSSE2.h.tmp4
> ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp5 # > /build/src/libm/sleefSSE2.h.tmp5
COMMAND ${SED_COMMAND} "/^$/N;/^\\n$/D" ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp5 # sed -e "/^$/N;/^\n$/D" /build/src/libm/sleefSSE2.h.tmp5
> ${CMAKE_CURRENT_BINARY_DIR}/include/sleefinline_${SIMDLC}.tmp6 # > /build/src/libm/sleefSSE2.h.tmp6
> ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp6 # > /build/src/libm/sleefSSE2.h.tmp6

COMMAND $<TARGET_FILE:addSuffix> ${CMAKE_CURRENT_BINARY_DIR}/include/sleefinline_${SIMDLC}.tmp6 # addSuffix /build/src/libm/sleefSSE2.h.tmp6
COMMAND $<TARGET_FILE:addSuffix> ${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp6 # addSuffix /build/src/libm/sleefSSE2.h.tmp6
${CMAKE_CURRENT_SOURCE_DIR}/keywords.txt "_${SIMDLC}_sleef" # keywords.txt "_sse2_sleef"
> ${PROJECT_BINARY_DIR}/include/sleefinline_${SIMDLC}.h # > /build/include/sleefinline_sse2.h

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions travis/before_install.ppc64le-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ev
uname -a
sudo apt-get -qq update
sudo apt-get install -y libmpfr-dev libssl-dev libfftw3-dev ninja-build
5 changes: 5 additions & 0 deletions travis/before_install.s390x-clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ev
uname -a
sudo apt-get -qq update
sudo apt-get install -y libmpfr-dev libssl-dev libfftw3-dev ninja-build
5 changes: 5 additions & 0 deletions travis/before_install.s390x-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ev
uname -a
sudo apt-get -qq update
sudo apt-get install -y libmpfr-dev libssl-dev libfftw3-dev ninja-build
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -ev
mkdir build && cd build

cmake -G Ninja -DRUNNING_ON_TRAVIS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install \
-DSLEEF_SHOW_CONFIG=1 -DENFORCE_TESTER3=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE ..
-DSLEEF_SHOW_CONFIG=1 -DENFORCE_TESTER3=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE -DENFORCE_VSX=TRUE ..
6 changes: 6 additions & 0 deletions travis/before_script.ppc64le-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
mkdir build && cd build

cmake -G Ninja -DRUNNING_ON_TRAVIS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install \
-DSLEEF_SHOW_CONFIG=1 -DENFORCE_TESTER3=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE -DENFORCE_VSX=TRUE ..
6 changes: 6 additions & 0 deletions travis/before_script.s390x-clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
mkdir build && cd build

cmake -G Ninja -DRUNNING_ON_TRAVIS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install \
-DSLEEF_SHOW_CONFIG=1 -DENFORCE_TESTER3=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE -DENFORCE_ZVECTOR2=TRUE ..
6 changes: 6 additions & 0 deletions travis/before_script.s390x-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
mkdir build && cd build

cmake -G Ninja -DRUNNING_ON_TRAVIS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install \
-DSLEEF_SHOW_CONFIG=1 -DENFORCE_TESTER3=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE -DENFORCE_ZVECTOR2=TRUE ..
File renamed without changes.
6 changes: 6 additions & 0 deletions travis/script.ppc64le-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
cd build
ninja all
ctest -j `nproc`
ninja install
6 changes: 6 additions & 0 deletions travis/script.s390x-clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
cd build
ninja all
ctest -j `nproc`
ninja install
6 changes: 6 additions & 0 deletions travis/script.s390x-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
cd build
ninja all
ctest -j `nproc`
ninja install

0 comments on commit cc4b021

Please sign in to comment.