WRFgcc
(Creación de la página de compilación de WRF con gcc) |
(→WRF) |
||
(No se muestran 29 ediciones intermedias realizadas por 2 usuarios) | |||
Línea 11: | Línea 11: | ||
These compilation steps are kept inside the file <code>/share/tools/Downloads/compilation.inf</code> |
These compilation steps are kept inside the file <code>/share/tools/Downloads/compilation.inf</code> |
||
− | 1.- Compiling <code>openmpi v3.0.0.</code> |
+ | === openmpi v3.0.0 === |
* getting source |
* getting source |
||
<pre> |
<pre> |
||
Línea 32: | Línea 32: | ||
$ ./configure --prefix=/share/tools/bin/openmpi/3.0.0/gcc >& run_configure.log |
$ ./configure --prefix=/share/tools/bin/openmpi/3.0.0/gcc >& run_configure.log |
||
</pre> |
</pre> |
||
− | * Looking for errors in <code>run_configure.log</code>. If not </code>make</code> chain (ensuring each steps goes fine) |
+ | * Looking for errors in '''run_configure.log''' |
+ | grep -i error run_configure.log |
||
+ | If not '''make''' chain (ensuring each steps goes fine) |
||
<pre> |
<pre> |
||
$ make all >& run_make.log |
$ make all >& run_make.log |
||
Línea 41: | Línea 41: | ||
For all the others libraries is similar, but paying attention to provide the right installation folder and the right location of the new compiled libraries |
For all the others libraries is similar, but paying attention to provide the right installation folder and the right location of the new compiled libraries |
||
− | 1.- zlib-1.2.11 |
+ | === zlib-1.2.11 === |
<code> |
<code> |
||
src: https://zlib.net/zlib-1.2.11.tar.gz |
src: https://zlib.net/zlib-1.2.11.tar.gz |
||
− | $ ./configure --prefix=/share/tools/bin/zlib/1.2.8/gcc >& run_configure.log |
+ | $ ./configure --prefix=/share/tools/bin/zlib/1.2.11/gcc >& run_configure.log |
$ make >& make.log |
$ make >& make.log |
||
$ make check >& make_check.log |
$ make check >& make_check.log |
||
Línea 50: | Línea 50: | ||
</code> |
</code> |
||
− | 1.- hdf5-1.10.1 |
+ | === hdf5-1.10.1 === |
<code> |
<code> |
||
src: hdf5-1.10.1.tar.bz2 |
src: hdf5-1.10.1.tar.bz2 |
||
$ export CPP=/usr/bin/cpp |
$ export CPP=/usr/bin/cpp |
||
− | $ apt-get install g++ |
+ | $ ./configure --enable-fortran --with-zlib=/share/tools/bin/zlib/1.2.11/gcc \ |
− | $ ./configure --enable-fortran --with-zlib=/share/tools/bin/zlib/1.2.8/gcc/lib |
||
--prefix=/share/tools/bin/hdf5/1.10.1/gcc >& run_configure.log |
--prefix=/share/tools/bin/hdf5/1.10.1/gcc >& run_configure.log |
||
$ make >& make.log |
$ make >& make.log |
||
Línea 61: | Línea 61: | ||
</code> |
</code> |
||
− | 1.- libcurl-7.57.0 |
+ | === libcurl-7.60.0 === |
<code> |
<code> |
||
− | src: https://curl.haxx.se/download/curl-7.57.0.tar.gz |
+ | src: https://curl.haxx.se/download/curl-7.60.0.tar.gz |
− | $ ./configure --prefix=/share/tools/bin/curl/7.57.0/gcc >& run_configure.log |
+ | $ ./configure --prefix=/share/tools/bin/curl/7.60.0/gcc >& run_configure.log |
$ make >& make.log |
$ make >& make.log |
||
$ make check >& make_check.log |
$ make check >& make_check.log |
||
Línea 70: | Línea 70: | ||
</code> |
</code> |
||
− | 2.- netcdf-4.5.0 |
+ | === netcdf-4.5.0 === |
<code> |
<code> |
||
src: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.5.0.tar.gz |
src: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.5.0.tar.gz |
||
− | $ apt-get install curl |
+ | $ export LDFLAGS='-L/share/tools/bin/zlib/1.2.11/gcc/lib -L/share/tools/bin/hdf5/1.10.1/gcc/lib |
− | $ export LDFLAGS='-L/share/tools/bin/zlib/1.2.8/gcc/lib -L/share/tools/bin/hdf5/1.10.1/gcc/lib |
||
-L/share/tools/bin/curl/7.57.0/gcc/lib' |
-L/share/tools/bin/curl/7.57.0/gcc/lib' |
||
− | $ export CPPFLAGS='-I/share/tools/bin/zlib/1.2.8/gcc/include -I/share/tools/bin/hdf5/1.10.1/gcc/include |
+ | $ export CPPFLAGS='-I/share/tools/bin/zlib/1.2.11/gcc/include -I/share/tools/bin/hdf5/1.10.1/gcc/include |
-I/share/tools/bin/curl/7.57.0/gcc/include' |
-I/share/tools/bin/curl/7.57.0/gcc/include' |
||
$ ./configure --enable-netcdf-4 --prefix=/share/tools/bin/netcdf/4.5.0/gcc >& run_configure.log |
$ ./configure --enable-netcdf-4 --prefix=/share/tools/bin/netcdf/4.5.0/gcc >& run_configure.log |
||
Línea 82: | Línea 82: | ||
$ make install >& make_install.log |
$ make install >& make_install.log |
||
</code> |
</code> |
||
− | Fortran interdace |
+ | |
+ | * Fortran interface |
||
+ | |||
<code> |
<code> |
||
src: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.4.tar.gz |
src: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.4.tar.gz |
||
$ export LD_LIBRARY_PATH=-I/share/tools/bin/netcdf/4.5.0/gcc/lib:${LD_LIBRARY_PATH} |
$ export LD_LIBRARY_PATH=-I/share/tools/bin/netcdf/4.5.0/gcc/lib:${LD_LIBRARY_PATH} |
||
− | $ export LDFLAGS='-L/share/tools/bin/zlib/1.2.8/gcc/lib -L/share/tools/bin/hdf5/1.10.1/gcc/lib |
+ | $ export LDFLAGS='-L/share/tools/bin/zlib/1.2.11/gcc/lib -L/share/tools/bin/hdf5/1.10.1/gcc/lib |
-L/share/tools/bin/curl/7.57.0/gcc/lib -L/share/tools/bin/netcdf/4.5.0/gcc/lib' |
-L/share/tools/bin/curl/7.57.0/gcc/lib -L/share/tools/bin/netcdf/4.5.0/gcc/lib' |
||
− | $ export CPPFLAGS='-I/share/tools/bin/zlib/1.2.8/gcc/include -I/share/tools/bin/hdf5/1.10.1/gcc/include |
+ | $ export CPPFLAGS='-I/share/tools/bin/zlib/1.2.11/gcc/include -I/share/tools/bin/hdf5/1.10.1/gcc/include |
-I/share/tools/bin/curl/7.57.0/gcc/include -I/share/tools/bin/netcdf/4.5.0/gcc/include' |
-I/share/tools/bin/curl/7.57.0/gcc/include -I/share/tools/bin/netcdf/4.5.0/gcc/include' |
||
$ ./configure --prefix=/share/tools/bin/netcdf/4.5.0/gcc >& run_configure.log |
$ ./configure --prefix=/share/tools/bin/netcdf/4.5.0/gcc >& run_configure.log |
||
+ | $ make >& make.log |
||
+ | $ make check >& make_check.log |
||
+ | $ make install >& make_install.log |
||
+ | </code> |
||
+ | |||
+ | === Jasper === |
||
+ | Jasper requiere librerías de JPEG. Si el make devuelve error de JPEG, instalar lo siguiente (o pedir a soporte que lo instale) |
||
+ | $ aptitude install libjpeg62-turbo-dev |
||
+ | <code> |
||
+ | src: http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.29.tar.gz |
||
+ | $ ./configure --prefix=/share/tools/bin/jasper/1.900.29/gcc CFLAGS=-fPIC |
||
+ | $ make >& make.log |
||
+ | $ make check >& make_check.log |
||
+ | $ make install >& make_install.log |
||
+ | </code> |
||
+ | |||
+ | === Grib === |
||
+ | <code> |
||
+ | src: https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.27.0-Source.tar.gz |
||
+ | $ ./configure --prefix=/share/tools/bin/grib/1.13.1/gcc CFLAGS=-fPIC --with-netcdf=/share/tools/bin/netcdf/4.6.1/gcc --with-jasper=/share/tools/bin/jasper/1.900.29/gcc |
||
$ make >& make.log |
$ make >& make.log |
||
$ make check >& make_check.log |
$ make check >& make_check.log |
||
Línea 97: | Línea 117: | ||
== WRF == |
== WRF == |
||
+ | Folloing the same folder structure, compilation will be at |
||
+ | <pre> |
||
+ | /share/WRF/WRFV3.9.1/gfortran/[type]/WRFV3 |
||
+ | </pre> |
||
+ | |||
+ | In this case there are already two versions: |
||
+ | * <code>[dmpar]</code>: distributed memory only |
||
+ | * <code>[dm+sm]</code>: distributed and shared memory |
||
+ | |||
+ | The procedure is similar as in the intel case (here for <code>dmpar</code>) |
||
+ | Declaring environment variables: |
||
+ | <pre> |
||
+ | $ export NETCDF='/share/tools/bin/netcdf/4.5.0/gcc' |
||
+ | $ export WRFIO_NCD_LARGE_FILE_SUPPORT=1 |
||
+ | </pre> |
||
+ | |||
+ | Decompressing code and renaming |
||
+ | <pre> |
||
+ | $ tar xvfz /share/WRF/WRFV3.9.1.1.TAR.gz |
||
+ | $ mv WRF WRFV3 |
||
+ | $ cd WRFV3 |
||
+ | </pre> |
||
+ | |||
+ | Running <code>configure</code>. There might be an issue with the netcdfs. In order to do not miss the code, just remove writing permits before running configure |
||
+ | <pre> |
||
+ | $ chmod -R -w * |
||
+ | $ configure [choose 34: 32. (serial) 33. (smpar) 34. (dmpar) 35. (dm+sm) GNU (gfortran/gcc)] |
||
+ | $ chmod -R +w * |
||
+ | </pre> |
||
+ | |||
+ | One needs to introduce some modifications in the resultant configure.wrf. It is already done, so have a look |
||
+ | <pre> |
||
+ | $ cp /share/WRF/WRFV3.9.1/gfortran/dmpar/WRFV3/configure.ifort.dmpar.wrf configure.wrf |
||
+ | </pre> |
||
+ | |||
+ | Compile |
||
+ | <pre> |
||
+ | $ compile em_real >& compile.log |
||
+ | </pre> |
||
+ | |||
+ | As usual look for errors, but should be fine |
||
+ | <pre> |
||
+ | $ grep Error compile.log |
||
+ | </pre> |
Última revisión de 04:44 26 jun 2018
Contenido |
[editar] gcc compilation
<hydra> has by default intel C/Fortran compilers. However, <hydra> also has the free gcc compilers.
Here are the instructions followed to compile WRF using the gcc and gfortran compilers. In order to do that, one needs to compile all the required libraries (openmpi, zlib, curl, hdf5 and netcdf) using these compilers. No udunits
was installed due to issues with cmake
[editar] Required libraries
Here the steps starting from a folder where we will download all the sources called
/share/tools/Downloads/
These compilation steps are kept inside the file /share/tools/Downloads/compilation.inf
[editar] openmpi v3.0.0
- getting source
$ wget https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.0.tar.gz
- Decompressing
$ tar xvfz openmpi-3.0.0.tar.gz
- Going there
$ cd openmpi-3.0.0
- Creation of the folder where the libraries will be installed
$ mkdir -p /share/tools/bin/openmpi/3.0.0/gcc
- Configuring the compilation/installation
$ ./configure --prefix=/share/tools/bin/openmpi/3.0.0/gcc >& run_configure.log
- Looking for errors in run_configure.log
grep -i error run_configure.log
If not make chain (ensuring each steps goes fine)
$ make all >& run_make.log $ make test >& run_make_test.log $ make install >& run_make_install.log
For all the others libraries is similar, but paying attention to provide the right installation folder and the right location of the new compiled libraries
[editar] zlib-1.2.11
src: https://zlib.net/zlib-1.2.11.tar.gz $ ./configure --prefix=/share/tools/bin/zlib/1.2.11/gcc >& run_configure.log $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
[editar] hdf5-1.10.1
src: hdf5-1.10.1.tar.bz2 $ export CPP=/usr/bin/cpp $ ./configure --enable-fortran --with-zlib=/share/tools/bin/zlib/1.2.11/gcc \ --prefix=/share/tools/bin/hdf5/1.10.1/gcc >& run_configure.log $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
[editar] libcurl-7.60.0
src: https://curl.haxx.se/download/curl-7.60.0.tar.gz $ ./configure --prefix=/share/tools/bin/curl/7.60.0/gcc >& run_configure.log $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
[editar] netcdf-4.5.0
src: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.5.0.tar.gz $ export LDFLAGS='-L/share/tools/bin/zlib/1.2.11/gcc/lib -L/share/tools/bin/hdf5/1.10.1/gcc/lib -L/share/tools/bin/curl/7.57.0/gcc/lib' $ export CPPFLAGS='-I/share/tools/bin/zlib/1.2.11/gcc/include -I/share/tools/bin/hdf5/1.10.1/gcc/include -I/share/tools/bin/curl/7.57.0/gcc/include' $ ./configure --enable-netcdf-4 --prefix=/share/tools/bin/netcdf/4.5.0/gcc >& run_configure.log $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
- Fortran interface
src: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.4.tar.gz $ export LD_LIBRARY_PATH=-I/share/tools/bin/netcdf/4.5.0/gcc/lib:${LD_LIBRARY_PATH} $ export LDFLAGS='-L/share/tools/bin/zlib/1.2.11/gcc/lib -L/share/tools/bin/hdf5/1.10.1/gcc/lib -L/share/tools/bin/curl/7.57.0/gcc/lib -L/share/tools/bin/netcdf/4.5.0/gcc/lib' $ export CPPFLAGS='-I/share/tools/bin/zlib/1.2.11/gcc/include -I/share/tools/bin/hdf5/1.10.1/gcc/include -I/share/tools/bin/curl/7.57.0/gcc/include -I/share/tools/bin/netcdf/4.5.0/gcc/include' $ ./configure --prefix=/share/tools/bin/netcdf/4.5.0/gcc >& run_configure.log $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
[editar] Jasper
Jasper requiere librerías de JPEG. Si el make devuelve error de JPEG, instalar lo siguiente (o pedir a soporte que lo instale)
$ aptitude install libjpeg62-turbo-dev
src: http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.29.tar.gz $ ./configure --prefix=/share/tools/bin/jasper/1.900.29/gcc CFLAGS=-fPIC $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
[editar] Grib
src: https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.27.0-Source.tar.gz $ ./configure --prefix=/share/tools/bin/grib/1.13.1/gcc CFLAGS=-fPIC --with-netcdf=/share/tools/bin/netcdf/4.6.1/gcc --with-jasper=/share/tools/bin/jasper/1.900.29/gcc $ make >& make.log $ make check >& make_check.log $ make install >& make_install.log
[editar] WRF
Folloing the same folder structure, compilation will be at
/share/WRF/WRFV3.9.1/gfortran/[type]/WRFV3
In this case there are already two versions:
-
[dmpar]
: distributed memory only -
[dm+sm]
: distributed and shared memory
The procedure is similar as in the intel case (here for dmpar
)
Declaring environment variables:
$ export NETCDF='/share/tools/bin/netcdf/4.5.0/gcc' $ export WRFIO_NCD_LARGE_FILE_SUPPORT=1
Decompressing code and renaming
$ tar xvfz /share/WRF/WRFV3.9.1.1.TAR.gz $ mv WRF WRFV3 $ cd WRFV3
Running configure
. There might be an issue with the netcdfs. In order to do not miss the code, just remove writing permits before running configure
$ chmod -R -w * $ configure [choose 34: 32. (serial) 33. (smpar) 34. (dmpar) 35. (dm+sm) GNU (gfortran/gcc)] $ chmod -R +w *
One needs to introduce some modifications in the resultant configure.wrf. It is already done, so have a look
$ cp /share/WRF/WRFV3.9.1/gfortran/dmpar/WRFV3/configure.ifort.dmpar.wrf configure.wrf
Compile
$ compile em_real >& compile.log
As usual look for errors, but should be fine
$ grep Error compile.log