-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is trying to improve the building experience, by: 1. Providing `third-party/install-cmake.sh` to download and install a prebuilt CMake 2. Providing `third-party/build-gcc.sh` to automatically download and build GCC 7.5.0 3. Providing `third-party/install-gcc.sh` to download and install a prebuilt GCC 7.5.0 according to the current distro and libc 4. Providing `third-party/build-third-party.sh` to build and optionally package our third party dependencies 4. Providing `third-party/build-all-third-party.sh` to invoke `build-third-party.sh` using several preset versions of GCC 5. Providing `third-party/install-third-party.sh` to download and install a prebuilt third party according to the current version of glibc, GCC(along with its ABI version) 6. Invoke `install-third-party.sh` automatically during the configure stage(cmake) Besides, all installing scripts support an `--prefix` option to allow one customizing the install location. For the third party installation, works are done to make *Bison* and *krb5* relocatable. The fresh new building shceme has been tested under various environments: 1. CentOS 6/7/8 2. Debian 7/8/9 3. Ubuntu 16.04/18.04/19.04 4. GCC 7/8/9, and devtoolset-7 of CentOS 6/7 Since most of these testing are from inside a Docker image, so the Linux Kernel used is nearly the newest one(5.0). There might be other unfound issues. To try out this PR, run ```sh $ git clone --single-branch --depth=1 --branch refactor-building https://github.com/dutor/nebula.git nebula-refactor-building $ cd nebula-refactor-building $ mkdir build && cd build $ ../third-party/install-cmake.sh # Can be skipped if you have CMake 3.5.0+ $ source cmake-3.15.5/bin/enable-cmake.sh # Only necessary if you invoked install-cmake.sh $ sudo ../third-party/install-gcc.sh # Can be skipped if you have GCC 7.1.0+ $ source /opt/vesoft/toolset/gcc/7.5.0/enable # Only necessary if you invoked install-gcc.sh $ cmake .. $ make ``` BTW. This PR also fixes #1449 BTW. This PR reduces the build size a lot, as mentioned in #1401
- Loading branch information
Showing
65 changed files
with
3,483 additions
and
23 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,7 @@ | ||
execute_process( | ||
COMMAND | ||
${CMAKE_SOURCE_DIR}/third-party/build-third-party.sh | ||
WORKING_DIRECTORY | ||
${CMAKE_BINARY_DIR} | ||
) | ||
set(NEBULA_THIRDPARTY_ROOT ${CMAKE_BINARY_DIR}/third-party/install) |
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,12 @@ | ||
set(third_party_install_prefix ${CMAKE_BINARY_DIR}/third-party/install) | ||
message(STATUS "Downloading prebuilt third party automatically...") | ||
execute_process( | ||
COMMAND | ||
env CXX=${CMAKE_CXX_COMPILER} ${CMAKE_SOURCE_DIR}/third-party/install-third-party.sh --prefix=${third_party_install_prefix} | ||
WORKING_DIRECTORY | ||
${CMAKE_BINARY_DIR} | ||
) | ||
if(EXISTS ${third_party_install_prefix}) | ||
set(NEBULA_THIRDPARTY_ROOT ${third_party_install_prefix}) | ||
endif() | ||
unset(third_party_install_prefix) |
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,22 @@ | ||
execute_process( | ||
COMMAND | ||
ld --version | ||
COMMAND | ||
head -1 | ||
COMMAND | ||
cut -d " " -f2 | ||
OUTPUT_VARIABLE default_linker_type | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
if (${default_linker_type} STREQUAL "ld") | ||
set(default_linker_type "bfd") | ||
endif() | ||
|
||
if (NOT DEFINED NEBULA_USE_LINKER) | ||
set(NEBULA_USE_LINKER ${default_linker_type}) | ||
endif() | ||
|
||
message(STATUS "NEBULA_USE_LINKER: ${NEBULA_USE_LINKER}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=${NEBULA_USE_LINKER}") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=${NEBULA_USE_LINKER}") |
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,17 @@ | ||
set(BISON_EXECUTE_ENV "") | ||
execute_process( | ||
COMMAND ${BISON_EXECUTABLE} --print-datadir | ||
OUTPUT_VARIABLE bison_encoded_data_dir | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(NOT EXISTS ${bison_encoded_data_dir}) | ||
get_filename_component(bison_prefix ${BISON_EXECUTABLE} DIRECTORY) | ||
get_filename_component(bison_prefix ${bison_prefix} DIRECTORY) | ||
if(EXISTS ${bison_prefix}/share/bison) | ||
set(BISON_EXECUTE_ENV "BISON_PKGDATADIR=${bison_prefix}/share/bison") | ||
endif() | ||
endif() | ||
if(NOT ${BISON_EXECUTE_ENV} STREQUAL "") | ||
set(BISON_EXECUTABLE ${CMAKE_COMMAND} -E env ${BISON_EXECUTE_ENV} ${BISON_EXECUTABLE}) | ||
endif() | ||
|
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
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.