-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_linux.sh
More file actions
executable file
·47 lines (36 loc) · 1001 Bytes
/
build_linux.sh
File metadata and controls
executable file
·47 lines (36 loc) · 1001 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Exit on error
set -e
# Define variables
GSL_VERSION="2.8" # Update this to your desired version
BUILD_DIR="$(pwd)/gsl_build"
INSTALL_DIR="$(pwd)/gsl/linux"
GSL_SOURCE_DIR="$BUILD_DIR/gsl-$GSL_VERSION"
# Download and extract GSL if not already present
if [ ! -d "$GSL_SOURCE_DIR" ]; then
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
wget "https://ftp.gnu.org/gnu/gsl/gsl-$GSL_VERSION.tar.gz"
tar -xzf "gsl-$GSL_VERSION.tar.gz"
cd -
fi
# Clean previous builds
rm -rf "$INSTALL_DIR"
# Function to build for x86_64 architecture
build_x86_64() {
echo "Building for x86_64"
mkdir -p "$BUILD_DIR/x86_64"
cd "$BUILD_DIR/x86_64"
# Configure and build
"$GSL_SOURCE_DIR/configure" \
--prefix="$INSTALL_DIR/x86_64" \
--enable-shared \
--disable-static
# Compile and install
make -j$(nproc || 1)
make install
cd -
}
# Build for x86_64 architecture
build_x86_64
echo "GSL built successfully for x86_64 architecture!"