Skip to content

Commit

Permalink
logarithmic number system bug fixes (#299)
Browse files Browse the repository at this point in the history
* bumping SEMVER to v3.58

* adding lns performance baseline

* adding dynamic range API to LNS

* adding special values constexpr constructor to lns

* Fix posit8_str C API declaration/definition mismatch

Fixes a warning (gcc12):

c_api/pure_c/posit/posit8.c:43:23: warning:
argument 1 of type ‘char *’ declared as a pointer [-Warray-parameter=]
   43 | void posit8_str(char* str, posit8_t a)

include/universal/number/posit/posit_c_macros.h:90:29: note:
previously declared as an array ‘char[static 16]’
   90 | void POSIT_MKNAME(str)(char out[static POSIT_MKNAME(str_SIZE)],
                               POSIT_T p);

* Fix missing <cstring> include for paranoia.c strrchr

The missing #include breaks the build (on gcc12)

* Simplify clear()

*this = {} copy-assign a default constructed object

* Reduce repetitive array code with variadics

The blocksignificant(raw,radixPoint) constructor, and
the significant_ull() member function were using constexpr-if chains
to initialize or read from array elements.

Variadic template expansion reduces the code size and the chances of
cut-n-paste errors between the different-size code blocks.
It does however increase the logic complexity (and compile time).

Using std::index_sequence<I...> to deduce I.. requires two stages;
a variadic helper constructor is added and delegated to while the
significant_ull member function does a recursive bootstrap.

* Apply noexcept consistently

Universal has a lot of noexcept spec functions, and that seems the right
decision for a provider of low level types. The noexcept usage in this
blocksignificant file was inconsistent, so I made it more consistent by
adding noexcept in most places, apart from on the division functions in
case divide by zero is defined as throwing in future.

* Remove inline specifier from member functions defined in class

They're implicitly inline when defined in-line.

Note that the inline spec is left on the free function defined at the
end of the file (twosComplementFree) because it is needed there.

* Add more constexpr, for consistency

* Make more friends, make them public and hidden

There were some private friend declarations at the end of the class
definition, then the definitions were free function templates.
I removed the private label, making them public, and brought the
definitions inline, also bringing in other free operators that were
not declared inline.

* Add missing template disambiguator

Stops GCC 12 warnings

* Silence type-punning warning

GCC warning:
dereferencing type-punned pointer will break strict-aliasing rules

on e.g.  uint32_t f(float f) { return *(uint32_t*)&f; }

Silenced by using a union instead.

* Add initializers to silence uninitialized warnings

These are all due to type_tag(x) implementations that access their
argument x. Ironically, it looks like these were modified at some
point to access their argument in order to silence warnings about
'unused formal parameter'; a fix for that should be to remove the
formal parameter name (and its superfluous use) - I'll do a PR.

* Remove type_tag formal arg name, and its use

The type_tag(x) overload implementations deduce their argument type:

    template <typename X> string type_tag(X x);
 or template <typename X> string type_tag(X const& x);

The formal argument x shouldn't be used; only its type X is pertinent.
The declarations should drop the name:

  template <typename X> string type_tag(X);

An alternative signature then takes no argument; convenient when there
is no variable to use so it saves declaring one uneccesarily:

  template <typename X> string type_tag();

Here the type cannot be deduced so must be provided: type_tag<X>().
The two overloads can be combined into a one with a default argument:

  template <typename X> string type_tag(X = {});

(assuming that X is default constructible).

Note that type_tag should really be a constexpr function (or a variable
template, or a type trait) because it deals only with types. However,
relying on C++ runtime typeinfo disallows any compile-time definition,
as does returning std::string (and implementing with stringstream).

If the signature is changed to return a 'constexpr string' type then
I can PR a constexpr type_tag implementation.

* adding MSC guard to specialize posit8_str for vc++

* Comment out unused retval variable

Looks like it should've been commented out in recent change
"cleaning up blocktriple regression tests to reduce output"
which commented out retval's useage.

Commenting out rather than removing because there's a TODO.

(Third time I've prepared this change, it keeps getting lost.)
(I think this is the last of the non _block related warnings.)

* completing classify regression test

* gcc fix for missing fpclassify declaration

* WIP: debugging fmod behavior: it appears to use double precision math

* bit_cast polyfill, detects and uses std, builtin or non-builtin

C++20 introduced std::bit_cast, with clang, gcc and msvc implementing
it with a builtin, __builtin_bit_cast(T,v), portable between compilers
and available in < c++20 language modes.

If compiler-provided constexpr-capable bit_cast is detected it's used,
otherwise this header defines a non-constexpr bit_cast, useful as a
UB-free alternative to 'type-punning', for trivially copyable types.

The BIT_CAST_CONSTEXPR preprocessor symbol is defined as constexpr if
sw::bit_cast is constexpr, otherwise it's defined as empty, allowing
clients to propagate constexpr on functions that depend on bit_cast,
and BIT_CAST_IS_CONSTEXPR symbol is defined as true or false.

The earlier BIT_CAST_SUPPORT, and related CONSTEXRESSION, symbols are
now redundant and can be deprecated.

* removing unused files

* adding dev containers for different gcc compilers

* adding MSVC compiler flag to enable latest C++20 features

* redesigning the lerp function include

* WIP: creating a common arithmetic behavior configuration enum

* adding negation to lns and streamlining arithmetic type testing

* forgot to make lns negation operator-() constexpr

Co-authored-by: Will Wray <[email protected]>
  • Loading branch information
Ravenwater and willwray authored Jul 16, 2022
1 parent 3504810 commit f2b3345
Show file tree
Hide file tree
Showing 60 changed files with 1,772 additions and 631 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/gcc11.builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"image": "stillwater/universal:gcc11.builder"
}
3 changes: 3 additions & 0 deletions .devcontainer/gcc9.builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"image": "stillwater/universal:gcc9.builder"
}
23 changes: 12 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(NOT DEFINED UNIVERSAL_VERSION_MAJOR)
set(UNIVERSAL_VERSION_MAJOR 3)
endif()
if(NOT DEFINED UNIVERSAL_VERSION_MINOR)
set(UNIVERSAL_VERSION_MINOR 57)
set(UNIVERSAL_VERSION_MINOR 58)
endif()
if(NOT DEFINED UNIVERSAL_VERSION_PATCH)
set(UNIVERSAL_VERSION_PATCH 1)
Expand Down Expand Up @@ -133,12 +133,12 @@ option(BUILD_BENCHMARK_ENERGY "Set to ON to build mixed-prec energy b
option(BUILD_BENCHMARK_ACCURACY "Set to ON to build accuracy benchmarks" OFF)

# mixed-precision algorithm design and optimization
option(BUILD_MIXEDPRECISION_ROOTS "Set to ON to build mixed-precision root finders" OFF)
option(BUILD_MIXEDPRECISION_APPROXIMATE "Set to ON to build mixed-precision approximation" OFF)
option(BUILD_MIXEDPRECISION_INTEGRATE "Set to ON to build mixed-precision integration" OFF)
option(BUILD_MIXEDPRECISION_INTERPOLATE "Set to ON to build mixed-precision interpolation" OFF)
option(BUILD_MIXEDPRECISION_OPTIMIZE "Set to ON to build mixed-precision optimization" OFF)
option(BUILD_MIXEDPRECISION_CONJUGATE "Set to ON to build mixed-precision CG" OFF)
option(BUILD_MIXEDPRECISION_ROOTS "Set to ON to build mixed-precision root finders" OFF)
option(BUILD_MIXEDPRECISION_APPROXIMATE "Set to ON to build mixed-precision approximation" OFF)
option(BUILD_MIXEDPRECISION_INTEGRATE "Set to ON to build mixed-precision integration" OFF)
option(BUILD_MIXEDPRECISION_INTERPOLATE "Set to ON to build mixed-precision interpolation" OFF)
option(BUILD_MIXEDPRECISION_OPTIMIZE "Set to ON to build mixed-precision optimization" OFF)
option(BUILD_MIXEDPRECISION_LINEARALGEBRA "Set to ON to build mixed-precision linear algebra" OFF)

# validation
option(BUILD_VALIDATION_MATH "Set to ON to build math validation testbenches" OFF)
Expand Down Expand Up @@ -314,6 +314,7 @@ elseif(MSVC)
# Zc:__cplusplus not specified Any value 199711L
# Note that the MSVC compiler does not, and never will, support a C++11, C++03, or C++98 standards version switch.
# Also, the value of the __cplusplus macro is not affected by the /permissive- switch.
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /Zc:__cplusplus")
#set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /Zc:__cplusplus /std:c++14")
# for the moment turn off since we are getting: cl : Command line warning D9002: ignoring unknown option '/Zc:__cplusplus`
#set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} /std:c++17")
Expand Down Expand Up @@ -625,7 +626,7 @@ if(BUILD_MIXEDPRECISION_SDK)
set(BUILD_MIXEDPRECISION_INTEGRATE ON)
set(BUILD_MIXEDPRECISION_INTERPOLATE ON)
set(BUILD_MIXEDPRECISION_OPTIMIZE ON)
set(BUILD_MIXEDPRECISION_CONJUGATE ON)
set(BUILD_MIXEDPRECISION_LINEARALGEBRA ON)
endif(BUILD_MIXEDPRECISION_SDK)

if(BUILD_APP_ENVIRONMENT)
Expand Down Expand Up @@ -727,9 +728,9 @@ if(BUILD_MIXEDPRECISION_OPTIMIZE)
add_subdirectory("mixedprecision/optimization")
endif(BUILD_MIXEDPRECISION_OPTIMIZE)

if(BUILD_MIXEDPRECISION_CONJUGATE)
add_subdirectory("mixedprecision/linearalgebra/cg")
endif(BUILD_MIXEDPRECISION_CONJUGATE)
if(BUILD_MIXEDPRECISION_LINEARALGEBRA)
add_subdirectory("mixedprecision/linearalgebra")
endif(BUILD_MIXEDPRECISION_LINEARALGEBRA)

# performance benchmarks
if(BUILD_BENCHMARK_PERFORMANCE)
Expand Down
83 changes: 83 additions & 0 deletions Dockerfile.gcc11
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
# multi-stage build
# docker build --target builder -t stillwater/universal:builder will just build a builder container
# docker build --target release -t stillwater/universal:release will just build a release container

# BUILDER stage
FROM stillwater/universal:gcc11.builder as builder
LABEL Theodore Omtzigt
ARG target=BUILD_ALL

# make certain you have a good .dockerignore file installed so that this layer isn't ginormous
COPY --chown=stillwater:stillwater . /home/stillwater/universal
# print contextual information of the container at this state for visual inspection
RUN ls -la /home/stillwater/universal && cmake -version

# set up the cmake/make environment to issue the build commands
RUN mkdir -p /home/stillwater/universal/build
WORKDIR /home/stillwater/universal/build
# test RUN statement to drive CI testing. ARG target provides override.
# default is SANITY regression level: -DBUILD_REGRESSION_LEVEL_[1,2,3,4]=ON
# or -DBUILD_REGRESSION_STRESS=ON for stress testing
RUN cmake -D$target=ON -DBUILD_CMD_LINE_TOOLS=ON -DBUILD_DEMONSTRATION=OFF .. && make

# the command 'make test' is run as part of the CI test pipeline of the release container


# RELEASE stage
#FROM alpine:latest as release # hitting a segfault during startup of some playground programs
#FROM debian:buster-slim as release
FROM ubuntu:20.04 as release
LABEL Theodore Omtzigt

#RUN apk add --no-cache libc6-compat libstdc++ cmake make bash gawk sed grep bc coreutils
RUN apt-get update && apt-get update -y && apt-get install -y --no-install-recommends \
make \
&& apt-get clean
# create and use user stillwater
RUN useradd -ms /bin/bash stillwater
USER stillwater

# copy cmake enviroment needed for testing
COPY --from=builder /usr/local/bin/cmake /usr/local/bin/
COPY --from=builder /usr/local/bin/ctest /usr/local/bin/
# copy information material
COPY --from=builder /home/stillwater/universal/*.md /home/stillwater/universal/
# copy the docs
COPY --chown=stillwater:stillwater --from=builder /home/stillwater/universal/docs /home/stillwater/universal/docs
# no need to copy CMakeLists.txt as you don't have a compiler in this container
# and thus 'make -j 8' won't work anyway, only 'make test' which doesn't need CmakeLists.txt
#COPY --from=builder /home/stillwater/universal/CMakeLists.txt /home/stillwater/universal/

# after building, the test executables are organized in the build directory under stillwater
# ctest gets its configuration for CTestTestfile.cmake files. There is one at the root of the build tree
# and one for each directory that contains test executables.
# This way we can execute _make test_ in the test stage of the CI/CD pipeline as well as part of an interactive invocation
COPY --chown=stillwater:stillwater --from=builder /home/stillwater/universal/build /home/stillwater/universal/build

# copy the CLI tools to /usr/local/bin so they are immediately usable
COPY --from=builder /home/stillwater/universal/build/tools/cmd/areal /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/double /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/fixpnt /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/float /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/float2posit /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/ieee /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/lns /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/longdouble /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/plimits /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/posit /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/prop* /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/signedint /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/unsignedint /usr/local/bin/
# reenable when you figure out how to make this dependent on the BUILD target
#COPY --from=builder /home/stillwater/universal/build/validation/hw/* /usr/local/bin/

# double check we have all the executables of interest
#RUN find /home/stillwater/universal/build

# until we can figure out how to direct CodeShip to use this dir in the steps.yml file
WORKDIR /home/stillwater/universal/build

# the command 'make test' is run as part of the CI test pipeline of this release container

CMD ["echo", "Universal Numbers Release Container"]
83 changes: 83 additions & 0 deletions Dockerfile.gcc12
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
# multi-stage build
# docker build --target builder -t stillwater/universal:builder will just build a builder container
# docker build --target release -t stillwater/universal:release will just build a release container

# BUILDER stage
FROM stillwater/universal:gcc12.builder as builder
LABEL Theodore Omtzigt
ARG target=BUILD_ALL

# make certain you have a good .dockerignore file installed so that this layer isn't ginormous
COPY --chown=stillwater:stillwater . /home/stillwater/universal
# print contextual information of the container at this state for visual inspection
RUN ls -la /home/stillwater/universal && cmake -version

# set up the cmake/make environment to issue the build commands
RUN mkdir -p /home/stillwater/universal/build
WORKDIR /home/stillwater/universal/build
# test RUN statement to drive CI testing. ARG target provides override.
# default is SANITY regression level: -DBUILD_REGRESSION_LEVEL_[1,2,3,4]=ON
# or -DBUILD_REGRESSION_STRESS=ON for stress testing
RUN cmake -D$target=ON -DBUILD_CMD_LINE_TOOLS=ON -DBUILD_DEMONSTRATION=OFF .. && make

# the command 'make test' is run as part of the CI test pipeline of the release container


# RELEASE stage
#FROM alpine:latest as release # hitting a segfault during startup of some playground programs
#FROM debian:buster-slim as release
FROM ubuntu:20.04 as release
LABEL Theodore Omtzigt

#RUN apk add --no-cache libc6-compat libstdc++ cmake make bash gawk sed grep bc coreutils
RUN apt-get update && apt-get update -y && apt-get install -y --no-install-recommends \
make \
&& apt-get clean
# create and use user stillwater
RUN useradd -ms /bin/bash stillwater
USER stillwater

# copy cmake enviroment needed for testing
COPY --from=builder /usr/local/bin/cmake /usr/local/bin/
COPY --from=builder /usr/local/bin/ctest /usr/local/bin/
# copy information material
COPY --from=builder /home/stillwater/universal/*.md /home/stillwater/universal/
# copy the docs
COPY --chown=stillwater:stillwater --from=builder /home/stillwater/universal/docs /home/stillwater/universal/docs
# no need to copy CMakeLists.txt as you don't have a compiler in this container
# and thus 'make -j 8' won't work anyway, only 'make test' which doesn't need CmakeLists.txt
#COPY --from=builder /home/stillwater/universal/CMakeLists.txt /home/stillwater/universal/

# after building, the test executables are organized in the build directory under stillwater
# ctest gets its configuration for CTestTestfile.cmake files. There is one at the root of the build tree
# and one for each directory that contains test executables.
# This way we can execute _make test_ in the test stage of the CI/CD pipeline as well as part of an interactive invocation
COPY --chown=stillwater:stillwater --from=builder /home/stillwater/universal/build /home/stillwater/universal/build

# copy the CLI tools to /usr/local/bin so they are immediately usable
COPY --from=builder /home/stillwater/universal/build/tools/cmd/areal /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/double /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/fixpnt /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/float /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/float2posit /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/ieee /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/lns /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/longdouble /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/plimits /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/posit /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/prop* /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/signedint /usr/local/bin/
COPY --from=builder /home/stillwater/universal/build/tools/cmd/unsignedint /usr/local/bin/
# reenable when you figure out how to make this dependent on the BUILD target
#COPY --from=builder /home/stillwater/universal/build/validation/hw/* /usr/local/bin/

# double check we have all the executables of interest
#RUN find /home/stillwater/universal/build

# until we can figure out how to direct CodeShip to use this dir in the steps.yml file
WORKDIR /home/stillwater/universal/build

# the command 'make test' is run as part of the CI test pipeline of this release container

CMD ["echo", "Universal Numbers Release Container"]
2 changes: 1 addition & 1 deletion applications/adaptive/double-double.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ try {
a = 0.5;
b = 2.0;
c = a * b;
ReportValues(a, "*", b, c);
ReportBinaryOperation(a, "*", b, c);
}

std::cout << std::setprecision(precision);
Expand Down
12 changes: 10 additions & 2 deletions c_api/pure_c/posit/posit8.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// posit8.c: example program showing the use of the posit8_t type of the C API of the posit library
//
// Copyright (C) 2017-2021 Stillwater Supercomputing, Inc.
// Copyright (C) 2017-2022 Stillwater Supercomputing, Inc.
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.

Expand Down Expand Up @@ -39,8 +39,16 @@ int posit8_cmpp8(posit8_t a, posit8_t b) {
return a.v - b.v;
}

#if defined(__cplusplus) || defined(_MSC_VER)
// string conversion functions
void posit8_str(char* str, posit8_t a) {
void posit8_str(char str[16], posit8_t a) {
float f = posit8_tof(a);
sprintf(str, "%f", f);
}
#else
// string conversion functions
void posit8_str(char str[static 16], posit8_t a) {
float f = posit8_tof(a);
sprintf(str, "%f", f);
}
#endif
2 changes: 1 addition & 1 deletion docker/Dockerfile.gcc10.builder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# docker build --target gcc10builder -t stillwater/universal:gcc10builder

# BUILDER stage
FROM gcc:10.3 as gcc10builder
FROM gcc:10.4 as gcc10builder
LABEL Theodore Omtzigt
# create a build environment
RUN apt-get update && apt-get install -y --no-install-recommends -V \
Expand Down
41 changes: 41 additions & 0 deletions docker/Dockerfile.gcc11.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Dockerfile to create the builder container for compiling and testing Universal
# docker build --target gcc10builder -t stillwater/universal:gcc10builder

# BUILDER stage
FROM gcc:11.3 as gcc11builder
LABEL Theodore Omtzigt
# create a build environment
RUN apt-get update && apt-get install -y --no-install-recommends -V \
apt-utils \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# install a specific cmake version
RUN set -ex \
&& for key in C6C265324BBEBDC350B513D02D2CEF1034921684; do \
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$key" ; \
done

ENV CMAKE_DIR v3.23
ENV CMAKE_VERSION 3.23.1

RUN set -ex \
&& curl -fsSLO --compressed https://cmake.org/files/${CMAKE_DIR}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz \
&& curl -fsSLO https://cmake.org/files/${CMAKE_DIR}/cmake-${CMAKE_VERSION}-SHA-256.txt.asc \
&& curl -fsSLO https://cmake.org/files/${CMAKE_DIR}/cmake-${CMAKE_VERSION}-SHA-256.txt \
&& gpg --verify cmake-${CMAKE_VERSION}-SHA-256.txt.asc cmake-${CMAKE_VERSION}-SHA-256.txt \
&& grep "cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz\$" cmake-${CMAKE_VERSION}-SHA-256.txt | sha256sum -c - \
&& tar xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz -C /usr/local --strip-components=1 --no-same-owner \
&& rm -rf cmake-${CMAKE_VERSION}*

# create and use user stillwater
RUN useradd -ms /bin/bash stillwater
USER stillwater

WORKDIR /home/stillwater

# add a command that when you run the container without a command, it produces something meaningful
ENV CONTAINER_ID "Universal Numbers Library Builder V3 GCC 10.3"
CMD ["/usr/bin/env", "bash"]
41 changes: 41 additions & 0 deletions docker/Dockerfile.gcc12.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Dockerfile to create the builder container for compiling and testing Universal
# docker build --target gcc10builder -t stillwater/universal:gcc10builder

# BUILDER stage
FROM gcc:12.1 as gcc12builder
LABEL Theodore Omtzigt
# create a build environment
RUN apt-get update && apt-get install -y --no-install-recommends -V \
apt-utils \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# install a specific cmake version
RUN set -ex \
&& for key in C6C265324BBEBDC350B513D02D2CEF1034921684; do \
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$key" ; \
done

ENV CMAKE_DIR v3.23
ENV CMAKE_VERSION 3.23.1

RUN set -ex \
&& curl -fsSLO --compressed https://cmake.org/files/${CMAKE_DIR}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz \
&& curl -fsSLO https://cmake.org/files/${CMAKE_DIR}/cmake-${CMAKE_VERSION}-SHA-256.txt.asc \
&& curl -fsSLO https://cmake.org/files/${CMAKE_DIR}/cmake-${CMAKE_VERSION}-SHA-256.txt \
&& gpg --verify cmake-${CMAKE_VERSION}-SHA-256.txt.asc cmake-${CMAKE_VERSION}-SHA-256.txt \
&& grep "cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz\$" cmake-${CMAKE_VERSION}-SHA-256.txt | sha256sum -c - \
&& tar xzf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz -C /usr/local --strip-components=1 --no-same-owner \
&& rm -rf cmake-${CMAKE_VERSION}*

# create and use user stillwater
RUN useradd -ms /bin/bash stillwater
USER stillwater

WORKDIR /home/stillwater

# add a command that when you run the container without a command, it produces something meaningful
ENV CONTAINER_ID "Universal Numbers Library Builder V3 GCC 10.3"
CMD ["/usr/bin/env", "bash"]
2 changes: 1 addition & 1 deletion docker/Dockerfile.gcc9.builder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# docker build --target gcc10builder -t stillwater/universal:gcc10builder

# BUILDER stage
FROM gcc:9.4 as gcc9builder
FROM gcc:9.5 as gcc9builder
LABEL Theodore Omtzigt
# create a build environment
RUN apt-get update && apt-get install -y --no-install-recommends -V \
Expand Down
2 changes: 1 addition & 1 deletion docker/build_release_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# example would be to strace an executable to find its dependencies

MAJOR=v3
MINOR=57
MINOR=58
VERSION="$MAJOR.$MINOR"

if [[ $# == 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/build_test_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# example would be to strace an executable to find its dependencies

MAJOR=v3
MINOR=57
MINOR=58
VERSION="$MAJOR.$MINOR"

if [[ $# == 0 ]]; then
Expand Down
Loading

0 comments on commit f2b3345

Please sign in to comment.