Can't install `esutil` on a Mac Laptop

I’ve been unable to build the latest stack on my Macbook Air Laptop (OS 10.10.5). It repeatedly fails with the following error message.

However, I can build on my desktop Mac Pro (OS 10.10.5). I don’t understand the difference. Can someone give me some pointers about what might be wrong with my laptop set up?

              esutil: 0.5.3+2 ERROR (4 sec).
*** error building product esutil.
*** exit code = 1
*** log is in /Users/wmwv/lsstsw/build/esutil/_build.log
*** last few lines:
:::::  [2016-08-12T19:17:56.515760Z]       ...
:::::  [2016-08-12T19:17:56.515787Z]   "__Py_NotImplementedStruct", referenced from:
:::::  [2016-08-12T19:17:56.515829Z]       SwigPyObject_richcompare(SwigPyObject*, SwigPyObject*, int) in records_wrap.o
:::::  [2016-08-12T19:17:56.515852Z]   "__Py_TrueStruct", referenced from:
:::::  [2016-08-12T19:17:56.515894Z]       SwigPyObject_richcompare(SwigPyObject*, SwigPyObject*, int) in records_wrap.o
:::::  [2016-08-12T19:17:56.515916Z]   "__Py_ZeroStruct", referenced from:
:::::  [2016-08-12T19:17:56.515958Z]       SwigPyObject_richcompare(SwigPyObject*, SwigPyObject*, int) in records_wrap.o
:::::  [2016-08-12T19:17:56.515983Z] ld: symbol(s) not found for architecture i386
:::::  [2016-08-12T19:17:56.516024Z] clang: error: linker command failed with exit code 1 (use -v to see invocation)
:::::  [2016-08-12T19:17:56.516050Z] error: command 'c++' failed with exit status 1

@mwv Is the Xcode different between the two machines? That’s the only thing I could think of.

Some things to try:

  • Make sure you are running the clang compiler on both (and the same version)
  • Look for installed packages that are interfering, such as MacPorts, fink, other installations of Python that is first on your $PATH (e.g. another anaconda or python.org org). For any of those I would disable them. I think homebrew is usually benign, but perhaps even that could interfere, depending on what packages you have installed.

Once you resolve this you might consider sharing one lsstsw between the two computers (if they run the same operating system and you can install lsstsw into the same location on both).

can you cd into the esutil directory and just build it there with your stack python? esutil is standalone and just uses setup.py. (it doesn’t build on python3 at all).

@timj No, I can’t. Thanks for the recommendation to try this. I will focus just on building esutil separately and try to debug.

I believe the new version of esutil does build on python3, but I haven’t tried it and it hasn’t been tagged.

Erin is pretty responsive, so you could make an issue at esheldon/esutil.

The error is that it tries to link in i386 libraries as well as x86_64. I don’t have the former on my laptop.

esutil explicitly (and inexplicably) just requires i386 and x86_64 in its setup.py under Darwin:

if platform.system()=='Darwin':
    extra_compile_args=['-arch','i386','-arch','x86_64']
    extra_link_args=['-arch','i386','-arch','x86_64']
else:
    extra_compile_args=[]
    extra_link_args=[]

@timj Yes, if I just remove the '-arch-,'i386' bits, then I can python setup.py build. How do I fit this into my lsstsw build system?

It seems that your XCode is lacking the 32bit libraries. I’m not entirely sure how. What version of XCode was this?

Version 7.2.1 (7C1002)

I think it’s my Python dylib that was built without i386 support.

Right. It has supported python 3 for 4 days on master…

My miniconda is also just x86_64. I think esutil should add the architectures that were used to build Python. There is no point specifying an architecture that can’t be loaded. It’s pretty easy to check for the specific arch string in distutils.sysconfig to decide whether to add it. Maybe someone should do a pull request on upstream.

For now I hacked around this in my install with the following:

cd ~/lsstsw/build/esutil
[Calm esutil] python setup.py build
[Calm esutil] python setup.py install --user
[Calm esutil] eups declare -r ./ esutil 0.5.3+2
Warning: path /Users/wmwv/lsstsw/build/esutil is absolute, not relative to EUPS_PATH

This doesn’t seem quite right, but I believe should work for now.

I would be happy to look into this, but I may need to get a few more details.

Okay. We can talk about it this week.

Issue filed on esutil