mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Go back to compiling OpenSSL/Python on Mac
This commit is contained in:
@@ -10,71 +10,114 @@ export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
|
|||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
|
|
||||||
if [ ! -f python-$BUILD_PYTHON_VERSION-macosx10.9.pkg ]; then
|
#if [ ! -f python-$MIN_PYTHON_VERSION-macosx10.9.pkg ]; then
|
||||||
wget --quiet https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/python-$BUILD_PYTHON_VERSION-macosx10.9.pkg
|
# wget --quiet https://www.python.org/ftp/python/$MIN_PYTHON_VERSION/python-$MIN_PYTHON_VERSION-macosx10.9.pkg
|
||||||
fi
|
#fi
|
||||||
sudo installer -pkg python-$BUILD_PYTHON_VERSION-macosx10.9.pkg -target /
|
#sudo installer -pkg python-$MIN_PYTHON_VERSION-macosx10.9.pkg -target /
|
||||||
|
|
||||||
brew install openssl@1.1
|
#brew install openssl@1.1
|
||||||
#brew upgrade python
|
#brew upgrade python
|
||||||
|
|
||||||
export python=python3
|
#export python=python3
|
||||||
export pip=pip3
|
#export pip=pip3
|
||||||
|
|
||||||
echo "Python location:"
|
#echo "Python location:"
|
||||||
which $python
|
#which $python
|
||||||
|
|
||||||
# Compile latest OpenSSL
|
# Compile latest OpenSSL
|
||||||
#if [ ! -d openssl-$BUILD_OPENSSL_VERSION ]; then
|
if [ ! -d openssl-$BUILD_OPENSSL_VERSION ]; then
|
||||||
# wget --quiet https://www.openssl.org/source/openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
wget --quiet https://www.openssl.org/source/openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
||||||
# echo "Extracting OpenSSL..."
|
echo "Extracting OpenSSL..."
|
||||||
# tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
||||||
#fi
|
fi
|
||||||
#cd openssl-$BUILD_OPENSSL_VERSION
|
cd openssl-$BUILD_OPENSSL_VERSION
|
||||||
#echo "Compiling OpenSSL $BUILD_OPENSSL_VERSION..."
|
echo "Compiling OpenSSL $BUILD_OPENSSL_VERSION..."
|
||||||
#./config shared --prefix=$mypath/ssl
|
./config shared --prefix=$mypath/ssl
|
||||||
#echo "Running make for OpenSSL..."
|
echo "Running make for OpenSSL..."
|
||||||
#make -j$cpucount -s
|
make -j$cpucount -s
|
||||||
#echo "Running make install for OpenSSL..."
|
echo "Running make install for OpenSSL..."
|
||||||
#make install > /dev/null
|
make install > /dev/null
|
||||||
#export LD_LIBRARY_PATH=~/ssl/lib
|
export LD_LIBRARY_PATH=~/ssl/lib
|
||||||
#cd ~
|
cd ~
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib
|
||||||
|
export openssl=~/ssl/bin/openssl
|
||||||
|
export python=~/python/bin/python3
|
||||||
|
export pip=~/python/bin/pip3
|
||||||
|
cpucount=$(nproc --all)
|
||||||
|
echo "This device has $cpucount CPUs for compiling..."
|
||||||
|
SSLVER=$($openssl version)
|
||||||
|
SSLRESULT=$?
|
||||||
|
PYVER=$($python -V)
|
||||||
|
PYRESULT=$?
|
||||||
|
if [ $SSLRESULT -ne 0 ] || [[ "$SSLVER" != "OpenSSL $BUILD_OPENSSL_VERSION "* ]] || [ $PYRESULT -ne 0 ] || [[ "$PYVER" != "Python $BUILD_PYTHON_VERSION"* ]]; then
|
||||||
|
echo "SSL Result: $SSLRESULT - SSL Ver: $SSLVER - Py Result: $PYRESULT - Py Ver: $PYVER"
|
||||||
|
if [ $SSLRESULT -ne 0 ]; then
|
||||||
|
echo "sslresult -ne 0"
|
||||||
|
fi
|
||||||
|
if [[ "$SSLVER" != "OpenSSL $BUILD_OPENSSL_VERSION "* ]]; then
|
||||||
|
echo "sslver not equal to..."
|
||||||
|
fi
|
||||||
|
if [ $PYRESULT -ne 0 ]; then
|
||||||
|
echo "pyresult -ne 0"
|
||||||
|
fi
|
||||||
|
if [[ "$PYVER" != "Python $BUILD_PYTHON_VERSION" ]]; then
|
||||||
|
echo "pyver not equal to..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start clean
|
||||||
|
cd ~
|
||||||
|
rm -rf python
|
||||||
|
rm -rf ssl
|
||||||
|
mkdir python
|
||||||
|
mkdir ssl
|
||||||
|
|
||||||
|
# Compile latest OpenSSL
|
||||||
|
wget --quiet https://www.openssl.org/source/openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
||||||
|
echo "Extracting OpenSSL..."
|
||||||
|
tar xf openssl-$BUILD_OPENSSL_VERSION.tar.gz
|
||||||
|
cd openssl-$BUILD_OPENSSL_VERSION
|
||||||
|
echo "Compiling OpenSSL $BUILD_OPENSSL_VERSION..."
|
||||||
|
./config shared --prefix=$HOME/ssl
|
||||||
|
echo "Running make for OpenSSL..."
|
||||||
|
make -j$cpucount -s
|
||||||
|
echo "Running make install for OpenSSL..."
|
||||||
|
make install > /dev/null
|
||||||
|
cd ~
|
||||||
|
|
||||||
# Compile latest Python
|
# Compile latest Python
|
||||||
#if [ ! -d Python-$BUILD_PYTHON_VERSION ]; then
|
echo "Downloading Python $BUILD_PYTHON_VERSION..."
|
||||||
# wget --quiet https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/Python-$BUILD_PYTHON_VERSION.tar.xz
|
curl -O https://www.python.org/ftp/python/$BUILD_PYTHON_VERSION/Python-$BUILD_PYTHON_VERSION.tar.xz
|
||||||
# echo "Extracting Python..."
|
echo "Extracting Python..."
|
||||||
# tar xf Python-$BUILD_PYTHON_VERSION.tar.xz
|
tar xf Python-$BUILD_PYTHON_VERSION.tar.xz
|
||||||
#fi
|
cd Python-$BUILD_PYTHON_VERSION
|
||||||
#cd Python-$BUILD_PYTHON_VERSION
|
echo "Compiling Python $BUILD_PYTHON_VERSION..."
|
||||||
#echo "Compiling Python $BUILD_PYTHON_VERSION..."
|
safe_flags="--with-openssl=$HOME/ssl --enable-shared --prefix=$HOME/python --with-ensurepip=upgrade"
|
||||||
#safe_flags="--with-openssl=$mypath/ssl --enable-shared --prefix=$mypath/python --with-ensurepip=upgrade"
|
unsafe_flags="--enable-optimizations --with-lto"
|
||||||
#unsafe_flags="--enable-optimizations --with-lto"
|
if [ ! -e Makefile ]; then
|
||||||
#if [ ! -e Makefile ]; then
|
echo "running configure with safe and unsafe"
|
||||||
# ./configure $safe_flags $unsafe_flags > /dev/null
|
./configure $safe_flags $unsafe_flags > /dev/null
|
||||||
#fi
|
fi
|
||||||
#make -j$cpucount -s
|
make -j$cpucount PROFILE_TASK="-m test.regrtest --pgo -j$(( $cpucount * 2 ))" -s
|
||||||
#RESULT=$?
|
RESULT=$?
|
||||||
#echo "Make Python exited with $RESULT"
|
echo "First make exited with $RESULT"
|
||||||
#if [ $RESULT != 0 ]; then
|
if [ $RESULT != 0 ]; then
|
||||||
# echo "Trying Python make again without unsafe flags..."
|
echo "Trying Python compile again without unsafe flags..."
|
||||||
# make clean
|
make clean
|
||||||
# ./configure $safe_flags > /dev/null
|
./configure $safe_flags > /dev/null
|
||||||
# make -j$cpucount -s
|
make -j$cpucount -s
|
||||||
#fi
|
echo "Sticking with safe Python for now..."
|
||||||
#echo "Installing Python..."
|
fi
|
||||||
#make install > /dev/null
|
echo "Installing Python..."
|
||||||
#cd ~
|
make install > /dev/null
|
||||||
|
cd ~
|
||||||
#export LD_LIBRARY_PATH=~/ssl/lib:~/python/lib
|
fi
|
||||||
#python=~/python/bin/python3
|
|
||||||
#pip=~/python/bin/pip3
|
|
||||||
|
|
||||||
$python -V
|
$python -V
|
||||||
|
|
||||||
cd $whereibelong
|
cd $whereibelong
|
||||||
|
|
||||||
export PATH=/usr/local/opt/python/libexec/bin:$PATH
|
#export PATH=/usr/local/opt/python/libexec/bin:$PATH
|
||||||
$pip install --upgrade pip
|
$pip install --upgrade pip
|
||||||
$pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip install -U
|
$pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 $pip install -U
|
||||||
$pip install --upgrade -r src/requirements.txt
|
$pip install --upgrade -r src/requirements.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user