Skip to content

Commit 3e4e9e4

Browse files
authored
Merge pull request #174 from krashish8/ashish-2021
GSoC-2021 Week 3: vrp_vroom
2 parents e597a91 + e88073c commit 3e4e9e4

File tree

15 files changed

+705
-14
lines changed

15 files changed

+705
-14
lines changed

.github/workflows/boost_version.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,37 @@ jobs:
6262
sudo tar --bzip2 -xf boost_1_${{ matrix.boost_minor }}_0.tar.bz2
6363
sudo mv boost_1_${{ matrix.boost_minor }}_0/boost /usr/include/
6464
65+
- name: Install VROOM dependencies
66+
run: |
67+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
68+
69+
- name: Build VROOM v1.10.0
70+
run: |
71+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
72+
tar -zvxf v1.10.0.tar.gz
73+
cd vroom-1.10.0/src
74+
75+
# Create object file with position independent code using -fPIC flag
76+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
77+
78+
make
79+
cd ..
80+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
6581
6682
- name: Configure
6783
run: |
6884
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
6985
mkdir build
7086
cd build
71-
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug -DWITH_DOC=OFF ..
87+
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
7288
7389
- name: Build
7490
run: |
7591
cd build
7692
make -j 4
7793
sudo make install
7894
79-
- name: Unapck data
95+
- name: Unpack data
8096
run: |
8197
cd tools/testers
8298
tar -xf matrix_new_values.tar.gz

.github/workflows/check-queries.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,29 @@ jobs:
5252
postgresql-${PGVER}-pgrouting \
5353
postgresql-server-dev-${PGVER}
5454
55+
- name: Install VROOM dependencies
56+
run: |
57+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
58+
59+
- name: Build VROOM v1.10.0
60+
run: |
61+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
62+
tar -zvxf v1.10.0.tar.gz
63+
cd vroom-1.10.0/src
64+
65+
# Create object file with position independent code using -fPIC flag
66+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
67+
68+
make
69+
cd ..
70+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
71+
5572
- name: Configure
5673
run: |
5774
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
5875
mkdir build
5976
cd build
60-
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug ..
77+
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Debug -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
6178
6279
- name: Build
6380
run: |
@@ -73,7 +90,7 @@ jobs:
7390
tools/scripts/get_signatures.sh -p ${PGPORT}
7491
git diff --exit-code --quiet sql/sigs/*.sig
7592
76-
- name: Unapck data
93+
- name: Unpack data
7794
run: |
7895
cd tools/testers
7996
tar -xf matrix_new_values.tar.gz

.github/workflows/clang.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,37 @@ jobs:
5555
postgresql-${PGVER}-pgrouting \
5656
postgresql-server-dev-${PGVER}
5757
58+
- name: Install VROOM dependencies
59+
run: |
60+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
61+
62+
- name: Build VROOM v1.10.0
63+
run: |
64+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
65+
tar -zvxf v1.10.0.tar.gz
66+
cd vroom-1.10.0/src
67+
68+
# Create object file with position independent code using -fPIC flag
69+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
70+
71+
make
72+
cd ..
73+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
74+
5875
- name: Configure
5976
run: |
6077
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
6178
mkdir build
6279
cd build
63-
CXX=clang++ CC=clang cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DWITH_DOC=OFF ..
80+
CXX=clang++ CC=clang cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
6481
6582
- name: Build
6683
run: |
6784
cd build
6885
make -j 4
6986
sudo make install
7087
71-
- name: Unapck data
88+
- name: Unpack data
7289
run: |
7390
cd tools/testers
7491
tar -xf matrix_new_values.tar.gz

.github/workflows/doc-check.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,23 @@ jobs:
7676
pip install -r requirements.txt
7777
pip list
7878
79+
- name: Install VROOM dependencies
80+
run: |
81+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
82+
83+
- name: Build VROOM v1.10.0
84+
run: |
85+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
86+
tar -zvxf v1.10.0.tar.gz
87+
cd vroom-1.10.0/src
88+
89+
# Create object file with position independent code using -fPIC flag
90+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
91+
92+
make
93+
cd ..
94+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
95+
7996
- name: Configure
8097
if: env.PROCESS == 'true'
8198
run: |
@@ -84,7 +101,8 @@ jobs:
84101
cd build
85102
cmake -DLINKCHECK=ON -DHTML=ON -DWITH_DOC=ON \
86103
-DDE=ON -DES=ON -DFR=ON -DJA=ON -DIT=ON \
87-
-DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release ..
104+
-DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release \
105+
-DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
88106
89107
- name: Check Links
90108
if: env.PROCESS == 'true'

.github/workflows/documentation.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,31 @@ jobs:
5656
pip install -r requirements.txt
5757
pip list
5858
59+
- name: Install VROOM dependencies
60+
run: |
61+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
62+
63+
- name: Build VROOM v1.10.0
64+
run: |
65+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
66+
tar -zvxf v1.10.0.tar.gz
67+
cd vroom-1.10.0/src
68+
69+
# Create object file with position independent code using -fPIC flag
70+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
71+
72+
make
73+
cd ..
74+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
75+
5976
- name: Configure link checks
6077
run: |
6178
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
6279
mkdir build
6380
cd build
6481
cmake -DPOSTGRESQL_VERSION=${PGVER} -DCMAKE_BUILD_TYPE=Release \
65-
-DWITH_DOC=ON -DES=ON ..
82+
-DWITH_DOC=ON -DES=ON \
83+
-DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
6684
6785
- name: Build Documentation
6886
run: |

.github/workflows/macos.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
paths-ignore:
1010
- '**.po'
1111

12+
# TODO: Fix the macOS build for compiling and building VROOM with vrprouting.
1213
jobs:
1314
build:
1415
name: Build
@@ -22,11 +23,34 @@ jobs:
2223
run: |
2324
brew install postgis boost pgrouting
2425
26+
- name: Install VROOM dependencies
27+
run: |
28+
brew install openssl asio glpk
29+
30+
- name: Build VROOM v1.10.0
31+
run: |
32+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
33+
tar -zvxf v1.10.0.tar.gz
34+
cd vroom-1.10.0/src
35+
36+
# Source: https://github.com/VROOM-Project/vroom/issues/378
37+
ln -s /usr/local/opt/openssl/include/openssl /usr/local/include
38+
ln -s /usr/local/opt/openssl/lib/libssl.dylib /usr/local/lib/
39+
ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/
40+
41+
# Create object file with position independent code using -fPIC flag
42+
sed -i '' -e 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
43+
sed -i '' -e 's/\/usr\/include\/glpk.h/\/usr\/local\/opt\/glpk\/include\/glpk.h/' makefile
44+
45+
make
46+
cd ..
47+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
48+
2549
- name: Configure
2650
run: |
2751
mkdir build
2852
cd build
29-
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF ..
53+
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_DOC=OFF -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
3054
3155
- name: Build
3256
run: |
@@ -63,7 +87,7 @@ jobs:
6387
sudo make install
6488
cpan TAP::Parser::SourceHandler::pgTAP
6589
66-
- name: Unapck data
90+
- name: Unpack data
6791
run: |
6892
cd tools/testers
6993
tar -xf matrix_new_values.tar.gz

.github/workflows/publish-doc.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,29 @@ jobs:
6767
pip install sphinx-bootstrap-theme
6868
pip list
6969
70+
- name: Install VROOM dependencies
71+
run: |
72+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
73+
74+
- name: Build VROOM v1.10.0
75+
run: |
76+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
77+
tar -zvxf v1.10.0.tar.gz
78+
cd vroom-1.10.0/src
79+
80+
# Create object file with position independent code using -fPIC flag
81+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
82+
83+
make
84+
cd ..
85+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
86+
7087
- name: Configure
7188
run: |
7289
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
7390
mkdir build
7491
cd build
75-
cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON ..
92+
cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
7693
7794
- name: Build
7895
run: |

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,29 @@ jobs:
7575
pip install sphinx-bootstrap-theme
7676
pip list
7777
78+
- name: Install VROOM dependencies
79+
run: |
80+
sudo apt-get install libssl-dev libasio-dev libglpk-dev
81+
82+
- name: Build VROOM v1.10.0
83+
run: |
84+
wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0.tar.gz
85+
tar -zvxf v1.10.0.tar.gz
86+
cd vroom-1.10.0/src
87+
88+
# Create object file with position independent code using -fPIC flag
89+
sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
90+
91+
make
92+
cd ..
93+
echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
94+
7895
- name: Configure
7996
run: |
8097
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
8198
mkdir build
8299
cd build
83-
cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON ..
100+
cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH} ..
84101
85102
- name: Build
86103
run: |

include/c_common/arrays_input.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ int64_t* pgr_get_bigIntArray(size_t *arrlen, ArrayType *input);
3737
/** @brief Allows the input array to be empty */
3838
int64_t* pgr_get_bigIntArray_allowEmpty(size_t *arrlen, ArrayType *input);
3939

