Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interflop #13

Merged
merged 57 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2c6bc91
Add missing VERSION file
yohanchatelain Apr 10, 2024
07747b1
Add missing config file in configure and fix default prefix
yohanchatelain Apr 11, 2024
fa7405c
Update Docker CI
yohanchatelain Apr 11, 2024
69fffc7
Docker test
yohanchatelain Apr 11, 2024
5ba85f4
Tree
yohanchatelain Apr 11, 2024
cb284e0
Create m4 dir at autogen step
yohanchatelain Apr 11, 2024
833df8d
Fix workflow
yohanchatelain Apr 11, 2024
9a86933
Fix Docker tag
yohanchatelain Apr 11, 2024
6920227
Add missing tags
yohanchatelain Apr 11, 2024
68082e2
Add missing /bin/bash
yohanchatelain Apr 11, 2024
18261d2
Merge branch 'master' into interflop
yohanchatelain Apr 11, 2024
b3056a1
Remove interflop-install.sh script and do installation at Verficarlo …
yohanchatelain Apr 11, 2024
4bde942
Update dependencies requirements
yohanchatelain Apr 11, 2024
e8aa9d8
Add strategy matrix to test llvm version
yohanchatelain Apr 12, 2024
d4bfc3c
Add missing dash
yohanchatelain Apr 12, 2024
9d64cb6
Add missing dash
yohanchatelain Apr 12, 2024
8b2ef11
Merge branch 'master' into interflop
yohanchatelain Apr 12, 2024
292e62d
Fix tag in CI
yohanchatelain Apr 12, 2024
9792afa
Fix env
yohanchatelain Apr 12, 2024
9519f4a
Add UBUNTU_VERSION
yohanchatelain Apr 12, 2024
0d81d60
Update UBUNTU_VERSION
yohanchatelain Apr 12, 2024
a0c7d50
Update UBUNTU_VERSION
yohanchatelain Apr 12, 2024
d2af743
Updates:
yohanchatelain Apr 12, 2024
8f3b21e
Fix wrong os name CI
yohanchatelain Apr 12, 2024
da92a4b
Rename matrix job name
yohanchatelain Apr 12, 2024
177d754
Update Github-host
yohanchatelain Apr 12, 2024
bbfb945
Fix
yohanchatelain Apr 12, 2024
f3acd19
Remove prng and Verrou dependencies from fma for
yohanchatelain Apr 17, 2024
fe0aad9
Update __float128 -> _Float128
yohanchatelain Apr 17, 2024
86e9eb7
Update logger:
yohanchatelain Apr 17, 2024
5e9fadc
Update the tests:
yohanchatelain Apr 17, 2024
d7a0ec3
Fix issues with vprec backend:
yohanchatelain Apr 17, 2024
2ae6369
Update documentation
yohanchatelain Apr 17, 2024
14bd94e
Remove ADDR2LINE inclusion since it is handled by the configure
yohanchatelain Apr 17, 2024
fd5b0ef
Update CI
yohanchatelain Apr 17, 2024
14366c1
Use GCC_PATH in tests
yohanchatelain Apr 17, 2024
e18bdea
Fix flang check in Dockerfile
yohanchatelain Apr 17, 2024
7077d91
Fix string equality
yohanchatelain Apr 17, 2024
0913fa3
test
yohanchatelain Apr 17, 2024
3e2a88c
Use ENV to store flang option
yohanchatelain Apr 17, 2024
3fe3da5
Use if then else in RUN
yohanchatelain Apr 18, 2024
18d4575
Use Makefile for parallel compilation in tests
yohanchatelain Apr 25, 2024
0223aa7
Mark test_static as XFAIL:
yohanchatelain Apr 25, 2024
1a8c816
Make ubuntu-23.10 tests 'continue-on-error'
yohanchatelain Apr 25, 2024
f27f76f
Fix tests passing while they must fail
yohanchatelain Apr 25, 2024
a12f41f
Update test for ubuntu-24.04
yohanchatelain Apr 25, 2024
a5cc9d3
Add missing Dockerfile
yohanchatelain Apr 25, 2024
9062f77
Fix typo
yohanchatelain Apr 25, 2024
677ebd5
Remove 'set -e' for test using code ret 1 as intermediate results
yohanchatelain Apr 25, 2024
c6bfcc3
Fix LLVM version for addr2line
yohanchatelain Apr 26, 2024
c92d6c1
Fix min LLVM version for addr2line (7 -> 8)
yohanchatelain Apr 26, 2024
b69718d
Add strncpy in interflop-stdlib
yohanchatelain Apr 26, 2024
dd5ec79
Fix bug in interflop_vprec_function_instrumentation.c
yohanchatelain Apr 26, 2024
f420546
Update Dockerfile for llvm-16 test
yohanchatelain Apr 26, 2024
2a571e9
Set llvm-16 as the latest version supported
yohanchatelain Apr 26, 2024
23e20f5
Add test for FMA
yohanchatelain Apr 26, 2024
6effe76
Force fma instruction in test_fma_inst
yohanchatelain Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 84 additions & 4 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,88 @@ on:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
release:
types: [ published ]

