Skip to content
Snippets Groups Projects
Commit d43e012f authored by Christophe Junke's avatar Christophe Junke
Browse files

Update makefile and ci to generate all bundles

parent 60b9267f
No related branches found
No related tags found
1 merge request!48Release 2024.05
Pipeline #69777 passed
...@@ -14,15 +14,12 @@ build: ...@@ -14,15 +14,12 @@ build:
- sudo apt-get update - sudo apt-get update
- sudo apt-get install -y make libgmp-dev - sudo apt-get install -y make libgmp-dev
- opam install dune.3.12.1 fmt.0.9.0 gen.1.1 menhir.20230608 ocplib-simplex.0.5 parsexp.v0.16.0 spelll.0.4 uutf.1.0.3 zarith.1.13 - opam install dune.3.12.1 fmt.0.9.0 gen.1.1 menhir.20230608 ocplib-simplex.0.5 parsexp.v0.16.0 spelll.0.4 uutf.1.0.3 zarith.1.13
- make clean - make archives
- make clean_bundle
- make
- make bundle
- make bundle.tbz
artifacts: artifacts:
paths: paths:
- bundle - bundle
- bundle.tbz - bundle-v5.tbz
- bundle-v7.tbz
expire_in: 1 week expire_in: 1 week
tags: tags:
- docker - docker
...@@ -34,7 +31,7 @@ test: ...@@ -34,7 +31,7 @@ test:
script: script:
- apt-get update - apt-get update
- apt-get install -y make parallel - apt-get install -y make parallel
- make test - make tests
artifacts: artifacts:
paths: paths:
- logs - logs
...@@ -48,14 +45,19 @@ prepare-release: ...@@ -48,14 +45,19 @@ prepare-release:
rules: rules:
- if: $CI_PIPELINE_SOURCE == "trigger" - if: $CI_PIPELINE_SOURCE == "trigger"
variables: variables:
ARCHIVE_NAME: '$PROJECT.$TAG.tbz' PREFIX: '$PROJECT_URI/packages/generic/$PROJECT/$TAG'
PACKAGE_URI: '$PROJECT_URI/packages/generic/$PROJECT/$TAG/$ARCHIVE_NAME' ARCHIVE_V5_NAME: '$PROJECT.$TAG-e5.tbz'
ARCHIVE_V7_NAME: '$PROJECT.$TAG-e7.tbz'
PACKAGE_V5_URI: '$PREFIX/$ARCHIVE_V5_NAME'
PACKAGE_V7_URI: '$PREFIX/$ARCHIVE_V7_NAME'
script: script:
- apt-get update - apt-get update
- apt-get install -y curl - apt-get install -y curl
- sed -n -f changelog.sed CHANGES.md > description.txt - sed -n -f changelog.sed CHANGES.md > description.txt
- | - |
curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bundle.tbz "$PACKAGE_URI" curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bundle-v5.tbz "$PACKAGE_V5_URI"
- |
curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bundle-v7.tbz "$PACKAGE_V7_URI"
artifacts: artifacts:
paths: paths:
- description.txt - description.txt
...@@ -68,8 +70,11 @@ release: ...@@ -68,8 +70,11 @@ release:
rules: rules:
- if: $CI_PIPELINE_SOURCE == "trigger" - if: $CI_PIPELINE_SOURCE == "trigger"
variables: variables:
ARCHIVE_NAME: '$PROJECT.$TAG.tbz' PREFIX: '$PROJECT_URI/packages/generic/$PROJECT/$TAG'
PACKAGE_URI: '$PROJECT_URI/packages/generic/$PROJECT/$TAG/$ARCHIVE_NAME' ARCHIVE_V5_NAME: '$PROJECT.$TAG-e5.tbz'
ARCHIVE_V7_NAME: '$PROJECT.$TAG-e7.tbz'
PACKAGE_V5_URI: '$PREFIX/$ARCHIVE_V5_NAME'
PACKAGE_V7_URI: '$PREFIX/$ARCHIVE_V7_NAME'
script: script:
- echo "Release job for tag $TAG" - echo "Release job for tag $TAG"
release: release:
...@@ -80,9 +85,14 @@ release: ...@@ -80,9 +85,14 @@ release:
milestones: [] milestones: []
assets: assets:
links: links:
- name: '$ARCHIVE_NAME' - name: '$ARCHIVE_V5_NAME'
url: '$PACKAGE_URI' url: '$PACKAGE_V5_URI'
filepath: '/bundle' filepath: '/bundle-v5'
link_type: 'other'
links:
- name: '$ARCHIVE_V7_NAME'
url: '$PACKAGE_V5_URI'
filepath: '/bundle-v7'
link_type: 'other' link_type: 'other'
tags: tags:
- docker - docker
.PHONY: all bundle clean clean_bundle simplex simplex_epilog .PHONY: all bundle clean clean_bundle simplex simplex_epilog
# NB. This makefile uses rules like v5-% and v7-% to setup
# the required environment before executing the associated
# rule %.
#
# This makes it easy to have a common script for the
# different cases, but unfortunately this forces the
# makefile to rebuild everything: the contextual variables
# cannot appear as dependencies or targets of rules, because
# these are evaluated at rule-definition-time. That's why
# the rules are basically just keywords like "prepare-build"
# and "archive", etc.
#
# A different approach should be possible here, but for now
# this is what is being done.
# Bundle prefix, override to specify a different directory # Bundle prefix, override to specify a different directory
BUNDLE ?= $(PWD)/bundle BUNDLE ?= $(PWD)/bundle
# Which eclipse version to use, among {v5|v7} all : build_all
# (v5 is currently broken) build_all: v5-build v7-build
ECL_VERSION ?= v7
all : build VERSION := $(shell cat version)
# ==================================================
# MACRO
# ==================================================
# Target of copy dependencies are added to this variable.
COPY_DEPS :=
define add_copy_rule
COPY_DEPS += $(2)
$(2) : $(1)
mkdir -p $(dir $(2))
cp $(1) $(2)
endef
# Add a rule to copy a file from a source to a destination, while
# ensuring that the target directory exists.
#
# $(1): source
# $(2): destination
#
define require_copy
$(eval $(call add_copy_rule,$(1),$(2))) show_version:
echo "version file contains: $(VERSION)"
endef
# ================================================== # ==================================================
# CONFIGURATION # CONFIGURATION
...@@ -42,32 +33,38 @@ endef ...@@ -42,32 +33,38 @@ endef
ROOT := $(realpath Src/) ROOT := $(realpath Src/)
COLIBRI := $(ROOT)/COLIBRI COLIBRI := $(ROOT)/COLIBRI
SIMPLEX_BUILD := $(COLIBRI)/simplex_ocaml/_build/default SIMPLEX_BUILD := $(COLIBRI)/simplex_ocaml/_build/default
$(call require_copy,$(SIMPLEX_BUILD)/simplex_ocaml.pl,$(COLIBRI)/simplex_ocaml.pl)
ifeq ($(ECL_VERSION),v7)
export ECLIPSEBIN=$(PWD)/Bin/ECLIPSE_V7.0_45
LIBDIR=$(COLIBRI)/lib/v7
SIMPLEX := simplex_ocaml_mod_v7.so
FLOAT_LIB := $(LIBDIR)/x86_64_linux/float_util.so
$(call require_copy,$(SIMPLEX_BUILD)/simplex_ocaml_mod_v7.so,$(LIBDIR)/x86_64_linux/simplex_ocaml.so)
endif
ifeq ($(ECL_VERSION),v5)
export ECLIPSEBIN=$(PWD)/Bin/ECLiPSe_5.10
LIBDIR=$(COLIBRI)/lib/v5
SIMPLEX := simplex_ocaml_mod.so
FLOAT_LIB := $(LIBDIR)/x86_64_linux/float_util.so
$(call require_copy,$(SIMPLEX_BUILD)/simplex_ocaml_mod.so,$(LIBDIR)/x86_64_linux/simplex_ocaml.so)
endif
# ================================================== $(COLIBRI)/simplex_ocaml.pl: $(SIMPLEX_BUILD)/simplex_ocaml.pl
# INFOS mkdir -p $(dir $@)
# ================================================== cp $< $@
$(info BUNDLE=$(BUNDLE)) infos:
$(info ECL_VERSION=$(ECL_VERSION)) $(info BUNDLE=$(BUNDLE))
$(info COLIBRI=$(COLIBRI)) $(info ECL_VERSION=$(ECL_VERSION))
$(info ECLIPSEBIN=$(ECLIPSEBIN)) $(info COLIBRI=$(COLIBRI))
$(info ECLIPSEBIN=$(ECLIPSEBIN))
v5-%: ECL_VERSION = v5
v5-%: export ECLIPSEBIN = $(PWD)/Bin/ECLiPSe_5.10
v5-%: LIBDIR = $(COLIBRI)/lib/v5
v5-%: SIMPLEX = simplex_ocaml_mod.so
v5-%: FLOAT_LIB = $(LIBDIR)/x86_64_linux/float_util.so
v5-%: BUNDLE_ROOT = $(BUNDLE)/$(ECL_VERSION)
v5-%: CPP_FLAGS = -fPIC -O -D__LINUX__ -shared -I $(ECLIPSEBIN)/include/x86_64_linux
v5-%: ARCHIVE = colibri-$(VERSION)-$(ECL_VERSION)
v5-%: infos %
@ echo $@ done
v7-%: ECL_VERSION = v7
v7-%: export ECLIPSEBIN = $(PWD)/Bin/ECLIPSE_V7.0_45
v7-%: LIBDIR = $(COLIBRI)/lib/v7
v7-%: SIMPLEX = simplex_ocaml_mod_v7.so
v7-%: FLOAT_LIB = $(LIBDIR)/x86_64_linux/float_util.so
v7-%: BUNDLE_ROOT = $(BUNDLE)/$(ECL_VERSION)
v7-%: CPP_FLAGS = -fPIC -O -D__LINUX__ -shared -I $(ECLIPSEBIN)/include/x86_64_linux
v7-%: ARCHIVE = colibri-$(VERSION)-$(ECL_VERSION)
v7-%: infos %
@ echo $@ done
# ================================================== # ==================================================
# SIMPLEX_OCAML # SIMPLEX_OCAML
...@@ -75,24 +72,22 @@ $(info ECLIPSEBIN=$(ECLIPSEBIN)) ...@@ -75,24 +72,22 @@ $(info ECLIPSEBIN=$(ECLIPSEBIN))
simplex: $(ECLIPSEBIN) simplex: $(ECLIPSEBIN)
cd $(COLIBRI)/simplex_ocaml && dune build $(SIMPLEX) simplex_ocaml.pl cd $(COLIBRI)/simplex_ocaml && dune build $(SIMPLEX) simplex_ocaml.pl
mkdir -p $(LIBDIR)/x86_64_linux/
cp $(SIMPLEX_BUILD)/$(SIMPLEX) $(LIBDIR)/x86_64_linux/simplex_ocaml.so
simplex_epilog : simplex $(COPY_DEPS) simplex_epilog : simplex $(COLIBRI)/simplex_ocaml.pl
@echo COPY_DEPS=$(COPY_DEPS)
# ================================================== # ==================================================
# FLOAT LIBRARY # FLOAT LIBRARY
# ================================================== # ==================================================
CPP_FLAGS := -fPIC -O -D__LINUX__ -shared
CPP_FLAGS += -I $(ECLIPSEBIN)/include/x86_64_linux
CPP_FILES := \ CPP_FILES := \
$(ROOT)/Floats/EclipseInterfaceSimFloat2.2.cpp \ $(ROOT)/Floats/EclipseInterfaceSimFloat2.2.cpp \
$(ROOT)/Floats/Floatcpp-3.0_SimFloat2.2.cpp $(ROOT)/Floats/Floatcpp-3.0_SimFloat2.2.cpp
$(FLOAT_LIB) : $(CPP_FILES) float_lib : $(CPP_FILES)
mkdir -p $(dir $@) mkdir -p $(dir $(FLOAT_LIB))
g++ $(CPP_FLAGS) $(CPP_FILES) -o $@ g++ $(CPP_FLAGS) $(CPP_FILES) -o $(FLOAT_LIB)
# ================================================== # ==================================================
# BUILD # BUILD
...@@ -105,11 +100,11 @@ clean: ...@@ -105,11 +100,11 @@ clean:
rm -f compile_colibri rm -f compile_colibri
rm -rf $(PWD)/tools/_build/ rm -rf $(PWD)/tools/_build/
compile_colibri : compile_colibri:
cd tools/ && dune build compile_colibri.exe cd tools/ && dune build compile_colibri.exe
cp -a $(PWD)/tools/_build/default/compile_colibri.exe $@ cp -a $(PWD)/tools/_build/default/compile_colibri.exe $@
build: simplex_epilog $(FLOAT_LIB) compile_colibri build: simplex_epilog float_lib compile_colibri
./compile_colibri --eclipsedir $(ECLIPSEBIN) ./compile_colibri --eclipsedir $(ECLIPSEBIN)
# ================================================== # ==================================================
...@@ -121,36 +116,43 @@ BUNDLE_SRC := \ ...@@ -121,36 +116,43 @@ BUNDLE_SRC := \
Src/COLIBRI/filter_smtlib_file \ Src/COLIBRI/filter_smtlib_file \
Src/COLIBRI/filter_smtlib_file.exe Src/COLIBRI/filter_smtlib_file.exe
$(BUNDLE)/colibri.exe : prepare_build:
mkdir -p $(BUNDLE_ROOT)
colibri_executables:
cd tools/ && dune build colibri_for_bundle.exe cd tools/ && dune build colibri_for_bundle.exe
cp -a $(PWD)/tools/_build/default/colibri_for_bundle.exe $@ cp -af $(PWD)/tools/_build/default/colibri_for_bundle.exe $(BUNDLE_ROOT)/colibri.exe
cp -af $(PWD)/tools/_build/default/colibri_for_bundle.exe $(BUNDLE_ROOT)/colibri
clean_bundle: clean_bundle:
rm -fr $(BUNDLE) rm -fr $(BUNDLE_ROOT)
$(BUNDLE): bundle: prepare_build build colibri_executables
mkdir -p $(BUNDLE) mkdir -p $(BUNDLE_ROOT)/COLIBRI/lib/
cp -ra $(LIBDIR) $(BUNDLE_ROOT)/COLIBRI/lib/
cp -ra $(BUNDLE_SRC) $(BUNDLE_ROOT)/COLIBRI/
cp -ra compile_flag.pl $(BUNDLE_ROOT)/COLIBRI/
cp -ra version $(BUNDLE_ROOT)/
cp -ra $(ECLIPSEBIN) $(BUNDLE_ROOT)/ECLIPSE/
$(BUNDLE)/colibri: $(BUNDLE)/colibri.exe archive: bundle
cp -ra $< $@ # generate name for user
tar cfj $(ARCHIVE).tbz --transform="s,^.,$(ARCHIVE)," -C $(BUNDLE_ROOT) .
# for continuous integration
ln -f $(ARCHIVE).tbz bundle-$(ECL_VERSION).tbz
bundle: build $(BUNDLE) $(BUNDLE)/colibri.exe $(BUNDLE)/colibri archives:
mkdir -p $(BUNDLE)/COLIBRI/lib/ make v5-archive
cp -ra $(LIBDIR) $(BUNDLE)/COLIBRI/lib/ make v7-archive
cp -ra $(BUNDLE_SRC) $(BUNDLE)/COLIBRI/
cp -ra compile_flag.pl $(BUNDLE)/COLIBRI/
cp -ra version $(BUNDLE)/
cp -ra $(ECLIPSEBIN) $(BUNDLE)/ECLIPSE/
bundle.tbz: bundle
tar cvfj $@ $<
# ================================================== # ==================================================
# TEST # TEST
# ================================================== # ==================================================
test: test:
./test.sh -j2 ./test.sh $(BUNDLE_ROOT)/colibri -j2
tests: v5-test v7-test
# ================================================== # ==================================================
# RELEASE # RELEASE
...@@ -161,7 +163,7 @@ PROJECT_URL := https://git.frama-c.com/api/v4/projects/804 ...@@ -161,7 +163,7 @@ PROJECT_URL := https://git.frama-c.com/api/v4/projects/804
RELEASE_REF ?= master RELEASE_REF ?= master
GIT_TAG ?= $(shell git describe --tags --candidates=0 2> /dev/null) GIT_TAG ?= $(shell git describe --tags --candidates=0 2> /dev/null)
check_release: check_release: show_version
@echo '' @echo ''
@echo 'RELEASE' @echo 'RELEASE'
$(if $(RELEASE_TOKEN),,$(error Call script with RELEASE_TOKEN set)) $(if $(RELEASE_TOKEN),,$(error Call script with RELEASE_TOKEN set))
......
# COLIBRI # COLIBRI
## Bundle ## Bundles
The command `make bundle` will create a relocalisable directory named The Makefile can produce a relocalisable directory for version 5 and 7
`bundle` containing the ` colibri` executables. of ECLiPSe, in `bundle/v5` and `bundle/v7`, with respectively `make v5-build`
and `make v7-build`.
Inside each bundle directory there is a `colibri` executable.
Also, `make v5-archive` and `make v7-archive` create `.tbz` archives
of the respective bundle directories.
The command `make archives` will create both archives.
## Dependencies ## Dependencies
......
#!/bin/sh -eu #!/bin/sh -eu
NENO=$(readlink -f ./neno)
SOLVER=$1
shift
STEPS=100000 STEPS=100000
FAIL=false FAIL=false
TIMEOUT=200 TIMEOUT=200
...@@ -13,7 +18,7 @@ run_tests() { ...@@ -13,7 +18,7 @@ run_tests() {
local log=$2 local log=$2
local redirect=$3 local redirect=$3
echo $path echo $path
if find ${path} -name "*.smt2" | parallel ${PARALLEL_OPTIONS} --timeout ${TIMEOUT} --joblog ${log} "./neno ${redirect} bundle/colibri --max-steps ${STEPS} {}"; then if find ${path} -name "*.smt2" | parallel ${PARALLEL_OPTIONS} --timeout ${TIMEOUT} --joblog ${log} "${NENO} ${redirect} ${SOLVER} --max-steps ${STEPS} {}"; then
echo OK echo OK
else else
echo KO echo KO
......
let coldir = Filename.dirname Sys.executable_name let coldir = Filename.dirname Sys.executable_name
let conf = ref "true" let conf = ref "true"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment