Skip to content

Commit

Permalink
Build Linux libs via GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Jan 5, 2025
1 parent a2b316c commit c321f80
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 4 deletions.
42 changes: 40 additions & 2 deletions .github/workflows/checkCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,46 @@ defaults:
shell: bash

jobs:
build:
name: build_${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux32
- linux64
include:
- platform: linux32
cflags: "-O3 -DNDEBUG -fPIC -msse2 -m32"
- platform: linux64
cflags: "-O3 -DNDEBUG -fPIC"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Build with gcc
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:16.04 bash -c "
apt-get update &&
apt-get install -y software-properties-common build-essential &&
add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
apt-get update &&
apt-get install -y gcc-4.8 g++-4.8 &&
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10 &&
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10 &&
pushd ExternData/Resources/C-Sources &&
make CFLAGS=\"${{ matrix.cflags }}\" CXXFLAGS=\"${{ matrix.cflags }}\" TARGETDIR=\"${{ matrix.platform }}\"
"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ExternData_${{ matrix.platform }}
path: ExternData/Resources/Library/${{ matrix.platform }}/*.a

test:
name: build_cmake_${{ matrix.toolchain }}
name: test_cmake_${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
Expand Down Expand Up @@ -49,7 +87,7 @@ jobs:
fi
env:
SRCDIR: ${{ github.workspace }}/ExternData/Resources
- name: Build with ${{ matrix.compiler }}
- name: Build tests with ${{ matrix.compiler }}
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake --build build --config ${{ matrix.configuration }}
Expand Down
54 changes: 52 additions & 2 deletions ExternData/Resources/C-Sources/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AR = ar -ru
RM = rm -f

CFLAGS = -O3
CPPFLAGS = -DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1 -DHAVE_HIDDEN=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_ZLIB=1 -DHAVE_HDF5=1 -DNDEBUG -DXML_POOR_ENTROPY -DHAVE_EXPAT_CONFIG_H -DLIBXML_STATIC
CPPFLAGS = -DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1 -DHAVE_STDINT_H=1 -DHAVE_HIDDEN=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_ZLIB=1 -DHAVE_HDF5=1 -DNDEBUG -DXML_POOR_ENTROPY -DHAVE_EXPAT_CONFIG_H -DLIBXML_STATIC
INC = -I"bsxml-json" -I"expat/lib" -I"hdf5/include" -I"inih" -I"libxls/include" -I"minizip" -I"modelica" -I"zlib" -I"parson" -I"libxml2/include"

TARGETDIR = linux64
Expand All @@ -29,6 +29,52 @@ INI_OBJS = \
JSON_OBJS = \
ED_JSONFile.o

LIBXML2_OBJS = \
libxml2/buf.o \
libxml2/c14n.o \
libxml2/catalog.o \
libxml2/chvalid.o \
libxml2/debugXML.o \
libxml2/dict.o \
libxml2/encoding.o \
libxml2/entities.o \
libxml2/error.o \
libxml2/globals.o \
libxml2/hash.o \
libxml2/HTMLparser.o \
libxml2/HTMLtree.o \
libxml2/legacy.o \
libxml2/list.o \
libxml2/nanoftp.o \
libxml2/nanohttp.o \
libxml2/parser.o \
libxml2/parserInternals.o \
libxml2/pattern.o \
libxml2/relaxng.o \
libxml2/SAX.o \
libxml2/SAX2.o \
libxml2/schematron.o \
libxml2/threads.o \
libxml2/tree.o \
libxml2/uri.o \
libxml2/valid.o \
libxml2/xinclude.o \
libxml2/xlink.o \
libxml2/xmlIO.o \
libxml2/xmlmemory.o \
libxml2/xmlmodule.o \
libxml2/xmlreader.o \
libxml2/xmlregexp.o \
libxml2/xmlsave.o \
libxml2/xmlschemas.o \
libxml2/xmlschemastypes.o \
libxml2/xmlstring.o \
libxml2/xmlunicode.o \
libxml2/xmlwriter.o \
libxml2/xpath.o \
libxml2/xpointer.o \
libxml2/xzlib.o

LIBXLS_OBJS = \
libxls/src/endian.o \
libxls/src/locale.o \
Expand Down Expand Up @@ -85,6 +131,7 @@ ALL_OBJS = \
$(INI_OBJS) \
$(JSON_OBJS) \
$(LIBXLS_OBJS) \
$(LIBXML2_OBJS) \
$(MAT_OBJS) \
$(MINIZIP_OBJS) \
$(PARSON_OBJS) \
Expand All @@ -96,7 +143,7 @@ ALL_OBJS = \

all: clean libs

libs: libED_CSVFile.a libED_INIFile.a libED_JSONFile.a libED_MATFile.a libED_XLSFile.a libED_XLSXFile.a libED_XMLFile.a libED_XML2File.a libbsxml-json.a libexpat.a libminizip.a libparson.a libxlsreader.a libzlib.a
libs: libED_CSVFile.a libED_INIFile.a libED_JSONFile.a libED_MATFile.a libED_XLSFile.a libED_XLSXFile.a libED_XMLFile.a libED_XML2File.a libbsxml-json.a libexpat.a libminizip.a libparson.a libxlsreader.a libxml2.a libzlib.a
mkdir -p ../Library/$(TARGETDIR)
cp $^ ../Library/$(TARGETDIR)

Expand Down Expand Up @@ -139,6 +186,9 @@ libminizip.a: $(MINIZIP_OBJS)
libxlsreader.a: $(LIBXLS_OBJS)
$(AR) $@ $(LIBXLS_OBJS)

libxml2.a: $(LIBXML2_OBJS)
$(AR) $@ $(LIBXML2_OBJS)

libzlib.a: $(ZLIB_OBJS)
$(AR) $@ $(ZLIB_OBJS)

Expand Down

0 comments on commit c321f80

Please sign in to comment.