source: XIOS/dev/branch_openmp/extern/remap/README.mac @ 1511

Last change on this file since 1511 was 688, checked in by mhnguyen, 6 years ago

Integrating remap library into XIOS

+) Change name of some files of remap library to be compatible with XIOS
+) Implement function to fill in automatically boundary longitude and latitude

Test
+) On Curie
+) test_remap correct

File size: 2.9 KB
Line 
1======================== Recipe 2 : using anaconda =========================
2
3# install packages using macports
4sudo port install openmpi
5# activate what we have just installed (mandatory)
6sudo port select mpi openmpi-mp-fortran
7# my anaconda is in my $HOME - no need for sudo
8pip install mpi4py
9conda install netcdf4
10
11compile the remap library
12run the remap.py script
13
14==================== Checking which libraries are loaded ======================
15
16Useful to make sure that mpirun, remap and python use the same MPI library.
17
18sudo dtruss -f -t open sudo -u $(whoami) mpirun -np 1 python test.py 2>out
19grep mpich out
20grep openmpi out
21
22where test.py contains
23 from mpi4py import MPI
24 import netCDF4
25 import ctypes as ct
26 import os
27 test = ct.cdll.LoadLibrary(os.path.realpath('libmapper.so'))
28
29If grep finds both mpich and openmpi, something is wrong !
30
31====================== Various ways to mess up python/netCDF/MPI on MacOS ====================
32
33Anaconda vs macports python
34===========================
35I have several pythons installed : 3 from Apple, one from macports and one from the Anaconda distribution, which is the default on my path.
36
37* find whether we use python from MacPorts or anaconda
38 which python
39the one from macports is in /opt/local/bin
40
41* check active macports python version
42 port select python
43 (mine : python27)
44
45* if desired, set the path to avoid anaconda
46echo $PATH
47result :  /Users/dubos/anaconda/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
48export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
49
50Below,  [with macports] assumes that « which python » finds /opt/local/bin/python » while [with anaconda] assumes it finds the anaconda-provided python.
51
52Python-netCDF
53=============
54[with macports] :
55sudo port install py-netcdf4
56
57[with anaconda] :
58conda install netcdf4
59Notice that this will also compile its own instance of netCDF.
60
61Notice that in principle one could install python-netcdf using pip or easy_install. In my case it fails - there is a version mismatch for the HDF library at runtime
62
63MPI
64===
65Macports can install openmpi, mpich or both (I have both). If both are installed one is activated by « port select ».
66
67It will install it for a specific compiler.
68* checking your active compiler
69 port select gcc
70* installing openmpi
71 sudo port install openmpi
72* checking for which gcc openmpi has been compiled
73 port installed openmpi-default
74* checking your active mpi
75 port select mpi
76* selecting openmpi (for example)
77 sudo port select mpi openmpi-mp-fortran
78
79MPI4py
80======
81It is important to compile the mapper library with the same MPI as mpi4py !
82easy_install fails on my Mac so I must use pip
83
84[with MacPorts] :
85  sudo port install py-pip
86  sudo port select pip pip27
87  sudo pip install mpi4py
88
89[with anaconda]  : pip is already installed,
90  which pip
91  pip install mpi4py
92
93
Note: See TracBrowser for help on using the repository browser.