-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·36 lines (29 loc) · 1.1 KB
/
configure
File metadata and controls
executable file
·36 lines (29 loc) · 1.1 KB
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
34
35
36
#!/usr/bin/env sh
# Set TMPDIR to avoid creating temp directories in /tmp for CRAN compliance
export TMPDIR="${PWD}/src/libK/build_tmp"
mkdir -p "${TMPDIR}"
. tools/cmake_config.sh
if test -z "${CMAKE_BIN}"; then
## also error to end configure here
as_fn_error $? "Could not find 'cmake'." "$LINENO" 5
fi
export PATH=$PATH:$(cd $(dirname -- $CMAKE_BIN) && pwd -P)
tools/r_config.sh
# It is required that setup.sh is run before R CMD build rlibkriging when submit to CRAN.
if [ ! -d R ]; then
echo "R directory does not exist, running setup.sh"
tools/setup.sh
else
echo "R directory exists, skipping setup.sh"
fi
tools/build.sh
# Clean up temporary directory used for CMake
rm -rf "${TMPDIR}"
# Also clean up any CMake temp directories that were created in /tmp during this build
# Find temp directories created in the last 10 minutes
find /tmp -maxdepth 1 -name "tmp.*" -type d -user $(id -u) -mmin -10 2>/dev/null | while read dir; do
# Only remove if it contains CMake files (to be safe)
if [ -f "$dir/CMakeCache.txt" ] || [ -d "$dir/CMakeFiles" ]; then
rm -rf "$dir" 2>/dev/null || true
fi
done