Compiling X 13ARIMA SEATS from Source for OS X

Christoph Sax edited this page Jan 31, 2016 · 15 revisions

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).

  1. 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 developer error, go to System Preferences and 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 gfortran --version.)

  2. Download the source code package x13ashtmlsrc_V1.1_B19.tar.gz from 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_B19 file and drop the html from the filenames below.)

  3. Double-click to unpack the file. You should get a directory named x13ashtmlsrc_V1.1_B19.

  4. In the April 2, 2015 version, there are misspellings of filenames. Make sure all filenames are lower case. I had to change Acf.f to acf.f and ADJREG.f to adjreg.f.

  5. Go to the x13ashtmlsrc_V1.1_B19 directory, open makefile.g77 in the text editor and remove the -static option in line 291, which otherwise causes an error. Change the line:

$(LINKER) -static -o $@ $(OBJS) $(LDMAP) $(LIBS) $(LDFLAGS)

to:

$(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:

cd ~/Downloads/x13ashtmlsrc_V1.1_B19


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:

./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 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).
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.