Compiling X 13ARIMA SEATS from Source for Ubuntu - christophsax/seasonal GitHub Wiki
Since version 1.2, seasonal relies on the x13binary package to access prebuilt binaries of X-13ARIMA-SEATS. No manual compilation needed anymore!
This is a step-by-step guide on how to compile the HTML version of X-13 for Ubuntu, using gfortran, which is part of the Ubuntu installation. It has been tested on an Ubuntu 14.04.2 LTS server, but should be easily adaptable to other Linux versions. Parts of this post have been borrowed from [askubuntu](http://askubuntu.com/questions/444354/how- do-i-install-x13-arima- seats-for-rstudio-from-source).
-
Download the source code package
x13ashtmlsrc_V1.1_B19.tar.gz
from the Census website.wget http://www.census.gov/ts/x13as/unix/x13ashtmlsrc_V1.1_B19.tar.gz
(If you want to install the non-html version, e.g., for the use in Python's statsmodels, use the
x13assrc_V1.1_B19
file and drop thehtml
from the filenames below.) -
Unpack the file to a new directory. Then, go there:
mkdir myx13 tar zxvf x13ashtmlsrc_V1.1_B19.tar.gz -C myx13 cd myx13
-
In the April 2, 2015 version, there are misspellings of filenames. Make sure all filenames are lower case. I had to change
Acf.f
toacf.f
andADJREG.f
toadjreg.f
.mv Acf.f acf.f mv ADJREG.f adjreg.f
In the newer source file
x13ashtmlsrc_V1.1_B19.tar.gz
, these already existed as lowercase-named files sorm Acf.f ADJREG.f
also worked.
-
Compile the code:
make -f makefile.g77
While the filename ends in
g77
, it does invoke thegfortran
compiler. -
You can test your compilation:
./x13ashtml
If everything went fine, you should get the following error that proves the working of your binary file:
X-13ARIMA-SEATS Seasonal Adjustment Program Version Number 1.1 Build 19 Execution began Jul 17, 2015 07.28.47 ERROR: Must specify either an input specification file name (-i infile or infile) or an input metafile name (-m metafile). See Section 2 of the X-13ARIMA-SEATS Reference Manual for more information on how to run X-13ARIMA-SEATS.
-
You can move the newly created
x13ashtml
binary file to anywhere you want and configure it for the use in seasonal as described in the vignette.