-
Notifications
You must be signed in to change notification settings - Fork 356
/
build.sh
executable file
·33 lines (29 loc) · 939 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -e
dbname=${CONCEPTNET_DB_NAME:-conceptnet5}
check_disk_space() {
kb_free=$(df -Pk data | awk '/[0-9]%/{print $(NF-2)}')
if [ $kb_free -lt 200000000 ]; then
echo "To build ConceptNet, you will need at least 200 GB of disk space"
echo "available for the ./data directory. Try making it a symbolic link"
echo "to a larger drive."
echo
echo "Your data directory is currently on this drive:"
df -h data
exit 1
fi
}
complain_db () {
echo
echo "You don't have access to the '$dbname' PostgreSQL database."
echo "You may need to install PostgreSQL 9.5 or later, create this database,"
echo "give yourself access to it, or set \$CONCEPTNET_DB_NAME to a database"
echo "that you can use."
exit 1
}
check_db () {
cn5-db check || complain_db
}
check_disk_space
pip3 install -e '.[vectors]'
check_db
snakemake --resources 'ram=30' -j 2 $@