This project is read-only.

use of x13-arima-seats in new Ubuntu (with possible solution)

Feb 4, 2014 at 6:16 PM

problem

the version of x13-arima-seats executable one can download from official website of census (which is also the part of iristoolbox distribution) was compiled using g77 fortran compiler. and it's the reason why it will rarely be working on Ubuntu as the libg2c.so.0 library is not more the part of Ubuntu and even not accessible through its packaging system. this library will be most probably mentioned in the error message you got trying to run x13.

possible solution is to build x13 from the source provided by census. on your own. using gfortran instead of g77. it's not difficult.

below are the steps needed to have x13 correctly compiled

  • install gcc -- gnu compiler collection containing gfortran which has substituted g77
sudo apt-get install gcc
cd /path/to/x13assrc/folder
gedit makefile.g77
  • change 2nd and 3rd lines of the file providing path to gfortran instead of one to g77, then save it and close
FC        = /usr/bin/gfortran
LINKER    = /usr/bin/gfortran
  • to check where gfortran was installed you can use command which
which gfortran
  • now you can compile x13. be sure you're still in the folder with makefile.g77 and execute make
make
  • after compilation is finished you can find new executable in the source folder. it is called x13as
  • now you can rename new executable to x13asunix and copy it to $irisfolder$/+thirdparty/+x12, where $irisfolder$ is path to your iristoolbox
since this solution was tested just once and on one system only it could appear to be poor. so, please, don't hesitate to contact me in case of any problem
Marked as answer by sergeyplotnikov on 2/4/2014 at 10:17 AM
Feb 5, 2014 at 11:37 AM
Thanks, Sergey!!
Feb 11, 2014 at 4:13 PM
Sergey

We actually built the x13 executable for Mac OS X using gfortran (there is no executable for Macs available from Census), but these will not work on other Unix/Linux systems (the dynamic lib mechanism differs on Mac OS X unfortunately).

I don't have any easy access to genuine Unix/Linux. Could someone else compile it, and email to me?

Also, please make sure you use otool -L to check for all possible dependencies, and include the libraries that are not available on Unix/Linux platforms by default.

Thanks.
Feb 11, 2014 at 6:08 PM
Edited Feb 11, 2014 at 6:08 PM
I believe the analogue of otool in gnu/linux is ldd, so below are the results of ldd for my build (ubuntu 13.10 (x64)) of x13as:
linux-vdso.so.1 =>  (0x00007fffcb120000)
libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fa565794000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa565490000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa565279000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa564eb1000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007fa564c75000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa565ace000)
and here are the one compiled by census:
linux-vdso.so.1 =>  (0x00007fff8b225000)
libg2c.so.0 => not found
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff21032c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff210115000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff20fd4d000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff210652000)
So. there're actually 3 types of libraries used:
  • linux internal: ld-linux-x86-64.so.2 and linux-vdso.so.1
  • ones which usually comes with some linux distributive: libc.so.6 and libm.so.6
  • ones which should be installed additionally: libgcc_s.so.1, libgfortran.so.3, libquadmath.so.0 -- all of them are the part of gcc which is better to install using system's package manager (as i showed above) so that it takes care of machine architecture and distribution-specific stuff
it means i would not recommend to include mentioned gcc libraries compiled for some specific linux distributive into Iris distribution.

what i'm not sure now, is whether it's enough to include x13as executable compiled on x64 machine or we should also compile it on some x32 system. will try to check it.

i've just pushed the changeset 0dd0efb257a2 with the executable for linux compiled on my machine
Feb 11, 2014 at 6:30 PM
Ok, great. Many thanks, Sergey.
  1. Matlab is ONLY available for 64-bit Unix/Linux, so there's no need to recompile on a 32-bit.
  2. I will change the backend functions to call the new executable as the new default.
  3. Also, I will include a check in irisstartup to verify that the libraries are present on Unix/Linux systems, and throw a warning if some of them are missing.
By the way, do you happen to know if it's the case on all distributions that /lib is symlinked to /usr/lib?


I'll then ask you again to test everything to make sure it runs all right...

Mirek
Feb 11, 2014 at 6:35 PM
Also, please push your cset also to the codeplex repo. Thanks.
Feb 11, 2014 at 6:45 PM
jaromirbenes wrote:
By the way, do you happen to know if it's the case on all distributions that /lib is symlinked to /usr/lib?
unfortunately i don't know..

jaromirbenes wrote:
I'll then ask you again to test everything to make sure it runs all right...
Also, please push your cset also to the codeplex repo.
no problem