This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rearchitecture of the the build system. A vast simplification. Changes - ./configure can produce an XCode project of the Turi source code. - deps/ can be compiled and installed out of the regular build process. Helpful for the XCode project. - All packages in src/external/ and src/visualization compile into static libraries. - The rest of the code base compiles into a single shared library. This means that most everything occurs in one single CMakeLists.txt file using standard cmake commands. - All headers are installed into targets/include when `make install` is called. The main library is installed into targets/lib. - The code definitions that reflect compiler oddities (e.g. is std::hash<int128_t> defined) are dumped into a single header file, src/turi_common.h. All source files and headers include this file first. This allows other programs to link against this library / headers reliably. - The python part of TuriCreate now builds through the standard setup.py method. Cython / pybind11 extensions are compiled and packaged using the standard extensions mechanisms and linking against the installed Turi headers. WIP TODO: the python installation, deployment.
- Loading branch information
Hoyt Koepke
committed
Mar 9, 2020
1 parent
038db92
commit 1c8e998
Showing
1,372 changed files
with
2,396 additions
and
2,184 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,112 @@ | ||
#!/bin/bash -e | ||
|
||
|
||
function print_help { | ||
echo "Configures and builds a specified target." | ||
echo | ||
echo "Usage: ./build.sh [build options] [configure options]" | ||
echo | ||
echo "Common Options:" | ||
echo " --target-dir, -t The target directory to install artifact to." | ||
echo " default: `pwd`/targets." | ||
echo | ||
echo " --release Build in release mode." | ||
echo " --debug Build in debug mode (default)." | ||
echo | ||
echo " --jobs,-j The number of parallel jobs to run." | ||
echo | ||
echo " --cleanup,-c Clean up everything before building." | ||
echo | ||
echo " --skip-configure,-s Skip running ./configure." | ||
echo | ||
echo " --build-number Set build number. " | ||
echo " Defaults to part of git commit hash. " | ||
echo | ||
echo " All additional options passed through to ./configure." | ||
echo | ||
exit 1 | ||
} # end of print help | ||
|
||
function unknown_option { | ||
echo "Unrecognized option: $1" | ||
echo "To get help, run ./configure --help" | ||
exit 1 | ||
} # end of unknown option | ||
|
||
if [[ ${OSTYPE} == darwin* ]] ; then | ||
apple=1 | ||
else | ||
apple=0 | ||
fi | ||
|
||
|
||
# command flag options | ||
cleanup=0 | ||
skip_configure=0 | ||
jobs=4 | ||
configure_options="" | ||
build_mode="release" | ||
target_dir=`pwd`/targets | ||
install_sysroot="" | ||
no_sudo=0 | ||
copy_links=0 | ||
build_number=`git rev-parse --short HEAD || echo "NULL"` | ||
|
||
############################################################################### | ||
# | ||
# Parse command line configure flags ------------------------------------------ | ||
# | ||
while [ $# -gt 0 ] | ||
do case $1 in | ||
|
||
--cleanup|-c) cleanup=1;; | ||
|
||
--skip-configure|-s) skip_configure=1;; | ||
|
||
--copy-links) copy_links=1;; | ||
|
||
--build-number=*) build_number=${1##--build-number=} ;; | ||
--build-number) build_number="$2"; shift;; | ||
|
||
--target-dir=*) target_dir="${1##--target-dir=}" ;; | ||
--target-dir|-t) target_dir="$2"; shift ;; | ||
|
||
--jobs=*) jobs=${1##--jobs=} ;; | ||
--jobs|-j) jobs=$2; shift ;; | ||
|
||
--help) print_help; exit 0;; | ||
|
||
-D) configure_options="${configure_options} -D $2"; shift ;; | ||
|
||
*) configure_options="${configure_options} $1";; | ||
esac | ||
shift | ||
done | ||
|
||
build_dir=`pwd`/${build_mode} | ||
src_dir=`pwd` | ||
|
||
|
||
echo "Setting up build:" | ||
echo "build_mode = ${build_mode}" | ||
echo "target_dir = ${target_dir}" | ||
echo "target = ${target}" | ||
echo "build_dir = ${build_dir}" | ||
|
||
|
||
if [[ ${cleanup} -eq 1 ]]; then | ||
./configure --cleanup --yes || exit 1 | ||
fi | ||
|
||
if [[ ${skip_configure} -eq 0 ]] ; then | ||
./configure ${configure_options} --with-python || exit 1 | ||
else | ||
echo "skipping configure script as requested." | ||
fi | ||
|
||
|
||
install_dir=${target_dir}/python | ||
rm -rf ${target_dir}/python | ||
mkdir -p ${target_dir}/python | ||
|
||
bash scripts/make_wheel.sh --skip_test --skip_cpp_test --build_number="$build_number" --num_procs=${jobs} --${build_mode} --target-dir="${install_dir}" |
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
Oops, something went wrong.