[Networkit] problem installing networkit on mac

Maximilian Vogel maximilian.vogel at student.kit.edu
Fri Dec 4 09:30:37 CET 2015


Hi,

so just to explain how setup.py tries to find a suitable compiler[0]:
1. Read build.conf. Can't be present in this case because it's an 
installation via pip.
2. Check the $CXX environment variable. If it is set and also an element 
of a predefined compiler list, move it to the front there.
3. Iterate through the list of compiler candidates and use the first 
one, that passes the test compilation successfully.

So I guess the following happened: Your $CXX environment variable isn't 
set and as Christian pointed out, gcc/g++ is aliased to clang. So the 
the test compilation doesn't work for "g++", "g++-5.2" and so on until 
"g++-4.9" and this version is used for the compilation of networkit. It 
works as the C++-core of networkit is fully compiled. The compilation of 
the python extension is, what ultimately fails during linking, probably 
because "g++-4.9" isn't properly installed.

On 03.12.2015 22:25, Christian Staudt wrote:
> I don’t think so, this error message comes from g++-4.9 now. It looks 
> like something is wrong with your compiler/system configuration:
>
> ld: library not found for -lgcc_s.10.5
>
> I suggest you move this to StackOverflow and get quicker help on your 
> system config.
Or any other suitable place for issues with system configurations.
If you are sure, that g++-4.8 is installed properly, try
CXX=g++-4.8 pip install networkit
on your command line.

> I’m not sure it is a NetworKit problem. What we could do is show a 
> clear error message if someone tries to compile with clang. Max?
The Dev branch currently compiles fine with clang-3.7 so with future 
releases, it is okay to have just clang as long as it's >= 3.7. We could 
show an error message about an insufficient compiler in general, however 
in this case it's a bit more complicated as the test compilation 
suggests g++-4.9 to work.

[0]: 
https://algohub.iti.kit.edu/parco/NetworKit/NetworKit/files/d583d057c71d083ec05397c4e1227f796d56e7c9/setup.py#L74

Best,
Max


>
> Chris
>
> On 03 Dec 2015, at 14:56, Kayhan Batmanghelich 
> <batmanghelich at gmail.com <mailto:batmanghelich at gmail.com>> wrote:
>
>> Hi Chris,
>>
>> I installed the gcc using homebrew. How can I force pip to use gcc 
>> instead of clang? I tried to install networkit after installing gcc 
>> and I still get the same error. I guess pip still uses the clang:
>>
>> |/usr/local/Cellar/gcc48/4.8.4/bin/g++-4.8 --version g++-4.8 (Homebrew 
>> gcc48 4.8.4 --with-fortran) 4.8.4 Copyright (C) 2013 Free Software 
>> Foundation, Inc. This is free software; see the source for copying 
>> conditions. There is NO warranty; not even for MERCHANTABILITY or 
>> FITNESS FOR A PARTICULAR PURPOSE. 
>> py3k)kayhan·kayhans-mbp·12/03,15:53:15·~ $ pip install networkit 
>> Collecting networkit [....] networkit/_NetworKit.cpp: At global 
>> scope: networkit/_NetworKit.cpp:30388:18: warning: 'PyObject* 
>> __pyx_pw_10_NetworKit_9Partition_5__getitem__(PyObject*, PyObject*)' 
>> defined but not used [-Wunused-function] static PyObject 
>> *__pyx_pw_10_NetworKit_9Partition_5__getitem__(PyObject 
>> *__pyx_v_self, PyObject *__pyx_arg_e) { ^ g++-4.9 -bundle -undefined 
>> dynamic_lookup -L/Users/kayhan/anaconda/envs/py3k/lib -arch x86_64 
>> build/temp.macosx-10.5-x86_64-3.3/networkit/_NetworKit.o -L./ 
>> -L/Users/kayhan/anaconda/envs/py3k/lib -lNetworKit-Core-Opt -o 
>> build/lib.macosx-10.5-x86_64-3.3/_NetworKit.so -fopenmp -std=c++14 
>> ld: library not found for -lgcc_s.10.5 collect2: error: ld returned 1 
>> exit status error: command 'g++-4.9' failed with exit status 1 
>> ---------------------------------------- Command 
>> "/Users/kayhan/anaconda/envs/py3k/bin/python3 -c "import setuptools, 
>> tokenize;__file__='/private/var/folders/kh/s846jbks2539yqq9g1fs3fqr0000gn/T/pip-build-5n54kt/networkit/setup.py';exec(compile(getattr(tokenize, 
>> 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 
>> 'exec'))" install --record 
>> /var/folders/kh/s846jbks2539yqq9g1fs3fqr0000gn/T/pip-6rk6oj-record/install-record.txt 
>> --single-version-externally-managed --compile" failed with error code 
>> 1 in 
>> /private/var/folders/kh/s846jbks2539yqq9g1fs3fqr0000gn/T/pip-build-5n54kt/networkit 
>> |
>>>>
>> On Thu, Dec 3, 2015 at 2:35 PM, Christian Staudt 
>> <christian.staudt at kit.edu <mailto:christian.staudt at kit.edu>> wrote:
>>
>>
>>     On 03 Dec 2015, at 13:30, Kayhan Batmanghelich
>>     <batmanghelich at gmail.com <mailto:batmanghelich at gmail.com>> wrote:
>>
>>>     MacOX 10.10.5
>>>     gcc veriosn
>>>
>>>     |$ gcc --version Configured with:
>>>     --prefix=/Applications/Xcode.app/Contents/Developer/usr
>>>     --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version
>>>     6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target:
>>>     x86_64-apple-darwin14.5.0 Thread model: posix|
>>
>>
>>     This is not GCC, this is clang, aliased to gcc.
>>
>>     If you don’t have GCC yet, try installing it with homebrew:
>>     https://apple.stackexchange.com/questions/38222/how-do-i-install-gcc-via-homebrew
>>
>>
>>     Chris
>>
>>     _______________________________________________
>>     NetworKit mailing list
>>     NetworKit at ira.uni-karlsruhe.de
>>     <mailto:NetworKit at ira.uni-karlsruhe.de>
>>     https://lists.ira.uni-karlsruhe.de/mailman/listinfo/networkit
>>
>>
>> _______________________________________________
>> NetworKit mailing list
>> NetworKit at ira.uni-karlsruhe.de <mailto:NetworKit at ira.uni-karlsruhe.de>
>> https://lists.ira.uni-karlsruhe.de/mailman/listinfo/networkit
>
>
>
> _______________________________________________
> NetworKit mailing list
> NetworKit at ira.uni-karlsruhe.de
> https://lists.ira.uni-karlsruhe.de/mailman/listinfo/networkit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20151204/65f2de28/attachment.html>


More information about the NetworKit mailing list