Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiling X 13ARIMA SEATS from Source for OS X
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 OS-X, using gfortran. It has been tested on Yosemite, but may also work with older versions of OS-X. 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).
Install the latest version of gfortran (5.2) from here.
(If you see the
gfortran.pkg can't be opened because it is from an unidentified developererror, go to
System Preferencesand lower your security settings:
Security & Privacy > General > Allow apps downloaded from: Anywhere.)
(Version 4 from CRAN will not work, you can check your version with
Download the source code package
x13ashtmlsrc_V1.1_B19.tar.gzfrom the Census website.
(If you want to install the non-html version, e.g., for the use in Python's statsmodels, use the
x13assrc_V1.1_B19file and drop the
htmlfrom the filenames below.)
Double-click to unpack the file. You should get a directory named
In the April 2, 2015 version, there are misspellings of filenames. Make sure all filenames are lower case. I had to change
Go to the
makefile.g77in the text editor and remove the
-staticoption in line 291, which otherwise causes an error. Change the line:
$(LINKER) -static -o $@ $(OBJS) $(LDMAP) $(LIBS) $(LDFLAGS)
$(LINKER) -o $@ $(OBJS) $(LDMAP) $(LIBS) $(LDFLAGS)
6. Save the file under the new name: `makefile.gfortran` 7. Open the terminal, and go to the downloaded directory:
8. Compile the code:
make -f makefile.gfortran
9. You may see a few warnings, but that's ok. You can test your compilation in the terminal:
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 Dec 23, 2015 17.53.30
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.
10. 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](http://cran.r-project.org/web/packages/seasonal/vignettes/seas.pdf).