Errors when building Pylith on cluster

Hi all,

I want to run Pylith in parallel on a cluster (Argon cluster, University of Iowa, Argon Cluster - HPC Documentation - UIowa Wiki), but I am having trouble building Pylith from the source.

I followed the instruction from the INSTALL file for “Cluster”, and here is the module I loaded:

module load openmpi/2.1.2_gcc-8.3.0

After running:

$HOME/src/pylith-installer-2.2.2-0/configure --enable-python --with-make-threads=2 --prefix=$HOME/pylith

I got the following errors:

Examining test results for existing versions of software...

WARNING: Existing version of HDF5 installed. Found /usr/bin/h5dump

WARNING: Existing version of NetCDF installed. Found /usr/bin/ncdump

configure: error: "Configure failed due to conflict with existing software. Existing software may interfere with proper installation of PyLith, may be configured incorrectly for use with PyLith, or may have been built with incompatible compilers. Remove existing software (RECOMMENDED) or reconfigure with --enable-force-install to override error message. "

So I tried adding “--enable-force-install” and successfully pass the Step 2 (Run configure).

After setting up the environment I run “make” but ended up having the following error:

h5py/_conv.pyx:867:57: Cannot convert '<error>' to Python object
Traceback (most recent call last):
  File "setup.py", line 168, in <module>
    cmdclass = CMDCLASS,
  File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 129, in setup
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/gcheng6/build/pylith/h5py-2.9.0/setup_build.py", line 203, in run
    force=config.rebuild_required or self.force)
  File "/Users/gcheng6/build/pylith/h5py-2.9.0/.eggs/Cython-3.0a6-py2.7.egg/Cython/Build/Dependencies.py", line 1110, in cythonize
    cythonize_one(*args)
  File "/Users/gcheng6/build/pylith/h5py-2.9.0/.eggs/Cython-3.0a6-py2.7.egg/Cython/Build/Dependencies.py", line 1277, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: /Users/gcheng6/build/pylith/h5py-2.9.0/h5py/_conv.pyx
make[2]: *** [h5py] Error 1
make[2]: Leaving directory `/Users/gcheng6/build/pylith'
make[1]: *** [installed_h5py] Error 2
make[1]: Leaving directory `/Users/gcheng6/build/pylith'
make: *** [installed_pylith] Error 2

Then I tried to load the hdf5 and netcdf modules that are compatible with the mpi:

module load hdf5/1.8.18_openmpi-2.1.2_parallel_studio-2017.4
module load parallel-netcdf/1.8.1_openmpi-2.1.2_parallel_studio-2017.4

And ran:

$HOME/src/pylith-installer-2.2.2-0/configure --enable-python --with-make-threads=2 --disable-hdf5 --disable-netcdf --prefix=$HOME/pylith

However, I still ran into an error:

configure: error: netcdf C++ header not found; try CPPFLAGS="-I<netcdf include dir>"

Any help is greatly appreciated!

Thanks,
Guo

Loading the modules for HDF5 and netCDF only sets environment variables like PATH, and LD_LIBRARY_PATH. You still need to tell configure WHERE to find the header files and libraries. Pass CPPFLAGS="-I${HDF5_INCDIR} -I${NETCDF_INCDIR}" and LDFLAGS="-L${HDF5_LIBDIR} -L${NETCDF_LIBDIR}" as arguments to configure, where ${HDF5_INCDIR} is the absolute path to the HDF5 include directory and ${NETCDF_INCDIR} is the absolute path to the netCDF include directory, etc. You don’t need to do this for MPI if you set the CC environment variable to the MPI C compiler wrapper (usually mpicc) and the CXX environment variable to the MPI C++ compiler wrapper (usually mpicxx).

For example,

configure YOUR_OTHER_CONFIGURE_ARGUMENTS --prefix=$HOME/pylith CPPFLAGS="-I/opt/hdf5/include -I/opt/netcdf/include" LDFLAGS="-L/opt/hdf5/lib -L/opt/netcdf/lib" CC=mpicc CXX=mpicxx

