Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use numpy build options for CPU optimizations #232

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion singularity/Singularity.intel_mkl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,31 @@ EOF
rm -rf datashape-0.5.2/

pip install --upgrade pip wheel Cython
pip install "numpy<2"
if [ $HAS_MKL = true ]; then
wget https://github.com/numpy/numpy/releases/download/v1.26.4/numpy-1.26.4.tar.gz
tar xzf numpy-1.26.4.tar.gz
rm numpy-1.26.4.tar.gz
cd numpy-1.26.4/
if [ $MARCH = 'x86-64' ] && [ $MTUNE = 'generic' ]; then
pip install . -Csetup-args=-Dblas-order=mkl,openblas,blis -Csetup-args=-Dlapack-order=mkl,openblas,lapack
else
pip install . -Csetup-args=-Dcpu-baseline="native" -Csetup-args=-Dcpu-dispatch="none" -Csetup-args=-Dblas-order=mkl,openblas,blis -Csetup-args=-Dlapack-order=mkl,openblas,lapack
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

native cannot be used, as these recipes do not "build for local use" as that part of the numpy docs aims for.

fi
cd ..
rm -rf numpy-1.26.4/

wget https://github.com/scipy/scipy/releases/download/v1.15.1/scipy-1.15.1.tar.gz
tar xzf scipy-1.15.1.tar.gz
rm scipy-1.15.1.tar.gz
cd scipy-1.15.1/
pip install . -Csetup-args=-Dblas=mkl-dynamic-lp64-iomp -Csetup-args=-Dlapack=mkl-dynamic-lp64-iomp
cd ..
rm -rf scipy-1.15.1/

export PKG_CONFIG_PATH=$MKLROOT/lib/pkgconfig/
else
pip install "numpy<2"
fi
pip install --no-binary pandas pandas
pip install --no-binary h5py h5py
pip install -r $INSTALLDIR/requirements.txt
Expand Down Expand Up @@ -740,6 +764,7 @@ EOF
echo export MKLROOT=$MKLROOT >> $INSTALLDIR/init.sh
echo export PATH=\$MKLROOT/bin:\$PATH >> $INSTALLDIR/init.sh
echo export LD_LIBRARY_PATH=\$MKLROOT/lib:\$LD_LIBRARY_PATH >> $INSTALLDIR/init.sh
echo export PKG_CONFIG_PATH=\$PKG_CONFIG_PATH >> $INSTALLDIR/init.sh
fi


Expand Down
264 changes: 0 additions & 264 deletions site.cfg

This file was deleted.

Loading