natelust/least_asymmetry

Installing on Linux Server

Closed this issue · 5 comments

When installing the code (master or devel) on a linux server -- with either python2 and python3:

uname -a ==> Linux server.name.edu 4.5.7-202.fc23.x86_64 #1 SMP Tue Jun 28 18:22:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

If I run python setup.py install, then I get the following output + error:

running install
running build
running build_ext
building 'make_asym' extension
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -I/home/jdfraine/anaconda3/include/python3.5m -c make_asym.cc -o build/temp.linux-x86_64-3.5/make_asym.o -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7
gcc: error: unrecognized command line option ‘-stdlib=libc++’
gcc: error: unrecognized command line option ‘-mmacosx-version-min=10.7’
error: command 'gcc' failed with exit status 1

The cause seems to be in the setup.py file where you list the cpp_args as

cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']

and Linux has no idea what "-mmacosx-version-min=10.7" means. It apparently also does not know what "-stdlib=libc++" means.

If I take out both of those, then the cpp_args looks like this
cpp_args = ['-std=c++11']

and python setup.py install


  1. Am I missing something about my particular linux setup or should we indeed delete these cpp_args entries?

  2. Also, is this PR worthy?

I would like to amend my issue. It's worse than previously stated.

I was able to get least_asymmetry to install on 1 of 3 linux servers using cpp_args = ['-std=c++11']; but, when using even the simplest example -- from LA's github main page -- python (v2 and v3) crashes with final error: Aborted (core dumped)

I suspect that this has to do with version mismatching; it's possibly because I dropped '-stdlib=libc++' from the cpp_args

I too have discovered this issue on a particular linux setup. I think I have a more robust build system to introduce, which hopefully will solve the issue. Dealing with compilers on many different systems is such a pain! Look for the changes sometime this week.

I using os.environ to swapped the compiler from gcc to clang++ or clang

Below line 5 in setup.py, (from distutils.core ....) I added the lines:

import os
os.environ["CC"] = "clang"
os.environ["CXX"] = "clang++"

I also used clang and clang++ for both CC and CXX above.

Either way, I get the error:

least_asymmetry/include/pybind11/common.h:74:10: fatal error: 'forward_list' file not found

This flags an error because of line 74 in the file common.h mentioned in the error.

Pleas check if the devel branch builds for you on linux now, just using the setup.py, with whatever default compilers it finds (gcc)

So far so good. I am using 3 servers with 3 versions of gcc. As was expected, the 1 server that has gcc > 4.7 and includes libc++11 natively does work well.

I think that the problem is solved and will close this now. But I'm going to spell everything out below in case a future user / developer runs into these issues.

Server 1 (install failed): gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)
Server 2 (install failed): gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Server 3 (install success!): gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)