Installation difficulties without c99/gnu99 as default.
When I try to install cluster toolkit I am getting the following error. Is this something that is seen before?
running install
running bdist_egg
running egg_info
writing cluster_toolkit.egg-info/PKG-INFO
writing dependency_links to cluster_toolkit.egg-info/dependency_links.txt
writing requirements to cluster_toolkit.egg-info/requires.txt
writing top-level names to cluster_toolkit.egg-info/top_level.txt
reading manifest file 'cluster_toolkit.egg-info/SOURCES.txt'
writing manifest file 'cluster_toolkit.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
building 'cluster_toolkit._cluster_toolkit' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/matthewkirby/anaconda3/include -arch x86_64 -I/Users/matthewkirby/anaconda3/include -arch x86_64 -Iinclude -I/Users/matthewkirby/anaconda3/include/python3.6m -c src/C_profile_derivatives.c -o build/temp.macosx-10.7-x86_64-3.6/src/C_profile_derivatives.o -I/usr/local/include
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/matthewkirby/anaconda3/include -arch x86_64 -I/Users/matthewkirby/anaconda3/include -arch x86_64 -Iinclude -I/Users/matthewkirby/anaconda3/include/python3.6m -c src/C_exclusion.c -o build/temp.macosx-10.7-x86_64-3.6/src/C_exclusion.o -I/usr/local/include
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/matthewkirby/anaconda3/include -arch x86_64 -I/Users/matthewkirby/anaconda3/include -arch x86_64 -Iinclude -I/Users/matthewkirby/anaconda3/include/python3.6m -c src/C_xi.c -o build/temp.macosx-10.7-x86_64-3.6/src/C_xi.o -I/usr/local/include
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/matthewkirby/anaconda3/include -arch x86_64 -I/Users/matthewkirby/anaconda3/include -arch x86_64 -Iinclude -I/Users/matthewkirby/anaconda3/include/python3.6m -c src/C_boostfactors.c -o build/temp.macosx-10.7-x86_64-3.6/src/C_boostfactors.o -I/usr/local/include
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/matthewkirby/anaconda3/include -arch x86_64 -I/Users/matthewkirby/anaconda3/include -arch x86_64 -Iinclude -I/Users/matthewkirby/anaconda3/include/python3.6m -c src/C_deltasigma.c -o build/temp.macosx-10.7-x86_64-3.6/src/C_deltasigma.o -I/usr/local/include
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/matthewkirby/anaconda3/include -arch x86_64 -I/Users/matthewkirby/anaconda3/include -arch x86_64 -Iinclude -I/Users/matthewkirby/anaconda3/include/python3.6m -c src/C_sigma_reconstruction.c -o build/temp.macosx-10.7-x86_64-3.6/src/C_sigma_reconstruction.o -I/usr/local/include
src/C_sigma_reconstruction.c: In function ‘Sigma_REC_from_DeltaSigma’:
src/C_sigma_reconstruction.c:38:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < N-1; i++){
^
src/C_sigma_reconstruction.c:38:3: note: use option -std=c99 or -std=gnu99 to compile your code
src/C_sigma_reconstruction.c:43:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int j = i; j < N; j++){
^
error: command 'gcc' failed with exit status 1
I am working on coming up with a fix and will pass it on if I come across it. I know @cavestruz was also having this problem but I am not sure how she fixed it. If we come up with a fix that doesn't break the install for anyone else it might be worth PRing it in. Thoughts?
My solution is in PR #19
We also run into this problem with a clean container.
sudo apt-get install libgsl0-dev -y
git clone https://github.com/matthewkirby/cluster_toolkit.git
cd cluster_toolkit
python setup.py install
Just to pass everything along, when I ran and installed locally in python 3 I had no issues. After forking and making the small +['-std=c99'] hack, I am running into a new error. The output is super long, but the gist at the end of the day is TypeError: sequence item 25: expected str instance, bytes found. This is being caused by setuptools doing things with the ext_models option. I traced the problem down to this python 2/3 porting problem: http://python3porting.com/problems.html#bytes-strings-and-unicode . My hack in the PR I have open resolves it in python 3 by just converting the byte strings that os.path.expandvars() returns to unicode (the default strings in python 3).
I threw together a quick hack using try/except to allow both the py2/3 versions to run. I tested it on local python 3 and python 2 on calvin.
Nice, so this is all working in #19 then?