Skip to content

Commit 9a5d699

Browse files
committed
Merge branch 'master' into ENH-017-skyrmion-number
2 parents 3e3c30a + ff5a934 commit 9a5d699

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2032
-1441
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ install:
2222
- source activate fidimag-test
2323
- pip install pyvtk six nbval
2424
# Download and compile FFTW & Sundials locally
25-
- bash bin/install.sh
25+
- bash bin/install-sundials-2.5.sh
26+
- bash bin/install-fftw.sh
2627

2728
before_script:
2829
- make build

bin/install-fftw.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# This script installs FFTW locally. It may need to environment
4+
# variables to work, like 'export CC=gcc' in ARCHER.
5+
6+
FFTW=fftw-3.3.4
7+
8+
set -e
9+
10+
# Create target directory if needed.
11+
12+
HERE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
13+
FIDIMAG_DIR="$(dirname "$HERE_DIR")"
14+
LIBS_DIR=${FIDIMAG_DIR}/local
15+
mkdir -p $LIBS_DIR
16+
cd ${LIBS_DIR}
17+
echo "Installing FFTW to "$LIBS_DIR"."
18+
echo "Using CC="$CC" "
19+
20+
download_and_install() {
21+
# $1 name of the package
22+
# $2 URL where ${1}.tar.gz can be obtained
23+
# $3 configure options
24+
if [ ! -e ${1}.tar.gz ]; then
25+
echo "Downloading "${1}"."
26+
wget -q ${2}/${1}.tar.gz
27+
fi;
28+
29+
if [ ! -e ${1} ]; then
30+
tar -xzf ${1}.tar.gz
31+
cd ${1}
32+
echo "Configuring "${1}"."
33+
./configure --quiet --enable-shared --enable-openmp --prefix=${LIBS_DIR}
34+
echo "Compiling and installing "${1}"."
35+
{
36+
make
37+
make install
38+
} > /dev/null
39+
echo "Done."
40+
cd ${LIBS_DIR}
41+
fi;
42+
}
43+
44+
download_and_install ${FFTW} http://www.fftw.org
45+
46+
echo "Installation succesful."

bin/install.sh renamed to bin/install-sundials-2.5.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22

3-
# This script installs SUNDIALS and FFTW locally. It may need to environment
3+
# This script installs SUNDIALS locally. It may need to environment
44
# variables to work, like 'export CC=gcc' in ARCHER.
55

66
SUNDIALS=sundials-2.5.0
7-
FFTW=fftw-3.3.4
87

98
set -e
109

@@ -43,6 +42,5 @@ download_and_install() {
4342
}
4443

4544
download_and_install ${SUNDIALS} http://ftp.mcs.anl.gov/pub/petsc/externalpackages --disable-lapack
46-
download_and_install ${FFTW} http://www.fftw.org --enable-openmp
4745

4846
echo "Installation succesful."

bin/install-sundials.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ download_and_cmake_install() {
6161
download_and_cmake_install \
6262
${SUNDIALS} \
6363
http://computation.llnl.gov/projects/sundials-suite-nonlinear-differential-algebraic-equation-solvers/download \
64-
"-DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="${LIBS_DIR}" -DEXAMPLES_ENABLE=OFF -DLAPACK_ENABLE=ON -DOPENMP_ENABLE=ON"
64+
"-DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="${LIBS_DIR}" -DEXAMPLES_ENABLE=OFF -DLAPACK_ENABLE=ON -DOPENMP_ENABLE=ON --enable-sse2"

bin/install-ubuntu-packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# required to compile fidimag
2-
apt-get install python-numpy python-dev python-scipy
2+
apt-get install python-pip python-numpy python-dev python-scipy
33
# required for tests and running it
44
apt-get install python-pytest python-pyvtk ipython python-matplotlib

bin/ubuntu_install_script.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
sudo bash install.sh
21
sudo bash install-ubuntu-packages.sh
2+
bash install-fftw.sh
3+
bash install-sundials-2.5.sh
34
sudo pip install cython --upgrade
5+
cd ..
46
make
57
echo "export PYTHONPATH=$(dirname $PWD):$PYTHONPATH" >> /home/$USER/.bashrc

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ Contents:
1919
install
2020
core_eqs
2121
extended_eqs
22+
monte_carlo
2223
develop
2324
ipynb/tutorial-basics

doc/install.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,18 @@ Notes:
217217
failed without a working X server).
218218

219219
Install on OS X
220-
===============
220+
=================
221221

222222
The inbuilt OS X gcc compiler (actually clang) doesn't have OpenMP support. A workaround is to
223223

224224
- install gcc5 (via homebrew, for example: ``brew install gcc --without-multilib``)
225225
- set CC environment variable to point to that compiler: ``export CC=gcc-5``
226226

227+
Alternatively, gcc can be installed through ``sudo port install gcc5`` and CC environment
228+
variable can be set via ``export CC=gcc-mp-5``
227229

228-
Once this is done, run ``bin/install.sh`` which will compile fftw3 and
229-
sundials (in a local subdirectory) using this compiler.
230+
Once this is done, run ``bin/install-fftw.sh`` and ``bin/install-sundials.sh`` which will
231+
compile fftw3 and sundials (in a local subdirectory) using this compiler.
230232

231233
Also install pytest (``conda install pytest`` if using conda) and
232234
``pyvtk`` via pip (``pip install pyvtk``).

0 commit comments

Comments
 (0)