1 | # arch.env and arch.path should be sourced before sourcing this script |
---|
2 | module load python/2.7-anaconda |
---|
3 | |
---|
4 | # If not done yet, certain python packages must be installed in a dynamico-only conda environment of yours : |
---|
5 | # conda create -n dynamico python |
---|
6 | # source activate dynamico |
---|
7 | # pip install scipy mpi4py jinja2 matplotlib cython cmake |
---|
8 | |
---|
9 | # netCDF4 must be installed manually in order to use the netCDF library from the modules (requires Cython, see above) |
---|
10 | # for unpack Python/extern/netCDF4-1.2.9.tar.gz then |
---|
11 | # LDFLAGS='-lirc' python setup.py install |
---|
12 | # NOTE : libirc.so is the intel runtime library and is needed at runtime. |
---|
13 | # NOTE : setup.py installs a *.egg file which contains the netCDF4 and netcdftime module. Deactivate then activate again your conda environment if you want to test that they are working. |
---|
14 | |
---|
15 | # CICLAD does not have a parmetis module |
---|
16 | # compiling parmetis uses cmake, installed above using pip because the system-wide cmake might not work with the modules |
---|
17 | # for this unpack Python/extern/parmetis-4.0.3.tar.gz then |
---|
18 | # make config shared=1 prefix=$HOME/.conda/envs/dynamico |
---|
19 | # make install |
---|
20 | # manually install libmetis.so and metis.h ... |
---|
21 | # cp $(find . -name 'libmetis.so') $HOME/.conda/envs/dynamico/lib/ |
---|
22 | # cp $(find . -name 'metis.h') $HOME/.conda/envs/dynamico/include/ |
---|
23 | # NOTE : the tar.gz is derived from http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz |
---|
24 | # with modifications along the lines of |
---|
25 | # https://stackoverflow.com/questions/35058709/building-shared-parmetis-4-0-3 |
---|
26 | |
---|
27 | source activate dynamico |
---|
28 | PARMETIS_CFLAGS="-I$HOME/.conda/envs/dynamico/include" |
---|
29 | PARMETIS_LDFLAGS="-L$HOME/.conda/envs/dynamico/lib -lparmetis" |
---|
30 | |
---|
31 | export NETCDF_LDFLAGS="$(nf-config --flibs)" |
---|
32 | |
---|
33 | KERNELS_LDFLAGS="$NETCDF_LIBDIR $NETCDF_LIB -liomp5 $MKL_LIBDIR $MKL_LIB $PARMETIS_LDFLAGS" |
---|
34 | # check that packages work |
---|
35 | for x in netCDF4 mpi4py numpy jinja2 ; do python -c "import $x" ; done |
---|
36 | python -c "import ctypes ; parmetis=ctypes.cdll.LoadLibrary('libparmetis.so')" |
---|
37 | |
---|
38 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.conda/envs/dynamico/lib |
---|
39 | |
---|
40 | . linux.env |
---|