-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update indexlr * Remove -fopenmp flag
- Loading branch information
Showing
853 changed files
with
246,556 additions
and
14,588 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
#!/bin/bash | ||
|
||
get_major_minor_version() { | ||
echo "$1" | awk '{print $2}' | awk -F '.' '{print $1 "." $2}' | ||
} | ||
|
||
get_lib_paths() { | ||
local lib_paths=() | ||
for flag in $1; do | ||
if [[ $flag == "-L"* ]]; then | ||
lib_paths+=($flag) | ||
fi | ||
done | ||
echo "${lib_paths[@]}" | ||
} | ||
|
||
get_config_vars() { | ||
local prefix="py${1}" | ||
local config_var="${prefix}_config" | ||
local path_var="${prefix}_path" | ||
local version_var="${prefix}_version" | ||
local version_num_var="${prefix}_version_num" | ||
local cflags_var="${prefix}_cflags" | ||
local ldflags_var="${prefix}_ldflags" | ||
local lib_paths_var="${prefix}_lib_paths" | ||
|
||
export declare ${config_var}="python${1}-config" | ||
command -v ${!config_var} >/dev/null | ||
if [[ $? -eq 0 ]]; then | ||
export declare ${path_var}="$(${!config_var} --exec-prefix)/bin/python${1}" | ||
export declare ${version_var}="$(${!path_var} --version 2>&1)" | ||
export declare ${version_num_var}="$(get_major_minor_version "${!version_var}")" | ||
export declare ${cflags_var}="$(${!config_var} --cflags)" | ||
export declare ${ldflags_var}="$(${!config_var} --ldflags)" | ||
export declare ${lib_paths_var}="$(get_lib_paths "${!ldflags_var}")" | ||
else | ||
export declare ${version}="" | ||
export declare ${version_num}=-1 | ||
fi | ||
} | ||
|
||
are_lists_diff() { | ||
local list1=() | ||
local list2=() | ||
for e in $1; do | ||
list1+=($e) | ||
done | ||
for e in $2; do | ||
list2+=($e) | ||
done | ||
old_IFS="$IFS" | ||
IFS=$'\n' | ||
local list1_sorted=($(sort <<< "${list1[*]}")) | ||
local list2_sorted=($(sort <<< "${list2[*]}")) | ||
IFS="$old_IFS" | ||
[[ ${list1_sorted[@]} == ${list2_sorted[@]} ]] | ||
echo $? | ||
} | ||
|
||
get_config_vars | ||
get_config_vars 3 | ||
|
||
set -e | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
# Check if in interactive prompt | ||
if [[ -n ${PS1+x} ]]; then | ||
if [[ ! "$py_version_num" < "3.0" && "$py_version_num" < "4.0" ]]; then | ||
lib_paths_diff=$(are_lists_diff "$py_lib_paths" "$py3_lib_paths") | ||
if [[ ("$py_version" != "$py3_version") || ($lib_paths_diff -eq 1) ]]; then | ||
option1="$py_version" | ||
option2="$py3_version" | ||
if [[ -n "${py_lib_paths}" ]]; then | ||
option1+=" ($py_lib_paths)" | ||
fi | ||
if [[ -n "${py3_lib_paths}" ]]; then | ||
option2+=" ($py3_lib_paths)" | ||
fi | ||
|
||
echo "Multiple Pythons found" | ||
PS3="Select which one to build with: " | ||
options=("${option1}" "${option2}") | ||
select opt in "${options[@]}"; do | ||
case $opt in | ||
"${option1}") | ||
echo "Using ${option1}"; | ||
export BTLLIB_PYTHON_CFLAGS="$py_cflags" | ||
export BTLLIB_PYTHON_LDFLAGS="$py_ldflags" | ||
export BTLLIB_PYTHON_VERSION="$py_version_num" | ||
break;; | ||
"${option2}") | ||
echo "Using ${option2}"; | ||
export BTLLIB_PYTHON_CFLAGS="$py3_cflags" | ||
export BTLLIB_PYTHON_LDFLAGS="$py3_ldflags" | ||
export BTLLIB_PYTHON_VERSION="$py3_version_num" | ||
break;; | ||
*) echo "Invalid option $REPLY";; | ||
esac | ||
done | ||
fi | ||
fi | ||
fi | ||
|
||
deps=( 'meson' 'ninja' 'cmake' ) | ||
missing_dep=0 | ||
pip_to_install="" | ||
for dep in ${deps[@]}; do | ||
set +e | ||
command -v $dep >/dev/null | ||
if [[ $? -eq 1 ]]; then | ||
missing_dep=1 | ||
pip_to_install+=" $dep" | ||
fi | ||
set -e | ||
done | ||
|
||
in_venv=false | ||
if [[ $missing_dep -eq 1 ]]; then | ||
if [[ ! -f venv ]]; then | ||
python3 -m venv venv | ||
fi | ||
source venv/bin/activate | ||
pip3 install $pip_to_install | ||
in_venv=true | ||
fi | ||
|
||
rm -rf build python java | ||
meson setup --buildtype release --prefix=$SCRIPTPATH build | ||
if [[ $? -eq 0 ]]; then | ||
cd build | ||
ninja build-sdsl | ||
ninja install | ||
cd .. | ||
fi | ||
|
||
cd $SCRIPTPATH | ||
if [[ $in_venv == true ]]; then | ||
deactivate | ||
fi |
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,6 @@ | ||
[submodule "external/googletest"] | ||
path = external/googletest | ||
url = https://github.com/google/googletest.git | ||
[submodule "external/libdivsufsort"] | ||
path = external/libdivsufsort | ||
url = https://github.com/simongog/libdivsufsort.git |
Oops, something went wrong.