WRF CHEM compilingInARM BeagleBoneBlack
2014-08-23
###WRF CHEM compiling in ARM architecture, Beagle Bone Black###
This is based on http://www2.mmm.ucar.edu/wrf/OnLineTutorial/index.php ####compiler test#### went successful, except in test4 using 64 bit ###libraries### ####Netcdf compiling#### 1. Environment has to be properly setup, following was correct for ARM arch, clarified based on this
export DIR=/media/card/wrf/lib
export CC=gcc
export CXX=g++
export FC=gfortran
export FCFLAGS=-g
export F77=gfortran
export FFLAGS=-g
export CXXFLAGS=-g
Faced error in
make
after configure command of./configure --prefix=$DIR/netcdf --disable-dap \ --disable-netcdf-4 --disable-shared
. The errors are like./libtool: line 1133: g++: command not found
,libtool: link: unsupported hardcode properties
( solved by sudo apt-get install g++-mingw-w64-i686), with blocking in folder CXXar: libnetcdf_c___la-netcdf.o: No such file or directory
(solved by specifying correct environment variables as above). Following packages were also forced to install by errors and for searches while making.sudo apt-get install g++-mingw-w64-i686 sudo apt-get install build-essential sudo apt-get install csh sudo apt-get install gfortran
After making the right environment, the command
make
finished without error and so themake install
, created a folder named netcdf and executables are in the folders. As per the page, environments were again made forexport PATH=$DIR/netcdf/bin:$PATH
andexport NETCDF=$DIR/netcdf
. Then the netcdf compiling test was made usingnc-config --version
andnc-config --prefix
, it given the correct answers.Following the reboot of BBB, all the created environment setup gets removed. It is returning blank line for
echo $DIR
. For instance, compiled the libraries in sd card of the BBB. The sd card is mounted to BBB using the commandsudo mount -t ext4 /dev/mmcblk0p2 /media/card
based on this. Then again all the environment set up is executed only nc-config worked properly, notably command likeexport DIR=/media/card/wrf/lib, export PATH=$DIR/netcdf/bin:$PATH, export NETCDF=$DIR/netcdf
####compiling mpich####Even if the ssh made broken with BBB, the environment set up gets removed. Needed to redo the export command as specified above. Compiled MPICH for parallel cluster execution as per the page .
There is an error saying
mpich type_get_attr.lo is not a valid libtool object
, whilemake
after configuring by executing the command./configure --prefix=$DIR/mpich
.Based on this latest libtool in Debian package was
dpkg -i
installed by removing the older version available with BBB.After this,
make
ended without any error and as well themake install
. An environment is set up for mpich byexport PATH=$DIR/mpich/bin:$PATH
. ####libraries for WPS: zlib,libpng,JasPer####These libraries were installed without any error as per the page
####Library Compatibility Tests#### 1. compatibility test such as Fortran + C + NetCDF and Fortran + C + NetCDF + MPI was carried out and it is executed without any error.
####compiling WRFV3.6####
1. As per the page, the source folder of WRFV3 was unzipped and cd into it and run ./configure
but ends with an empty list of the platform to choose, that way the configure script has to end with abruptly.
2. Based on this work of porting WRF for ARM, found that file configure_new.defaults
in arch folder of the source has to be edited to replace word x8664 with armv7l for gfortran compiler section. Note the word x8664 has to be replaced only along with gfortran. Otherwise, it will be problematic.
3. With this edit the problem of blank platform list was solved and now the ./configure
ends with a warning saying that W A R N I N G There are some Fortran 2003 features in WRF that your compiler does not recognize. Removed signaling call with the name IEEE and that may not be enough
. This was referred in this forum post indicating a minimal error due to compiler version. The current version of gfortran is 4.7 (from here)and BBB is having 4.6.3 version.
4. Downloaded the new version deb file of gfortran for armhf and dpkg on this deb gives rise to an error saying that gcc also an older version of 4.6.3. However, faced the problem in updating the gcc and gfortran, ended with an error saying the update was expired. The error was resolved using this command based on this page. To list installed pages in debian used dpkg-query -l
. After a failed attempt for installing gfortran 4.7 and gcc, it is felt to stick to the wrf compile by neglecting the latter warning as said in this page
5. wrf compile restarted after rectifying the earlier error of no installation of libcloog-ppl while compilation of WRF. In the current attempt, it was followed by the notes of this page for compiling WRF CHEM by adding environment in /etc/bash.bashrc file. This page is a reference of installing libcloog-ppl is used for solving the error.
6. This attempt of compiling wrf also has the problem of errors such as Fatal Error: Can't open module file 'module_configure.mod' for reading at (1): No such file or directory
, this error is continuousness for multiple modules. This common error is referred in this page indicating due to mismatch of compiler versions. An attempt is made with WRFV 3.4.1 and chem code as done for HP laptop also ending with this similar error. The attempt to compile WRF CHEM in BBB is abruptly ending here due to time constraints.
####Conclusion####
It can be concluded that WRF-CHEM most possibly would compile in ARM cores as noted here. The compilers version (gcc, gfrotran, cpp), version of WRF and Debian distribution will be the major bottleneck for that.
Based on 1. http://forums.debian.net/viewtopic.php?f=10&t=2425 2. http://ubuntuforums.org/showthread.php?t=1422476 3. https://github.com/saconswl/Real_time_air_pollution_Mod_Proj-2013-2014/blob/home/working_notes/wn_2014-05/Installing_netcdf_python_in_Ubuntu12.04.md 4. http://ubuntuforums.org/showthread.php?t=1464768 5. http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg10293.html