env:
TEST_TAG: verificarlo/verificarlo:test
LATEST_TAG: verificarlo/verificarlo:latest

jobs:
docker-flang:
runs-on: ubuntu-22.04
env:
TEST_TAG: verificarlo/verificarlo:test
LATEST_TAG: ${{ github.repository }}:latest
RELEASE_TAG: ${{ github.repository }}:${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name == 'release'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }} /bin/bash -c "make -C /build/verificarlo installcheck"
- name: Build and push
if: github.event_name == 'release'
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.LATEST_TAG }}
${{ env.RELEASE_TAG }}

docker:
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu:20.04
llvm: 7
gcc: 7
- os: ubuntu:20.04
llvm: 8
gcc: 7
- os: ubuntu:20.04
llvm: 9
gcc: 7
- os: ubuntu:20.04
llvm: 10
gcc: 7
- os: ubuntu:22.04
llvm: 11
gcc: 9
- os: ubuntu:22.04
llvm: 12
gcc: 9
- os: ubuntu:22.04
llvm: 13
gcc: 9
- os: ubuntu:22.04
llvm: 14
gcc: 9
- os: ubuntu:22.04
llvm: 15
gcc: 9
- os: ubuntu:24.04
llvm: 16
gcc: 9
file: Dockerfile_ubuntu-24.04
runs-on: ubuntu-22.04
env:
TEST_TAG: verificarlo/verificarlo:test-llvm-${{ matrix.llvm }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,6 +99,12 @@ jobs:
context: .
load: true
tags: ${{ env.TEST_TAG }}
file: ${{ matrix.file || 'Dockerfile' }}
build-args: |
UBUNTU_VERSION=${{ matrix.os }}
LLVM_VERSION=${{ matrix.llvm }}
GCC_VERSION=${{ matrix.gcc }}
WITH_FLANG=
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }} /bin/bash -c "make -C /build/verificarlo installcheck"
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# This image includes support for Fortran and uses llvm-7 and gcc-7
#

FROM ubuntu:20.04
ARG UBUNTU_VERSION=ubuntu:20.04
FROM ${UBUNTU_VERSION}
LABEL maintainer="verificarlo contributors <[email protected]>"

ARG PYTHON_VERSION=3.8
ARG LLVM_VERSION=7
ARG GCC_VERSION=7
ARG WITH_FLANG=flang
ARG GCC_PATH=/usr/lib/gcc/x86_64-linux-gnu/${GCC_VERSION}
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
ENV PATH /usr/local/bin:$PATH
Expand All @@ -20,8 +22,9 @@ RUN apt-get -y install --no-install-recommends \
bash ca-certificates make git libmpfr-dev \
autogen dh-autoreconf autoconf automake autotools-dev libedit-dev libtool libz-dev binutils \
clang-${LLVM_VERSION} llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev \
libomp5-${LLVM_VERSION} libomp-${LLVM_VERSION}-dev \
gcc-${GCC_VERSION} g++-${GCC_VERSION} \
gfortran-${GCC_VERSION} libgfortran-${GCC_VERSION}-dev flang \
gfortran-${GCC_VERSION} libgfortran-${GCC_VERSION}-dev ${WITH_FLANG} \
python3 python3-pip python3-dev cython3 parallel && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -30,7 +33,7 @@ WORKDIR /build/
ENV LIBRARY_PATH ${GCC_PATH}:$LIBRARY_PATH

# Install other Python dependencies (not available with apt-get) via pip
RUN ln -s /usr/bin/x86_64-linux-gnu-gcc-7 /usr/bin/x86_64-linux-gnu-gcc
RUN ln -s /usr/bin/x86_64-linux-gnu-gcc-${GCC_VERSION} /usr/bin/x86_64-linux-gnu-gcc

