terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.72k stars 201 forks source link

RFC: Deprecate Makefile build #383

Closed elliottslaughter closed 4 years ago

elliottslaughter commented 5 years ago

We recently had an issue in Regent which basically came down to the Terra Makefile being broken on Ubuntu 19.04. This is not the first system where I've seen the original Makefile break, there are certain machines where I just can't build with it at all. I haven't spent the time to debug the Ubuntu 19.04 issue yet, but at least on Cori the problem is that gcc's output is quite different from what we usually get---it doesn't seem like an issue we'll be able to fix easily.

I'm wondering if we should deprecate the Makefile and officially designate CMake as the primary build system for Terra (at least on Linux/macOS). The main downside I'm aware of is that LLVM CMake export files have been broken on certain older distros (e.g. Ubuntu prior to 18.04), so until those distros become obsolete we'd have to recommend people download official LLVM builds or else build it from source. On the flip side, there are certain LLVM versions (== 7) that we can only build with CMake, so we may be forced to go in this direction anyway in the future.

I want to assess the impact of this before making any changes. If anyone has thoughts, please comment on this issue.

Blockers:

What this means:

aiverson commented 5 years ago

I would suggest not deprecating it until we get the new build-box system up and running, then switching everything over to CMake. The build box system should produce fairly portable builds of the binaries and be runnable on most linux systems. I'm really looking forward to getting Terra ported to LLVM 8 because that version takes WASM target support off of experimental and adds nice new stuff for JIT compilation, so that needs CMake.

ErikMcClure commented 5 years ago

I feel obligated to point out that I cannot currently figure out how to build terra using cmake on Ubuntu 19 for unknown reasons.

I think we need a work item to document how to use cmake for all platforms before this can happen, because currently the only way to figure out how you're actually supposed to invoke cmake is by looking at travis.sh or appveyor.yml.

elliottslaughter commented 5 years ago

Point well taken, I've added it to the list.

elliottslaughter commented 4 years ago

Please check https://github.com/terralang/terra#building-terra and see if those instructions seem reasonable or not.

elliottslaughter commented 4 years ago

@ErikMcClure I was able to make the following script work on all of Ubuntu 16.04, 18.04 and 19.10.

apt-get update -qq && apt-get install -qq build-essential cmake git llvm-6.0-dev libclang-6.0-dev clang-6.0 libedit-dev libncurses5-dev zlib1g-dev
git clone https://github.com/terralang/terra.git
cd terra/build
cmake -DCMAKE_INSTALL_PREFIX=$PWD/../install ..
make install -j4 # tune this for how many cores you have
make test

It may be worth actually adding this as a test in Travis (via Docker) so we have a "minimal viable installation" test.

elliottslaughter commented 4 years ago

This has been formalized in https://github.com/terralang/terra/pull/423, and we can now include Docker in our test suite. I believe I'm now quite convinced Terra should build out of the box on all modern Ubuntu versions.

elliottslaughter commented 4 years ago

Note: the Makefile build is now broken on macOS Mojave and newer, because of a failure in the step where we run a LuaJIT script to unpack the .a files (see #435). I do not have time to debug this. I am inclined to move forward with the deprecation because no one is screaming for #342, but at any rate anyone who cares can come along and add support for that later if they are so inclined.

elliottslaughter commented 4 years ago

As noted in #342, I think that can be accomplished other ways now, so I'm going to consider this not a blocker for deprecation. Unless anyone objects I'm going to move forward with the deprecation. I've updated the top-level issue to specify what exactly this means.

elliottslaughter commented 4 years ago

I'm going to consider Make hereby deprecated. I pushed a formal deprecation notice to CHANGES.md.