esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems installing esutil in Mac OS

carlesbadenes opened this issue · comments

I have found a problem installing esutil on a Mac. I run Mac OS 10.13.3. I get failures both using pip and when I try to install the tar file downloaded from gitHub. After some research in StackOverflow, I have found that some python packages can have similar issues when one of their dependencies is outdated, but as far as I know I have all the esutil dependencies up to date. I append the relevant parts of the error message below.

gcc -fno-strict-aliasing -I/Users/badenes/anaconda/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/badenes/anaconda/lib/python2.7/site-packages/numpy/core/include -Iesutil/include -Iesutil/recfile -Iesutil/htm -Iesutil/htm/htm_src -I/Users/badenes/anaconda/include/python2.7 -c esutil/recfile/records.cpp -o build/temp.macosx-10.6-x86_64-2.7/esutil/recfile/records.o -arch i386 -arch x86_64 cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ In file included from /Users/badenes/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816:0, from /Users/badenes/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /Users/badenes/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from esutil/recfile/records.hpp:9, from esutil/recfile/records.cpp:1: /Users/badenes/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] #warning "Using deprecated NumPy API, disable it by " \ ^ /var/tmp//ccMCfGFR.s:62:bad register name `%rbp’
After which follow many similar bad register name warnings, and then

``
/var/tmp//ccMCfGFR.s:36484:Rest of line ignored. 1st junk character valued 64 (@).
error: command 'gcc' failed with exit status 1

Failed building wheel for esutil
``

@erykoff have you had success installing esutil recently on os x?

I haven't had any problems with esutil on os x recently...and I just built it again after a fresh clone, and I note that my build system used clang rather than gcc (though I note that on my system /usr/bin/gcc is a link to clang. Is there any issue with the build tools on @carlesbadenes's system?

Interesting. I wonder why we have both arches listed there.

someone submitted a patch for that a long time ago, to get the code to compile on OS X.

According to git blame, that was 6 years ago and both i386 and x86_64 were added at the same time. I think that 32 bit support on the mac is a bit different now than it was 6 years ago.

Hello,

I have tried to install esutil on my Mac (10.14.2) and the same error message keeps coming up when it starts to build the module,

building 'esutil.recfile._records' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -I/anaconda3/include -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -Iesutil/include -Iesutil/recfile -Iesutil/htm -Iesutil/htm/htm_src -I/anaconda3/include/python3.7m -c esutil/recfile/records.cpp -o build/temp.macosx-10.7-x86_64-3.7/esutil/recfile/records.o -arch i386 -arch x86_64
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the
libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from esutil/recfile/records.cpp:1:
esutil/recfile/records.hpp:2:10: fatal error: 'iostream' file not found

Could someone recommend how to solve this? Thanks

Danny

I don't have a mac, so I can't test this myself. I would be happy to accept a patch to pull request to fix this.

I just had this same issue on a fresh install of Mac OS Mojave 10.14.3

adding '-stdlib=libc++' to extra_compile_args in the setup.py file seems to fix the problem? (the suggested fix from Jo above didn't work for me...)

@jmackereth's solution is correct. I would recommend editing setup.py to change lines 29-30 from:

extra_compile_args=['-arch','i386','-arch','x86_64']
extra_link_args=['-arch','i386','-arch','x86_64']

to

extra_compile_args=['-arch','x86_64', '-stdlib=libc++']
extra_link_args=['-arch','x86_64']

32-bit code has been deprecated since 10.13 (High Sierra) and will be removed entirely in macOS 10.15 (Catalina).

Is this still an issue?

You can do conda install esutil for a precompiled version. If you don't keep conda forge in your channels use conda install -c conda-forge esutil