Hi Brad,

I have contacted the cluster support team and obtained the path of the include and library directories of HDF5 and NETCDF. Below is an shell script I have created:

#!/bin/bash
 
module load openmpi/2.1.2_parallel_studio-2017.4
module load hdf5/1.8.18_parallel_studio-2017.4
module load netcdf/4.4.1.1_parallel_studio-2017.4
 
export HDF5_INCDIR="${ROOT_HDF5}/include"
export HDF5_LIBDIR="${ROOT_HDF5}/lib"
export NETCDF_INCDIR="${ROOT_NETCDF}/include"
export NETCDF_LIBDIR="${ROOT_NETCDF}/lib"
 
echo ${ROOT_HDF5}
echo ${ROOT_NETCDF}
 
$HOME/src/pylith-installer-2.2.2-0/configure --enable-python --with-make-threads=2 --disable-hdf5 --disable-netcdf --prefix=$HOME/pylith CC="$(which mpicc)" CXX="$(which mpicxx)"

However, after executing the script (. runConfig.sh), I kept getting the same error message:

---------------- omitted messages ----------------
checking hdf5.h presence... yes
checking for hdf5.h... yes
checking for H5Fopen in -lhdf5... yes
checking for library containing H5Pset_dxpl_mpio... no
configure: WARNING: parallel HDF5 library not found; DO NOT attempt to use HDF5 in parallel OR configure HDF5 with '--enable-parallel'
checking netcdfcpp.h usability... no
checking netcdfcpp.h presence... no
checking for netcdfcpp.h... no
configure: error: netcdf C++ header not found; try CPPFLAGS="-I<netcdf include dir>"

I have also tried adding the CPPFLAGS and LDFLAGS to the configure:

$HOME/src/pylith-installer-2.2.2-0/configure --enable-python --with-make-threads=2 --disable-hdf5 --disable-netcdf --prefix=$HOME/pylith CPPFLAGS="-I${HDF5_INCDIR} -I${NETCDF_INCDIR}" LDFLAGS="-L${HDF5_LIBDIR} -L${NETCDF_LIBDIR}" CC="$(which mpicc)" CXX="$(which mpicxx)"

but it yielded the same results.

Thanks,
Guo

It looks like configure is finding HDF5 but it is not built for parallel I/O. This is unusual for a cluster. I recommend contacting cluster support and asking which HDF5 module to use to load one configured for parallel I/O.

Note: The HDF5, netCDF, and OpenMPI versions you are trying to use are several years old. You should also inquire whether more up to date versions are available.

To diagnose configure errors, you should be looking in config.log to see exactly what commands failed and what the error messages are. You may need to supply those to the cluster support staff to diagnose the problem.

Hi Brad,

The support staff recommend doing the following:

module purge

module load stack/2020.2-base_arch

module load openmpi/3.1.6_gcc-5.4.0

module load hdf5/1.10.6_gcc-5.4.0

module load netcdf-cxx/4.2_gcc-5.4.0

After running

$HOME/src/pylith-installer-2.2.2-0/configure --enable-python --with-make-threads=2 --disable-hdf5 --disable-netcdf --prefix=$HOME/pylith CPPFLAGS="-I${HDF5_INCDIR} -I${NETCDF_INCDIR}" LDFLAGS="-L${HDF5_LIBDIR} -L${NETCDF_LIBDIR}" CC="$(which mpicc)" CXX="$(which mpicxx)"

I successfully passed the Step 2.

However, after source setup.sh the building process failed at make with the following error:

