[CIG-SHORT] Summary & tips: Pylith installation from source using installer

Brad Aagaard baagaard at usgs.gov
Fri Jul 8 10:15:20 PDT 2016


Ravi,

In order to be able to replicate your situation, it would be helpful to 
have a little more information. Are you using Ubuntu 14.04 or 14.10? And 
you have installed all updates (sudo apt-get upgrade), correct?

Also please send me the output of "dpkg -l" so I can see what packages 
you have installed.

Responses to specific issues are below.

Brad


On 07/07/2016 03:07 PM, Ravi Kanda wrote:
> Hi Brad, Matt, and Charles,
>
> I finally managed to install pylith-2.1.3-0 from source using the
> installer on both my laptop and workstation (both running Ubuntu 14).
> Along the way I had to make some tweaks to setup.sh & Makefile due to
> two additional dependencies (Cython & PGen). All the unit-tests passed,
> and I was able to get meaningful results from the 2d_gravity-vardensity
> example problem we did in Tutorial 4 of the workshop.
>
> I am not sure whether the above tweaks are specific to my systems or
> might benefit a wider audience - so, I am briefly documenting what I did
> below, and attaching my versions of the configure script, setup.sh and
> Makefile+DIFF.  I do not know if these tweaks are worth propagating
> upstream to autotools input files (Makefile.am &/or configure.ac?) - you
> would be a better judge of that.
>
> A) CONFIGURE OPTIONS (attachment #1):  In the end, I had to enable all
> major dependencies except autotools, git, & cmake (but it turns out the
> last one was installed anyway during petsc build). BTW, I also tried to
> install pylith with --enable-autotools on one of the systems, which
> worked only when I used GNU m4-1.4.17 instead of m4-1.4.16 that the
> installer uses (turns out v.16 has a bug that was fixed in v.17 as per
> link [1] below) - version updated in the Makefile (below).

Enabling all dependencies is the brute force way to get things to work! 
On a Linux installation this should definitely not be necessary. Once 
you send me the Ubuntu and package information, I will try to replicate 
your system and see if I run into problems installing with just the 
required stuff enabled.

> B) SETUP.SH (attachment #2): For some reason, $PYTHON_VERSION (=2.7) is
> not passed on to PYTHONPATH variable in the setup.sh generated by the
> above config script (I see <PREFIX>/lib/python/site-packages, and
> <PREFIX>/lib64/python/site-packages).  So, I had to update the python
> folder with 'python2.7' before sourcing, so the build environment used
> the locally installed python & py-packages. Variable also updated in the
> Makefile (below).

I see why this was failing. I will fix this.

> C) MAKEFILE (attachments #3,4):  H5PY built successfully only when I
> added a new rule for cython (which in turn required setuptools and
> pcgen).  Without cython, I got a "... failed to import Cython ..."
> error.  Cython, in turn needed setuptools installed first (see link [2]
> below), as well as PGen (see [3] below).  So, I added new Makefile rules
> for pgen and cython, and the latter to the h5py rule dependencies.  I
> tried to keep all changes to a single section of the Makefile for
> clarity.  However, also see the attached DIFF of my Makefile version
> w.r.t. the original installer version.

I don't install cython and none of the Python packages PyLith uses 
require it. However, some do appear to attempt to use it when it is 
available. Usually there is a workaround to force the Python packages to 
ignore it. I think this is a better solution than adding additional 
dependencies. I will investigate how to bypass cython in this case.

> If you would like further details, or specific config files, feel free
> to let me know.  Again, thanks much for your help & tips during
> CIG-2016, which eventually helped me figure out the build process.
>
> Regards,
> Ravi.
> ===============
> Relevant links &/fixes:
> ===============
> [1] m4 bug ("... 'gets' undeclared ..." similar to what I got), and the
> fix to a similar problem (upgrade to v-17):
> http://www.linuxquestions.org/questions/slackware-14/m4-need-some-love-4175471638/
>
>
> [2] H5py install distutils error ("... AttributeError: install_layout
> ..."), and the fix to a similar problem (install/upgrade setuptools):
> https://github.com/gotcha/ipdb/issues/60
>
> [3] H5py install pcgen error ("... Unable to find pgen, not compiling
> formal grammar ..."), and was able to fix it by installing PGen python
> package.
> ===============
>



More information about the CIG-SHORT mailing list