jeffdaily / parasail-python

Python bindings for the parasail C library.
Other
87 stars 17 forks source link

RuntimeError: Unable to find configure script #18

Closed philres closed 6 years ago

philres commented 6 years ago

Hi Jeff,

thanks again for all your work, parasail is an amazing library! Unfortunately, since yesterday I keep getting RuntimeError: Unable to find configure script when trying to pip install parasail.

I think the problem is that the configure file was deleted from the parasail repository with one of the last commits and the python setup.py is not running autoreconf -fi yet.

I tried changing setup.py to this:

   root = find_file('configure.ac')
    if root is None:
        raise RuntimeError("Unable to find configure script")

    if not os.access(os.path.join(root,'configure'), os.X_OK):
        print("fixing executable bits after unzipping")
        fix_permissions(root)
    else:
        print("parasail archive executable permissions ok")

    if find_file('config.status', root) is None:
        print("configuring parasail in directory {}".format(root))
        # force universal/fat build in OSX via CFLAGS env var
        if platform.system() == "Darwin":
            os.environ['CFLAGS']="-arch x86_64 -arch i386"

        retcode = subprocess.Popen([
            'autoreconf -fi',
            ], shell=True, cwd=root).wait()
        if 0 != retcode:
            raise RuntimeError("autoreconf -fi failed")

        retcode = subprocess.Popen([
            './configure',
            '--enable-shared',
            '--disable-static'
            ], cwd=root).wait()
        if 0 != retcode:
            raise RuntimeError("configure failed")
    else:
        print("parasail already configured in directory {}".format(root))

but then realized that running autoreconf -fi gives me the following error:

root@7926d7138114:/parasail-python/parasail-master/parasail-master# autoreconf -fi
Makefile.am:22: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:22:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:22:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:22:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:22:   its definition is in aclocal's search path.
autoreconf: automake failed with exit status: 1

Would appreciate your help on this. Btw I ran everything on Ubuntu 14.04.5 LTS.

Thanks, Philipp

root@e2dfcc9cdeae:/# pip install parasail 
Collecting parasail
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached parasail-1.1.8.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from parasail)
Building wheels for collected packages: parasail
  Running setup.py bdist_wheel for parasail ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3YdjGU/parasail/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpbMoIdvpip-wheel- --python-tag cp27:
  running bdist_wheel
  parasail/libparasail.so not found, attempting to build
  Downloading latest parasail master
  Unzipping parasail master archive
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 328, in <module>
      install_requires=INSTALL_REQUIRES,
    File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 290, in run
      prepare_shared_lib()
    File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 284, in prepare_shared_lib
      build_parasail(libname)
    File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 170, in build_parasail
      raise RuntimeError("Unable to find configure script")
  RuntimeError: Unable to find configure script

  ----------------------------------------
  Failed building wheel for parasail
  Running setup.py clean for parasail
Failed to build parasail
Installing collected packages: parasail
  Running setup.py install for parasail ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3YdjGU/parasail/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Pakqxb-record/install-record.txt --single-version-externally-managed --compile:
    running install
    parasail/libparasail.so not found, attempting to build
    Archive 'parasail-master.zip' already downloaded
    Archive 'parasail-master.zip' already unzipped to parasail-master
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 328, in <module>
        install_requires=INSTALL_REQUIRES,
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 301, in run
        prepare_shared_lib()
      File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 284, in prepare_shared_lib
        build_parasail(libname)
      File "/tmp/pip-build-3YdjGU/parasail/setup.py", line 170, in build_parasail
        raise RuntimeError("Unable to find configure script")
    RuntimeError: Unable to find configure script

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3YdjGU/parasail/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Pakqxb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-3YdjGU/parasail/
jeffdaily commented 6 years ago

Yep, you caught me between releases. Just yesterday I tagged v2.1 of C parasail. I'm now working on getting the language bindings working again. Soon. I'll let you know.

jeffdaily commented 6 years ago

I think your work-around could work, but perhaps your ubuntu 14 doesn't have libtool installed? I just tried my ubuntu 14 VM from my macbook host and was able to run autoreconf -fi after running apt-get install autoconf libtool. Note that installing autoconf also installed automake.

philres commented 6 years ago

Yes you are right installing libtool did the trick.

Thanks!

jeffdaily commented 6 years ago

Just pushed 6f507d0643970030bbbb3d2980ca1759a183dc73. It updates setup.py to run autoreconf -fi after downloading the latest C parasail archive. If it fails it goes one step further and downloads and installs the autotools from source and tries again. I tested this on my ubuntu 14 VM in a variety of situations:

All of those situations work as expected.