Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of the Makefile #183

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
/nuclide

/build
/subbuild
Makefile.config

tools/profiler/tmp
third-party/pcre/src/*
third-party/icu/src/*
third-party/jemalloc/src/*

npm-debug.log

Expand Down
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "third-party/double_conversion/src"]
path = third-party/double_conversion/src
url = https://github.com/google/double-conversion
[submodule "third-party/folly/src"]
path = third-party/folly/src
url = https://github.com/facebook/folly.git
[submodule "third-party/gflags/src"]
path = third-party/gflags/src
url = https://github.com/gflags/gflags.git
Expand All @@ -20,3 +14,6 @@
[submodule "third-party/googletest/src"]
path = third-party/googletest/src
url = https://github.com/google/googletest.git
[submodule "third-party/libunwind"]
path = third-party/libunwind
url = https://github.com/libunwind/libunwind.git
435 changes: 435 additions & 0 deletions Makefile

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
[![CircleCI](https://circleci.com/gh/skiplang/skip.svg?style=svg)](https://circleci.com/gh/skiplang/skip)

## Getting started

### Ubuntu/Debian

```
sudo apt-get install git clang make python3 autoconf libtool gcc g++ bzip2 libunwind-dev
git clone http://github.com/skiplang/skip.git
cd skip/
git submodule update --init --recursive
./build_submodules.sh
./configure
make -j 16
sudo make install
```

### Centos

```
yum install -y git which clang make autoconf automake libtool python3 bzip2
git clone http://github.com/skiplang/skip.git
cd skip/
git submodule update --init --recursive
./build_submodules.sh
./configure
make -j 16
sudo make install
```

### Mac

```
git clone http://github.com/skiplang/skip.git
cd skip/
git submodule update --init --recursive
./build_submodules.sh
./configure
make -j 16
sudo make install
```

If you don't have clang installed (unlikely):
```
xcode-select --install
```

## Skip Overview

Skip is a general-purpose programming language that tracks side effects to provide caching with reactive invalidation, ergonomic and safe parallelism, and efficient garbage collection. Skip is statically typed and ahead-of-time compiled using LLVM to produce highly optimized executables.
Expand Down
72 changes: 0 additions & 72 deletions build-static-binaries.sh

This file was deleted.

82 changes: 82 additions & 0 deletions build_submodules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash

echo "-------------------------------------------------------------------------------"
echo "- BUILDING SUBMODULES FOR SKIP -"
echo "-------------------------------------------------------------------------------"

export TPDIR="$PWD/subbuild"
mkdir -p $TPDIR

rm -f Makefile.config
touch Makefile.config

echo "-------------------------------------------------------------------------------"
echo "- Checking that the files are there -"
echo "-------------------------------------------------------------------------------"

if [ ! -f "third-party/jemalloc/src/README" ]; then
echo "ERROR: looks like the git submodules have not been checked out"
echo "Try running: git submodule update --init --recursive"
exit 2
fi

echo "-------------------------------------------------------------------------------"
echo "- Building JEMALLOC -"
echo "-------------------------------------------------------------------------------"

(cd ./third-party/jemalloc/src && autoconf)
(cd ./third-party/jemalloc/src && ./configure --prefix=$TPDIR --with-mangling)
(cd ./third-party/jemalloc/src && make -j 16 build_lib_static)
(cd ./third-party/jemalloc/src && make install_bin install_include install_lib)
cat $TPDIR/include/jemalloc/jemalloc.h | grep -v "define je_posix_memalign posix_memalign" > $TPDIR/include/jemalloc/jemalloc_hack.h
cp $TPDIR/include/jemalloc/jemalloc_hack.h $TPDIR/include/jemalloc/jemalloc.h

echo "-------------------------------------------------------------------------------"
echo "- Building ICU -"
echo "-------------------------------------------------------------------------------"

export ICUFLAGS="-DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -DU_USING_ICU_NAMESPACE=0 -DU_CHARSET_IS_UTF8=1"
(cd third-party/icu/src/icu4c/source/ && \
CPPFLAGS="$ICUFLAGS" CFLAGS="$ICUFLAGS" ./runConfigureICU Linux --disable-shared --enable-static --disable-tests --disable-samples --prefix="$TPDIR")
(cd third-party/icu/src/icu4c/source/ && make -j 16 && make install)
(cd third-party/icu/src/icu4c/source/tools/escapesrc/ && rm -f *.o)

echo "-------------------------------------------------------------------------------"
echo "- Building PCRE -"
echo "-------------------------------------------------------------------------------"

# Unfortunately, we have to modify those files for the configuration step to succeed.
# So we just make a copy and then, copy them back after we are done ...
cp third-party/pcre/src/INSTALL third-party/pcre/src/INSTALL.back
cp third-party/pcre/src/Makefile.in third-party/pcre/src/Makefile.in.back
cp third-party/pcre/src/aclocal.m4 third-party/pcre/src/aclocal.m4.back
cp third-party/pcre/src/ar-lib third-party/pcre/src/ar-lib.back
cp third-party/pcre/src/compile third-party/pcre/src/compile.back
cp third-party/pcre/src/config.guess third-party/pcre/src/config.guess.back
cp third-party/pcre/src/config.sub third-party/pcre/src/config.sub.back
cp third-party/pcre/src/configure third-party/pcre/src/configure.back
cp third-party/pcre/src/depcomp third-party/pcre/src/depcomp.back
cp third-party/pcre/src/install-sh third-party/pcre/src/install-sh.back
cp third-party/pcre/src/ltmain.sh third-party/pcre/src/ltmain.sh.back
cp third-party/pcre/src/m4/libtool.m4 third-party/pcre/src/m4/libtool.m4.back
cp third-party/pcre/src/missing third-party/pcre/src/missing.back
cp third-party/pcre/src/test-driver third-party/pcre/src/test-driver.back

(cd third-party/pcre/src/ && autoreconf -f -i && ./configure --prefix="$TPDIR" --enable-static --disable-shared --enable-utf && make -j 16 && make install)


cp third-party/pcre/src/INSTALL.back third-party/pcre/src/INSTALL
cp third-party/pcre/src/Makefile.in.back third-party/pcre/src/Makefile.in
cp third-party/pcre/src/aclocal.m4.back third-party/pcre/src/aclocal.m4
cp third-party/pcre/src/ar-lib.back third-party/pcre/src/ar-lib
cp third-party/pcre/src/compile.back third-party/pcre/src/compile
cp third-party/pcre/src/config.guess.back third-party/pcre/src/config.guess
cp third-party/pcre/src/config.sub.back third-party/pcre/src/config.sub
cp third-party/pcre/src/configure.back third-party/pcre/src/configure
cp third-party/pcre/src/depcomp.back third-party/pcre/src/depcomp
cp third-party/pcre/src/install-sh.back third-party/pcre/src/install-sh
cp third-party/pcre/src/ltmain.sh.back third-party/pcre/src/ltmain.sh
cp third-party/pcre/src/m4/libtool.m4.back third-party/pcre/src/m4/libtool.m4
cp third-party/pcre/src/missing.back third-party/pcre/src/missing
cp third-party/pcre/src/test-driver.back third-party/pcre/src/test-driver

79 changes: 79 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash

echo "-------------------------------------------------------------------------------"
echo "- CONFIGURE BUILD FOR SKIP -"
echo "-------------------------------------------------------------------------------"

rm -f Makefile.config
touch Makefile.config

CLANG=`which clang`
EXPVERSION=5

if [ -f $CLANG ]; then
VERSION=`$CLANG --version | grep version | sed 's/[^0-9]*\([0-9]*\).*/\1/'`
if [ $((VERSION)) -lt $((EXPVERSION)) ]; then
echo "ERROR: clang compiler version is too old!"
echo "ERROR: SKIP needs at least version $EXPVERSION"
echo "ERROR: your version is $VERSION"
exit 2
fi
echo "clang compiler found: $CLANG"
else
echo "ERROR: clang compiler not found"
exit 2
fi