make[4]: Entering directory `/Users/gcheng6/build/pylith/python-build'

/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -c -fno-strict-aliasing -fp-model strict -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I../Python-2.7.15/Include -I/Users/gcheng6/pylith/include -I/Users/gcheng6/pylith/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/include -fPIC -DPy_BUILD_CORE -o Modules/python.o ../Python-2.7.15/Modules/python.c

/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -c -fno-strict-aliasing -fp-model strict -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I../Python-2.7.15/Include -I/Users/gcheng6/pylith/include -I/Users/gcheng6/pylith/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/include -fPIC -DPy_BUILD_CORE -o Parser/acceler.o ../Python-2.7.15/Parser/acceler.c

gcc: error: strict: No such file or directory

gcc: error: strict: No such file or directory

gcc: error: unrecognized command line option '-fp-model'

gcc: error: unrecognized command line option '-fp-model'

make[4]: *** [Parser/acceler.o] Error 1

make[4]: *** Waiting for unfinished jobs....

make[4]: *** [Modules/python.o] Error 1

make[4]: Leaving directory `/Users/gcheng6/build/pylith/python-build'

make[3]: *** [python] Error 2

make[3]: Leaving directory `/Users/gcheng6/build/pylith'

make[2]: *** [installed_python] Error 2

make[2]: Leaving directory `/Users/gcheng6/build/pylith'

make[1]: *** [installed_swig] Error 2

make[1]: Leaving directory `/Users/gcheng6/build/pylith'

make: *** [installed_pylith] Error 2

It seems that the mpi isn’t recognizing the -fp-model command?

Guo

-fp-model looks to be coming from your old configure when you used the Intel compiler. Because you changed the compilers, you need to make sure you remove all of the previous build.

Remove everything in the old build directory as well as where it was installed. Then run configure again with the new settings.

Hi Brad,

I have removed everything, including $HOME/build, $HOME/pylith, and $HOME/src, and re-download the installer. But I am still getting the same error:
If you want a release build with all optimizations active (LTO, PGO, etc),

please run ./configure --enable-optimizations

make[4]: Entering directory `/Users/gcheng6/build/pylith/python-build'

/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -c -fno-strict-aliasing -fp-model strict -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I../Python-2.7.15/Include -I/Users/gcheng6/pylith/include -I/Users/gcheng6/pylith/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/include -fPIC -DPy_BUILD_CORE -o Modules/python.o ../Python-2.7.15/Modules/python.c

/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -c -fno-strict-aliasing -fp-model strict -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I../Python-2.7.15/Include -I/Users/gcheng6/pylith/include -I/Users/gcheng6/pylith/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/include -fPIC -DPy_BUILD_CORE -o Parser/acceler.o ../Python-2.7.15/Parser/acceler.c

gcc: error: strict: No such file or directory

gcc: error: strict: No such file or directory

gcc: error: unrecognized command line option '-fp-model'

gcc: error: unrecognized command line option '-fp-model'

make[4]: *** [Modules/python.o] Error 1

make[4]: *** Waiting for unfinished jobs....

make[4]: *** [Parser/acceler.o] Error 1

make[4]: Leaving directory `/Users/gcheng6/build/pylith/python-build'

make[3]: *** [python] Error 2

make[3]: Leaving directory `/Users/gcheng6/build/pylith'

make[2]: *** [installed_python] Error 2

make[2]: Leaving directory `/Users/gcheng6/build/pylith'

make[1]: *** [installed_swig] Error 2

make[1]: Leaving directory `/Users/gcheng6/build/pylith'

make: *** [installed_pylith] Error 2

Thanks,
Guo

Please post the config.log from the Pylith Installer configure (should be in the top-level build directory) as well as the config.log from the Python configure (should be in the python-build directory).

This looks like a problem related to an inconsistent environment, which is very difficult to debug remotely or reproduce.

Hi Brad,

Attached are the config.log files from $HOME/build/pylith/ (config-01.log) and $HOME/build/pylith/python-build (config-02.log), respectively.

Thanks,
Guo

config-01.log (61.8 KB) config-02.log (708.2 KB)

The only thing that I see that may be causing problems is that you have several other things in your path that could potentially cause conflicts. The most likely culprit is miniconda. I would remove all of these from your PATH and see if it resolves the issue. Also, capture all of the make output to make.log (for example, make >& make.log) and post a compressed version of that file if you still encounter problems.

PATH: /Users/gcheng6/Software/miniconda3/bin
PATH: /Users/gcheng6/Software/miniconda3/condabin
PATH: /usr/lib64/qt-3.3/bin
PATH: /usr/local/bin
PATH: /opt/puppetlabs/bin
PATH: /Users/gcheng6/tools/MintPy/mintpy
PATH: /Users/gcheng6/.local/bin
PATH: /Users/gcheng6/bin

Hi Brad,

I’ve removed the things you listed above in my PATH and now my PATH looks like this:

/opt/sge/bin:/opt/sge/bin/lx-amd64:/opt/sge/bin:/opt/sge/bin/lx-amd64:/usr/bin:/usr/local/sbin:/usr/sbin

After removing everything in the bulid and installation directories I reran the configure again.

However, the same error occurred.

I have attached the make.log, as well as the config.log files from $HOME/build/pylith/ (config-01.log) and $HOME/build/pylith/python-build (config-02.log)

config1.log (61.6 KB) config2.log (707.9 KB) make.log (157.1 KB)

I’m sorry that this isn’t going anywhere.

Thanks,

Guo

I think I finally found the problem.

The Python configure script contains the lines

# ICC needs -fp-model strict or floats behave badly
case "$CC" in
*icc*)
    BASECFLAGS="$BASECFLAGS -fp-model strict"
    ;;
esac

This test is intended to detect Intel compilers, but mpicc matches *icc*, so it adds this flag intended for Intel compilers. The easiest workaround is to manually remove these lines from the Python configure script or change *icc* to something like *zzzicc* so that the match fails.

Here is the procedure to get this to work:

  1. You can pick up from where you are now.
  2. Edit configure in Python-2.7.15 as described above.
  3. Go to the python-build directory and run make and then make install.
  4. At the top-level installer build directory (the directory containing python-build) run touch installed_python.
  5. Continue with the installer by running make in the top-level installer directory.

Digging deeper into the PyLith installer configuration. You should be able to simply configure the installer with CC and CXX pointing to gcc-5.4.0 (not the MPI compilers) on the command line. As long as the correct mpicc and mpicxx are in the current path, it will automatically find them and use them when building tools that need MPI. It will use the compiler from CC for building Python.

Doh! That’s the kind of bug that you can stare at for hours without really
getting what the issue might be!

Hi Brad,

Thanks for the suggestions! I have followed the above steps and bypassed the intel compiler issue. However, the build failed after running make in the top-level installer directory (step4, see make3.log (48.3 KB) for detailed output):

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Users/gcheng6/pylith/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "setup.py", line 394, in <module>
    setup_package()
  File "setup.py", line 386, in setup_package
    setup(**metadata)
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/core.py", line 135, in setup
    config = configuration()
  File "setup.py", line 166, in configuration
    config.add_subpackage('numpy')
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/misc_util.py", line 1024, in add_subpackage
    caller_level = 2)
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/misc_util.py", line 993, in get_subpackage
    caller_level = caller_level + 1)
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/misc_util.py", line 930, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "numpy/setup.py", line 10, in configuration
    config.add_subpackage('core')
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/misc_util.py", line 1024, in add_subpackage
    caller_level = 2)
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/misc_util.py", line 993, in get_subpackage
    caller_level = caller_level + 1)
  File "/Users/gcheng6/build/pylith/numpy-1.14.3/numpy/distutils/misc_util.py", line 930, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "numpy/core/setup.py", line 400, in configuration
    check_api_version(C_API_VERSION, codegen_dir)
  File "numpy/core/setup_common.py", line 83, in check_api_version
    curapi_hash, api_hash = get_api_versions(apiversion, codegen_dir)
  File "numpy/core/setup_common.py", line 74, in get_api_versions
    curapi_hash = m.fullapi_hash(numpy_api.full_api)
  File "numpy/core/code_generators/genapi.py", line 482, in fullapi_hash
    return hashlib.md5(''.join(a).encode('ascii')).hexdigest()
AttributeError: 'module' object has no attribute 'md5'

Prior to this, when I was running make and make install in the python-build directory (step3), there are several output showing errors as well:

Error output after make in the python-build directory (make1.log (196.3 KB) for details):

----------------- omitted -----------------
building '_bsddb' extension
/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include -I. -I../Python-2.7.15/Include -I/Users/gcheng6/pylith/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/include -I/usr/local/include -I/Users/gcheng6/build/pylith/Python-2.7.15/Include -I/Users/gcheng6/build/pylith/python-build -c /Users/gcheng6/build/pylith/Python-2.7.15/Modules/_bsddb.c -o build/temp.linux-x86_64-2.7/Users/gcheng6/build/pylith/Python-2.7.15/Modules/_bsddb.o
/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -shared -L/Users/gcheng6/pylith/lib -L/Users/gcheng6/pylith/lib64 -L/Users/gcheng6/pylith/lib -L/Users/gcheng6/pylith/lib64 -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/lib -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/lib build/temp.linux-x86_64-2.7/Users/gcheng6/build/pylith/Python-2.7.15/Modules/_bsddb.o -L/usr/lib64 -L/Users/gcheng6/pylith/lib -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/lib -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/lib -L/usr/local/lib -L. -R/usr/lib64 -ldb-5.3 -lpython2.7 -o build/lib.linux-x86_64-2.7/_bsddb.so
gcc: error: unrecognized command line option '-R'
----------------- omitted -----------------

And error output after make install in the python-build directory (make2.log (446.3 KB) for details):

----------------- omitted -----------------
building '_bsddb' extension
/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I. -I../Python-2.7.15/Include -I/Users/gcheng6/pylith/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/include -I/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/include -I/usr/local/include -I/Users/gcheng6/build/pylith/Python-2.7.15/Include -I/Users/gcheng6/build/pylith/python-build -c /Users/gcheng6/build/pylith/Python-2.7.15/Modules/_bsddb.c -o build/temp.linux-x86_64-2.7/Users/gcheng6/build/pylith/Python-2.7.15/Modules/_bsddb.o
/usr/share/apps/2020.2/base_arch/gcc-5.4.0/openmpi-3.1.6/bin/mpicc -shared -L/Users/gcheng6/pylith/lib -L/Users/gcheng6/pylith/lib64 -L/Users/gcheng6/pylith/lib -L/Users/gcheng6/pylith/lib64 -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/lib -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/lib build/temp.linux-x86_64-2.7/Users/gcheng6/build/pylith/Python-2.7.15/Modules/_bsddb.o -L/usr/lib64 -L/Users/gcheng6/pylith/lib -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/hdf5-1.10.6/lib -L/usr/share/apps/2020.2/base_arch/gcc-5.4.0/netcdf-cxx-4.2/lib -L/usr/local/lib -L. -R/usr/lib64 -ldb-5.3 -lpython2.7 -o build/lib.linux-x86_64-2.7/_bsddb.so
gcc: error: unrecognized command line option '-R'
----------------- omitted -----------------

I wonder if these errors lead to the failed building?

Thanks in advance!
Guo

The Python configure is not finding an OpenSSL library. You can either enable building openssl with the PyLith installer or load the correct modules to get OpenSSL. I would expect your cluster to have OpenSSL installed. If you do you should verify that is also has the headers.

Note: What version is the system Python? Was it built with the same compiler? If it is Python 2.7 built with gcc-5.4, you should not need to build Python. You should be able to just run python in a terminal to find out.

Hi Brad,

I exported the PATH to the include and lib directories of OpenSSL:

export OPENSSL_INCDIR="${ROOT_OPENSSL}/include"
export OPENSSL_LIBDIR="${ROOT_OPENSSL}/lib"

And then re-configure with:

$HOME/src/pylith/pylith-installer-2.2.2-0/configure --enable-python --with-make-threads=2 --disable-hdf5 --disable-netcdf --disable-openssl --prefix=$HOME/pylith CPPFLAGS="-I${HDF5_INCDIR} -I${NETCDF_INCDIR} -I${OPENSSL_INCDIR}" LDFLAGS="-L${HDF5_LIBDIR} -L${NETCDF_LIBDIR} -L${OPENSSL_LIBDIR}" CC="$(which mpicc)" CXX="$(which mpicxx)"

After repeating the previous steps (step1-5), this time the make (make.log (759.9 KB) ) returns a new error:

h5py/_conv.pyx:867:57: Cannot convert '<error>' to Python object
Traceback (most recent call last):
  File "setup.py", line 168, in <module>
    cmdclass = CMDCLASS,
  File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 129, in setup
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Users/gcheng6/pylith/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/gcheng6/build/pylith/h5py-2.9.0/setup_build.py", line 203, in run
    force=config.rebuild_required or self.force)
  File "/Users/gcheng6/build/pylith/h5py-2.9.0/.eggs/Cython-3.0a6-py2.7.egg/Cython/Build/Dependencies.py", line 1110, in cythonize
    cythonize_one(*args)
  File "/Users/gcheng6/build/pylith/h5py-2.9.0/.eggs/Cython-3.0a6-py2.7.egg/Cython/Build/Dependencies.py", line 1277, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: /Users/gcheng6/build/pylith/h5py-2.9.0/h5py/_conv.pyx
make[2]: *** [h5py] Error 1
make[2]: Leaving directory `/Users/gcheng6/build/pylith'
make[1]: *** [installed_h5py] Error 2
make[1]: Leaving directory `/Users/gcheng6/build/pylith'
make: *** [installed_pylith] Error 2

Without source setup.sh, running python in a terminal returns:

Python 2.7.5 (default, Apr  2 2020, 13:16:51) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

After source setup.sh, python returns:

Python 2.7.15 (default, Apr  6 2021, 13:33:59) 
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

ls /usr/share/apps/2020.2/base_arch/gcc-5.4.0/ shows that the only python in this directory is python-3.8.5

Thanks,
Guo

Important: Before worrying about the h5py error, I strongly recommend that you correct the configure arguments. I don’t know how the installer is able to build Python with your configure arguments. You should not use CC=$(which mpicc) CXX=$(which mpicxx). See my earlier note about the Python configure issue when using these settings. ``CCandCXXshould be set to the correspondinggccandg++. If these are already set to CCandCXX` in the environment, then just drop them from the configure arguments.

I get the same h5py errors when building on my Mac using the installer v2.2.2-0. This is odd because I built the v2.2.2 MacOS binary on this same machine using this version of h5py. My guess is that cython may be the problem. I will have to dig deeper which may take me a few days.

Hi Brad,

Do you mean I should use CC=gcc CXX=g++ as my configure arguments?

If I run which gcc and which g++ with all the modules loaded, it show that they are in the /usr/bin/ directory (not /usr/share/apps/2020.2/base_arch/gcc-5.4.0).

Also, if I do gcc --version, and g++ --version it shows:
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
and
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
respectively.

Is this okay if they are not in version 5.4.0?

Thanks,
Guo

You need to use a consistent compiler suite across MPI, Python, and everything else. Based on the path of the MPI module you are loading, it looks like it was built with gcc-5.4.0. If that is indeed the case, then it means you need to use gcc/g++ from gcc-5.4.0 for everything else. I would ask your system administrators what compiler was used to build the MPI you are using and how to make sure it is in your path. You might have to do something like CC=gcc-5.4.0 CXX=g++-5.4.0, but I am only guessing.