40+
/** @brief Allows the input array, with non-negative elements to be empty */
41+
uint32_t* pgr_get_positiveIntArray_allowEmpty(size_t *arrlen, ArrayType *input);
42+
4043
#endif // INCLUDE_C_COMMON_ARRAYS_INPUT_H_

include/c_common/get_check_data.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ spi_getBigIntArr_allowEmpty(
6363
Column_info_t info,
6464
size_t *the_size);
6565

66+
/** @brief Function returns the values of specified columns in array. */
67+
uint32_t*
68+
spi_getPositiveIntArr_allowEmpty(
69+
HeapTuple *tuple,
70+
TupleDesc *tupdesc,
71+
Column_info_t info,
72+
size_t *the_size);
73+
6674
/** @brief gets value of specified column in double type. */
6775
double
6876
spi_getFloat8(
@@ -114,6 +122,21 @@ TInterval get_PositiveTInterval_plain(HeapTuple*, TupleDesc*, Column_info_t, TIn
114122
/** get Id from data */
115123
Id get_Id(HeapTuple*, TupleDesc*, Column_info_t, Id);
116124

125+
/** get Idx from data */
126+
Idx get_Idx(HeapTuple*, TupleDesc*, Column_info_t, Idx);
127+
128+
/** get MatrixIndex from data */
129+
MatrixIndex get_MatrixIndex(HeapTuple*, TupleDesc*, Column_info_t, MatrixIndex);
130+
131+
/** get Duration from data */
132+
Duration get_Duration(HeapTuple*, TupleDesc*, Column_info_t, Duration);
133+
134+
/** get Priority from data */
135+
Priority get_Priority(HeapTuple*, TupleDesc*, Column_info_t, Priority);
136+
137+
/** get Distance from data */
138+
Distance get_Distance(HeapTuple*, TupleDesc*, Column_info_t, Distance);
139+
117140
/** get Amount from data */
118141
Amount get_Amount(HeapTuple*, TupleDesc*, Column_info_t, Amount);
119142

0 commit comments

Comments
 (0)