CLANGXX=`which clang++`

if [ -f $CLANGXX ]; then
VERSION=`$CLANGXX --version | grep version | sed 's/[^0-9]*\([0-9]*\).*/\1/'`
if [ $((VERSION)) -lt $((EXPVERSION)) ]; then
echo "ERROR: clang compiler version is too old!"
echo "ERROR: SKIP needs at least version $EXPVERSION"
echo "ERROR: your version is $VERSION"
exit 2
fi
echo "clang++ compiler found: $CLANGXX"
else
echo "ERROR: clang++ compiler not found"
exit 2
fi

RANLIB=`which ranlib`

if [ -f $RANLIB ]; then
echo "ranlib found: $RANLIB"
else
echo "ERROR: ranlib not found"
exit 2
fi

AR=`which ar`

if [ -f $AR ]; then
echo "ar found: $AR"
else
echo "ERROR: ar not found"
exit 2
fi

echo "CC:=$CLANG" >> Makefile.config
echo "CXX:=$CLANGXX" >> Makefile.config
echo "CLANGXX:=$CLANGXX" >> Makefile.config
echo "RANLIB:=$RANLIB" >> Makefile.config
echo "AR:=$AR" >> Makefile.config

if [ "$(uname)" == "Darwin" ]; then
echo "LIBUNWIND:=" >> Makefile.config
else
echo "LIBUNWIND:=-lunwind" >> Makefile.config
fi

echo "INCLUDEPATH:= -I$ICUDIR" >> Makefile.config

if [ -z "$PREFIX" ]; then
echo "PREFIX:=/usr/local" >> Makefile.config
else
echo "PREFIX:=$PREFIX"
fi
3 changes: 0 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ cp -R src/runtime/prelude "$installDir/lib/skip/prelude"
cp "$pathToSkip/build/src/runtime/native/lib/preamble.ll" "$installDir/lib/skip"
cp "$pathToSkip/build/src/runtime/native/libskip_runtime.a" "$installDir/lib/skip"
cp "$pathToSkip/build/src/runtime/native/CMakeFiles/sk_standalone.src.dir/src/sk_standalone.cpp.o" "$installDir/lib/skip"
cp "$pathToSkip/build/third-party/install/lib/libfolly.a" "$installDir/lib/skip"

if [ $distrib == Linux ]; then
cp "$pathToSkip/build/third-party/install/lib/libunwind.a" "$installDir/lib/skip"
cp "$pathToSkip/build/third-party/install/lib/libdouble-conversion.a" "$installDir/lib/skip"
cp "$pathToSkip/build/third-party/install/lib/libjemalloc_pic.a" "$installDir/lib/skip"
fi

Expand Down
12 changes: 10 additions & 2 deletions lkg/runtime/native/include/skip/detail/jemalloc_common.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lkg/runtime/native/src/Arena.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions lkg/runtime/native/src/Obstack.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading