forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
7,027 additions
and
5,727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: build | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: closure-nnp-local | ||
config: --enable-stack-allocation | ||
os: ubuntu-latest | ||
ocamlparam: '' | ||
check_arch: true | ||
|
||
- name: flambda-local | ||
config: --enable-flambda --enable-stack-allocation | ||
os: ubuntu-latest | ||
|
||
- name: i386 | ||
config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386' | ||
os: ubuntu-latest | ||
ocamlparam: '' | ||
boot_config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386' | ||
boot_cachekey: 32bit | ||
|
||
env: | ||
J: "3" | ||
|
||
steps: | ||
- name: Install GNU parallel | ||
if: matrix.os == 'macos-latest' | ||
run: HOMEBREW_NO_INSTALL_CLEANUP=TRUE brew install parallel | ||
|
||
- name: Install GCC 32-bit libraries | ||
if: matrix.name == 'i386' | ||
run: | | ||
sudo apt-get install gcc-multilib gfortran-multilib | ||
- name: Checkout the ocaml-jst repo | ||
uses: actions/checkout@master | ||
with: | ||
path: 'ocaml-jst' | ||
|
||
- name: Cache OCaml 4.12 and dune | ||
uses: actions/cache@v1 | ||
id: cache | ||
with: | ||
path: ${{ github.workspace }}/ocaml-412/_install | ||
key: ${{ matrix.os }}-cache-ocaml-412-dune-341-bits-${{ matrix.boot_cachekey }} | ||
|
||
- name: Checkout OCaml 4.12 | ||
uses: actions/checkout@master | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
repository: 'ocaml/ocaml' | ||
path: 'ocaml-412' | ||
ref: '4.12' | ||
|
||
- name: Setup 32-bit C compiler | ||
if: matrix.name == 'i386' && steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
mkdir -p ocaml-412/_install/bin | ||
{ echo '#!/bin/sh'; echo 'exec gcc -m32 "$@"'; } > ocaml-412/_install/bin/cc32 | ||
chmod +x ocaml-412/_install/bin/cc32 | ||
- name: Build OCaml 4.12 | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
working-directory: ocaml-412 | ||
run: | | ||
export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH | ||
./configure --prefix=$GITHUB_WORKSPACE/ocaml-412/_install ${{ matrix.boot_config }} | ||
make -j $J world.opt | ||
make install | ||
# Remove unneeded parts to shrink cache file | ||
rm -rf $GITHUB_WORKSPACE/ocaml-412/_install/{lib/ocaml/compiler-libs,lib/ocaml/expunge,bin/*.byte} | ||
- name: Checkout dune github repo | ||
uses: actions/checkout@master | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
repository: 'ocaml/dune' | ||
ref: '3.4.1' | ||
path: 'dune' | ||
|
||
- name: Build dune | ||
working-directory: dune | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH make release | ||
cp dune.exe $GITHUB_WORKSPACE/ocaml-412/_install/bin/dune | ||
- name: Configure OCaml | ||
working-directory: ocaml-jst | ||
run: | | ||
export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH | ||
autoconf | ||
./configure \ | ||
--prefix=$GITHUB_WORKSPACE/_install \ | ||
${{ matrix.config }} | ||
- name: Build, install and test ocaml-jst | ||
working-directory: ocaml-jst | ||
run: | | ||
export PATH=$GITHUB_WORKSPACE/ocaml-412/_install/bin:$PATH | ||
make -f Makefile.jst runtest-upstream | ||
env: | ||
BUILD_OCAMLPARAM: ${{ matrix.ocamlparam }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
= Hacking on ocaml-jst | ||
|
||
ocaml-jst has a dune-based build system which is different from | ||
upstream OCaml. To get started, you'll need a working install of OCaml | ||
4.12 and dune, e.g. via OPAM: | ||
|
||
$ opam switch create 4.12.0 | ||
$ eval $(opam env) | ||
$ opam install dune | ||
|
||
You should also install merlin: | ||
|
||
$ opam install merlin | ||
|
||
and follow its instructions for how to set up your editor. | ||
|
||
Once you have OCaml and dune, you can build and test ocaml-jst with: | ||
|
||
$ ./configure --prefix=/where/to/install | ||
$ make -f Makefile.jst runtest-upstream | ||
|
||
Other useful Makefile targets are: | ||
|
||
$ make -f Makefile.jst compiler | ||
|
||
to build without running the testsuite, or: | ||
|
||
$ make -f Makefile.jst hacking | ||
|
||
to start a continuously polling build of the compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
SHELL = /usr/bin/env bash | ||
include Makefile.config | ||
export ARCH | ||
|
||
|
||
ifeq ($(shell test -x '$(DUNE)' || echo fail), fail) | ||
$(error Dune not found. Run ./configure --with-dune=/path/to/dune.exe (See HACKING.jst)) | ||
endif | ||
|
||
dune = $(DUNE) | ||
|
||
ifeq ($(shell which ocamlopt >& /dev/null || echo fail), fail) | ||
$(error ocamlopt not found. See HACKING.jst) | ||
endif | ||
|
||
boot_ocamlc = main_native.exe | ||
boot_ocamlopt = optmain_native.exe | ||
boot_ocamlmklib = tools/ocamlmklib.exe | ||
boot_ocamldep = tools/ocamldep.exe | ||
boot_ocamlobjinfo = tools/objinfo.exe | ||
ocamldir = . | ||
#toplevels_installed = top opttop | ||
toplevels_installed = top | ||
|
||
|
||
dune-project: dune-project.jst | ||
cp $^ $@ | ||
|
||
duneconf/jst-extra.inc: | ||
echo '(include ../jst.dune)' > $@ | ||
|
||
include Makefile.common-jst |
Oops, something went wrong.