# Download and configure verificarlo from git master
ENV AR=gcc-ar-${GCC_VERSION}
Expand All @@ -40,12 +43,16 @@ ENV CXX=g++-${GCC_VERSION}
COPY . /build/verificarlo/
WORKDIR /build/verificarlo

RUN ./install-interflop.sh && \

RUN if [ "$WITH_FLANG" = "flang" ]; then \
export FLANG_OPTION="--with-flang"; \
else \
export FLANG_OPTION="--without-flang"; \
fi && \
./autogen.sh && \
./configure \
--with-llvm=$(llvm-config-${LLVM_VERSION} --prefix) \
--with-flang CC=gcc-${GCC_VERSION} CXX=g++-${GCC_VERSION} \
|| cat config.log
$FLANG_OPTION || { cat config.log; exit 1; }

# Build verificarlo
RUN make && make install
Expand Down
62 changes: 62 additions & 0 deletions Dockerfile_ubuntu-24.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# Dockerfile for Verificarlo (github.com/verificarlo/verificarlo)
# This image includes support for Fortran and uses llvm-7 and gcc-7
#

ARG UBUNTU_VERSION=ubuntu:24.04
FROM ${UBUNTU_VERSION}
LABEL maintainer="verificarlo contributors <[email protected]>"

ARG PYTHON_VERSION=3.12
ARG LLVM_VERSION=14
ARG GCC_VERSION=9
ARG WITH_FLANG=flang
ARG GCC_PATH=/usr/lib/gcc/x86_64-linux-gnu/${GCC_VERSION}
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
ENV PATH /usr/local/bin:$PATH
ENV PYTHONPATH /usr/local/lib/python${PYTHON_VERSION}/site-packages/:${PYTHONPATH}

# Retrieve dependencies
RUN apt-get -y update && apt-get -y --no-install-recommends install tzdata
RUN apt-get -y install --no-install-recommends \
bash ca-certificates make git libmpfr-dev \
autogen dh-autoreconf autoconf automake autotools-dev libedit-dev libtool libz-dev binutils \
libstdc++-14-dev libomp-${LLVM_VERSION}-dev libclang-rt-${LLVM_VERSION}-dev \
clang-${LLVM_VERSION} llvm-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev \
gcc-${GCC_VERSION} g++-${GCC_VERSION} \
gfortran-${GCC_VERSION} libgfortran-${GCC_VERSION}-dev ${WITH_FLANG} \
python3 python3-pip python3-dev cython3 parallel && \
rm -rf /var/lib/apt/lists/*

WORKDIR /build/

ENV LIBRARY_PATH ${GCC_PATH}:$LIBRARY_PATH

# Install other Python dependencies (not available with apt-get) via pip
RUN ln -s /usr/bin/x86_64-linux-gnu-gcc-${GCC_VERSION} /usr/bin/x86_64-linux-gnu-gcc

# Download and configure verificarlo from git master
ENV AR=gcc-ar-${GCC_VERSION}
ENV RANLIB=gcc-ranlib-${GCC_VERSION}
ENV CC=gcc-${GCC_VERSION}
ENV CXX=g++-${GCC_VERSION}
COPY . /build/verificarlo/
WORKDIR /build/verificarlo


RUN if [ "$WITH_FLANG" = "flang" ]; then \
export FLANG_OPTION="--with-flang"; \
else \
export FLANG_OPTION="--without-flang"; \
fi && \
./autogen.sh && \
./configure \
--with-llvm=$(llvm-config-${LLVM_VERSION} --prefix) \
$FLANG_OPTION || { cat config.log; exit 1; }

# Build verificarlo
RUN make && make install

# Setup working directory
VOLUME /workdir
WORKDIR /workdir
15 changes: 13 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
ACLOCAL_AMFLAGS=-I m4

all: interflop-stdlib-install $(SUBDIRS)

interflop-stdlib-install:
make -C src/interflop-stdlib
make -C src/interflop-stdlib install

SUBDIRS=src/

dist_bin_SCRIPTS=verificarlo verificarlo-c verificarlo-f verificarlo-c++
Expand Down Expand Up @@ -26,7 +33,7 @@ check:
@echo "Tests should be run after install with make installcheck"

install-exec-hook:
$(PYTHON) -m pip install . && \
$(PYTHON) -m pip install $(PYTHON_INSTALL_FLAGS) . && \
echo "Run 'source $(setenvdir)/set-env' to set environment variables"

installcheck:
Expand All @@ -44,7 +51,11 @@ installcheck:
fi

# clean-local is a clean dependency of autotool clean target
clean-local: cleantests
clean-local: cleanstdlib cleantests

cleanstdlib:
# Clean interflop-stdlib directory
cd src/interflop-stdlib && make clean && cd ../..

cleantests:
# Clean tests directory
Expand Down
34 changes: 29 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ GCC_VERSION=`$CC --version | head -n1 | awk '{print $NF;}'`
AC_MSG_CHECKING([for gcc version])
AC_DEFINE_UNQUOTED([GCC_VERSION],[$GCC_VERSION],[The gcc version])
AC_MSG_RESULT([$GCC_VERSION])
AX_COMPARE_VERSION([$GCC_VERSION],[ge],['6.0.0'],[],[AC_MSG_ERROR([At least GCC version 6 is required])])
AX_COMPARE_VERSION([$GCC_VERSION],[ge],['7.0.0'],[],[AC_MSG_ERROR([At least GCC version 7 is required])])
AC_DEFINE_UNQUOTED([GCC_PATH], ["$CC"], [GCC path (for compiling)])
AC_SUBST(GCC_PATH, $CC)
AX_LLVM([4.0],[15.0.6],[all])
AX_LLVM([4.0],[16.0.6],[all])
AC_SUBST(LLVM_CPPFLAGS, $LLVM_CPPFLAGS)
AC_SUBST(LLVM_LDFLAGS, $LLVM_LDFLAGS)
AC_SUBST(LLVM_VERSION_MAJOR, $LLVM_VERSION_MAJOR)

GLIBC_VERSION=`ldd --version | head -n1 | awk '{print $NF;}'`
AC_MSG_CHECKING([for glibc version])
AC_DEFINE_UNQUOTED([GLIBC_VERSION],[$GLIBC_VERSION],[The glibc version])
AC_MSG_RESULT([$GLIBC_VERSION])
AX_COMPARE_VERSION([$GLIBC_VERSION],[ge],['2.28.0'],[],[AC_MSG_ERROR([At least glibc version 2.28 is required])])

AC_PATH_PROG([CLANG], [clang], "", $LLVM_BINDIR/ $PATH)
if test -z "$CLANG"; then
AC_PATH_PROGS([CLANG], [clang-"$LLVM_VERSION_MAJOR"."$LLVM_VERSION_MINOR" clang], "")
Expand Down Expand Up @@ -174,8 +180,8 @@ AC_FUNC_REALLOC

AC_CHECK_FUNCS([atexit dup2 floor getenv gettimeofday getpagesize getpid memset mkdir pow sqrt strcasecmp strchr strdup strerror strrchr strstr strtol strtoull tzset utime])

# Check for Python 3
AM_PATH_PYTHON([3])
# Check for Python 3.8
AM_PATH_PYTHON([3.8])

if test -n "$PYTHON" && test -x "$PYTHON" ; then
AC_MSG_CHECKING([for python])
Expand All @@ -190,7 +196,25 @@ else
AC_MSG_ERROR([could not find python 2.7 or higher])])
fi


# Get Python version
PYTHON_VERSION=`$PYTHON --version 2>&1 | awk '{print $2;}'`
AC_MSG_CHECKING([for python version])
AC_DEFINE_UNQUOTED([PYTHON_VERSION],[$PYTHON_VERSION],[The python version])
AC_MSG_RESULT([$PYTHON_VERSION])

# Compare Python version with 3.11
AX_COMPARE_VERSION([$PYTHON_VERSION],[ge],['3.11.0'],
# Since Python 3.11, the --break-system-packages flag is required to install packages
# in the user site directory. This is to avoid conflicts with system packages like apt.
# https://peps.python.org/pep-0668/
[PYTHON_INSTALL_FLAGS="--break-system-packages"], # If Python version >= 3.11
[PYTHON_INSTALL_FLAGS=""] # If Python version < 3.11
)

AC_DEFINE_UNQUOTED([PYTHON_INSTALL_FLAGS], ["$PYTHON_INSTALL_FLAGS"], [Python install flags])
AC_SUBST(PYTHON_INSTALL_FLAGS, $PYTHON_INSTALL_FLAGS)

AC_CONFIG_SUBDIRS([src/interflop-stdlib])

AX_WARNINGS()
AX_LTO()
Expand Down
Loading
Loading