Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
dellelce committed Apr 30, 2024
2 parents 507efaa + 403fe2e commit f77545c
Show file tree
Hide file tree
Showing 65 changed files with 581 additions and 23 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
# - name: Run mkit wrapper
# run: ls -lt && PROFILE="uwsgi" DOCKER_IMAGE="dellelce/uwsgi" PREFIX="/app/uwsgi" ./mkit-wrapper.sh yes
uses: actions/checkout@v4
- name: Mkit base image
run: make build-base BASE=$BASE_IMAGE && docker push $BASE_IMAGE
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE=alpine:3.8
ARG BASE=alpine:3.19
FROM $BASE as build

LABEL maintainer="Antonio Dell'Elce"
Expand All @@ -24,7 +24,7 @@ RUN mkdir -p ${INSTALLDIR}/lib && ln -s ${INSTALLDIR}/lib64 ${INSTALLDIR}/lib &
rm -f ${INSTALLDIR}/lib/*.a

# Second Stage
ARG BASE=alpine:3.8
ARG BASE=alpine:3.19
FROM $BASE AS final

ARG PREFIX=/app/httpd
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.8
FROM alpine:3.19

WORKDIR /mkit

Expand All @@ -12,4 +12,3 @@ COPY modules modules/
COPY mkit*.sh ./

RUN ls -lt

5 changes: 3 additions & 2 deletions mkit.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ run_build()
{
typeset pkg=""
typeset rc=0
typeset uncompress_rc=0
typeset buildprefix=""

[ ! -z "$CFLAGS" ] && { export BASE_CFLAGS="$CFLAGS"; unset CFLAGS; }
Expand Down Expand Up @@ -299,7 +300,6 @@ run_build()

[ $func_rc -ne 0 ] &&
{
# module was not found built-in: try as module
module_func="$MKIT/modules/${pkg}/build.sh"

[ -f "$module_func" ] &&
Expand All @@ -318,7 +318,8 @@ run_build()
# This is to be used when re-running a failed build and want to skip some components
have_hook global need_to_build && hook global need_to_build ${pkg} || continue

do_uncompress ${pkg} || return $?
# this must be skipped if no downloaded
[ -z "$(hook ${pkg} need_to_download)" ] && do_uncompress ${pkg} || return $?

[ "$build" -eq 1 ] &&
{
Expand Down
2 changes: 1 addition & 1 deletion mkit.config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### ENV ###

export srcget="0.0.14.2" # srcget version
export srcget="0.0.14.6" # srcget version

# vt100 family sequences
export ESC=""
Expand Down
4 changes: 4 additions & 0 deletions mkit.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ download()

for pkg in $RUNTIME_LIST
do
typeset dont_download=$(hook $pkg dont_download)

[ ! -z "$dont_download" ] && continue

typeset custom_download=$(hook $pkg custom_download)

[ -f "$custom_download" ] &&
Expand Down
12 changes: 11 additions & 1 deletion mkit.profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ profile_pythonbuild()
{
add_build_dep xz
add_build_dep libffi ncurses zlib bzip2 readline
add_build_dep openssl sqlite3
add_build_dep openssl1_1 sqlite3 expat
add_build_dep python3
}

Expand Down Expand Up @@ -468,6 +468,16 @@ profile_leptonica()
add_run_dep leptonica
}

profile_gpaw()
{
profile_python

add_run_dep libxc
add_run_dep lapack
add_run_dep openblas
add_run_dep gpaw
}

profile_bzip2()
{
add_run_dep bzip2
Expand Down
21 changes: 12 additions & 9 deletions mkit.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash
#
# This file has the "main" code of mkit.
# mkit builds software from source (dowloaded by srcget).
# Each "software"/package is defined by a function in mkit.profiles.sh in format:
#
# profile_NAME
#
Expand Down Expand Up @@ -57,7 +55,7 @@ mkit_setup_prefix()
export PATH="$prefix/bin:$PATH"
}

mkit_setup()
mkit_setup_paths()
{
export TIMESTAMP="$(date +%H%M_%d%m%y)"
export WORKDIR="$PWD/mkit_workdir"
Expand All @@ -84,6 +82,14 @@ mkit_setup()

export LOGSDIR="${WORKDIR}/logs"

mkdir -p "$BUILDDIR"
mkdir -p "$LOGSDIR"
mkdir -p "$SRCDIR"
mkdir -p "$DOWNLOADS"
}

mkit_args()
{
while [ "$1" != "" ]
do
arg="$1"
Expand All @@ -101,24 +107,21 @@ mkit_setup()
done

[ -z "$prefix" ] && mkit_setup_prefix # make sure prefix is set with defaults if the previous block failed
mkdir -p "$BUILDDIR"
mkdir -p "$LOGSDIR"
mkdir -p "$SRCDIR"
mkdir -p "$DOWNLOADS"
}

### MAIN ###

[ -z "$*" ] && { usage; exit; } # do not accept zero arguments

export MKIT=$(getdirfullpath $(dirname $0))
export srcgetUrl="https://github.com/dellelce/srcget/archive"

. $MKIT/mkit.config.sh || exit $?
. $MKIT/mkit.profiles.sh || exit $?

export srcgetUrl="https://github.com/dellelce/srcget/archive"
mkit_setup_paths
mkit_args $*

mkit_setup $*
. $MKIT/mkit.lib.sh || exit $?
. $MKIT/mkit.build.sh || exit $?
. $MKIT/mkit.components.sh || exit $?
Expand Down
1 change: 1 addition & 0 deletions modules/ase/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip3 --no-cache install ase
1 change: 1 addition & 0 deletions modules/ase/hooks/dont_download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo 1 # 1 = True = Do Not download
52 changes: 52 additions & 0 deletions modules/gpaw/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
build_gpaw()
{
[ -d "${prefix}/lib/pkgconfig" ] && export PKG_CONFIG_PATH="${prefix}/lib/pkgconfig";

build_gpaw_core gpaw $srcdir_gpaw

return $?
}

#
# Build gpaw
build_gpaw_core()
{
export rc_pipinstall=0
typeset id="$1"; shift # build id
typeset dir="$1"; shift # src directory
typeset pkgbuilddir="$BUILDDIR/$id"

# Other steps
[ ! -d "$pkgbuilddir" ] && { mkdir -p "$pkgbuilddir"; } ||
{
pkgbuilddir="$BUILDDIR/${id}.${RANDOM}"; mkdir -p "$pkgbuilddir";
}

cd "$pkgbuilddir" ||
{
echo "build_gpaw: Failed to change to build directory: " $pkgbuilddir;
return 1;
}

prepare_build $dir

echo "Building $id [${BOLD}$(getbasename $id)${RESET}] at $(date)"
echo

time_start

logFile=$(logger_file ${id}_make)
echo "Running pip install..."
{
LDFLAGS="-L${prefix}/lib -L/usr/lib -Wl,-rpath=${prefix}/lib -Wl,-rpath=/usr/lib" \
CFLAGS="-I${prefix}/include" \
pip3 install .
rc_pipinstall=$?
} > ${logFile} 2>&1
[ $rc_pipinstall -ne 0 ] && { cd "$cwd"; time_end; cat "${logFile}"; echo ; echo "Failed pip install for ${id}"; return $rc_make; }

cd "$WORKDIR"

time_end
return $rc_pipinstall
}
6 changes: 6 additions & 0 deletions modules/lapack/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build_lapack()
{
build_raw_lite lapack

return $?
}
4 changes: 4 additions & 0 deletions modules/lapack/hooks/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# generate Makefiles with cmake/"bootstrap"

cd ${BUILDDIR}/lapack
cmake "${srcdir_lapack}" -DCMAKE_INSTALL_PREFIX=${prefix}
2 changes: 1 addition & 1 deletion modules/libxc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#
build_libxc()
{
build_gnuconf libxc $srcdir_libxc
build_gnuconf libxc $srcdir_libxc --enable-shared
return $?
}
2 changes: 1 addition & 1 deletion modules/ncurses/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
build_ncurses()
{
build_gnuconf ncurses $srcdir_ncurses --with-shared --with-cxx-shared \
--without-ada
--without-ada --disable-lib-suffixes
return $?
}
6 changes: 6 additions & 0 deletions modules/openblas/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build_openblas()
{
build_raw_lite openblas

return $?
}
4 changes: 4 additions & 0 deletions modules/openblas/hooks/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# generate Makefiles with cmake/"bootstrap"

cd ${BUILDDIR}/openblas
cmake "${srcdir_openblas}" -DCMAKE_INSTALL_PREFIX=${prefix}
2 changes: 2 additions & 0 deletions modules/python3/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ build_python3()
typeset rc=0
typeset fn

[ -d "${prefix}/lib/pkgconfig" ] && export PKG_CONFIG_PATH="${prefix}/lib/pk config"

LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" \
CFLAGS="-I${prefix}/include" \
build_gnuconf python3 $srcdir_python3 \
Expand Down
6 changes: 6 additions & 0 deletions modules/scalapack/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build_scalapack()
{
build_raw_lite scalapack

return $?
}
3 changes: 3 additions & 0 deletions modules/scalapack/hooks/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

cd ${BUILDDIR}/scalapack
cmake "${srcdir_scalapack}" -DCMAKE_INSTALL_PREFIX=${prefix}
9 changes: 9 additions & 0 deletions profiles/bind/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
profile_bind()
{
# libxml2 & openssl are included in python profile
# mixing run-time and build-time dependencies is not supported at this time
# *IF* this means need to link from multiple prefixes)
profile_python
add_run_dep libuv
add_run_dep bind
}
6 changes: 6 additions & 0 deletions profiles/blender/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
profile_blender()
{
add_build_dep cmake
add_run_dep python # it needs python, but it could be a run-time dep only
add_run_dep blender
}
4 changes: 4 additions & 0 deletions profiles/bzip2/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
profile_bzip2()
{
add_run_dep bzip2
}
14 changes: 14 additions & 0 deletions profiles/cairo/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
profile_cairo()
{
#this will be needed when moving from alpine 3.8 to 3.9
#add_build_dep pkgconfig
add_run_dep zlib
add_run_dep libpng
add_run_dep freetype
add_run_dep gperf
add_run_dep expat
#I thought uuid was not mandatory, temporarily re-disabling
#add_run_dep fontconfig
add_run_dep pixman
add_run_dep cairo
}
6 changes: 6 additions & 0 deletions profiles/cmake/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# standalone cmake
profile_cmake()
{
add_build_dep openssl
add_run_dep cmake
}
7 changes: 7 additions & 0 deletions profiles/curl/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
profile_curl()
{
add_run_dep openssl
add_run_dep curl

return $?
}
24 changes: 24 additions & 0 deletions profiles/default/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# TODO: automate build orders & list
profile_default()
{
profile_gnubuild
profile_python
add_build_dep bison
add_run_dep expat
add_run_dep pcre
add_run_dep apr
add_run_dep aprutil
add_run_dep libxml2
add_run_dep httpd

[ "$PHP_NEEDED" == "1" ] &&
{
add_run_dep php
add_run_dep suhosin
}

add_run_dep python3
add_run_dep mod_wsgi

return $?
}
5 changes: 5 additions & 0 deletions profiles/fluentbit/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
profile_fluentbit()
{
add_build_dep cmake
add_run_dep fluentbit
}
11 changes: 11 additions & 0 deletions profiles/gcc/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
profile_gcc()
{
add_build_dep m4
add_run_dep zlib
add_run_dep binutils
add_run_dep gmp
add_run_dep mpfr
add_run_dep mpc
add_run_dep gcc
return $?
}
11 changes: 11 additions & 0 deletions profiles/gcc11/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
profile_gcc11()
{
add_build_dep m4
add_run_dep zlib
add_run_dep binutils
add_run_dep gmp
add_run_dep mpfr
add_run_dep mpc
add_run_dep gcc11
return $?
}
Loading

0 comments on commit f77545c

Please sign in to comment.