Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on CentOS 6 (GCC 4.4) failure #74

Closed
frimik opened this issue Jun 4, 2015 · 11 comments
Closed

Compiling on CentOS 6 (GCC 4.4) failure #74

frimik opened this issue Jun 4, 2015 · 11 comments

Comments

@frimik
Copy link

frimik commented Jun 4, 2015

README still says GCC (G++) 4.3+ is needed but apparently that's no longer true because anything newer than libsass-python 0.5.0 fails on CentOS 6. That seems to include the 0.6.2 version as well, which explicitly state that 0.6.0 through 0.6.1 had issues ...?

@dahlia
Copy link
Member

dahlia commented Jun 4, 2015

It would be helpful for investigating if you show the detailed build error.

@frimik
Copy link
Author

frimik commented Jun 6, 2015

@dahlia:

$ pip install libsass
Downloading/unpacking libsass
  Downloading libsass-0.8.2.tar.gz (229kB): 229kB downloaded
  Running setup.py egg_info for package libsass
    warning: no files found matching 'win32/*.h'
Downloading/unpacking six (from libsass)
  Downloading six-1.9.0.tar.gz
  Running setup.py egg_info for package six
    no previously-included directories found matching 'documentation/_build'
Installing collected packages: libsass, six
  Running setup.py install for libsass
    building '_sass' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./libsass -I/usr/include/python2.6 -c libsass/sass2scss.cpp -o build/temp.linux-x86_64-2.6/libsass/sass2scss.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./libsass -I/usr/include/python2.6 -c libsass/sass_context.cpp -o build/temp.linux-x86_64-2.6/libsass/sass_context.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses
    libsass/sass_context.cpp: In function ‘int handle_errors(Sass_Context*)’:
    libsass/sass_context.cpp:238: error: expected initializer before ‘:’ token
    libsass/sass_context.cpp:894: error: expected primary-expression at end of input
    libsass/sass_context.cpp:894: error: expected ‘;’ at end of input
    libsass/sass_context.cpp:894: error: expected primary-expression at end of input
    libsass/sass_context.cpp:894: error: expected ‘)’ at end of input
    libsass/sass_context.cpp:894: error: expected statement at end of input
    libsass/sass_context.cpp:236: warning: unused variable ‘got_newline’
    libsass/sass_context.cpp:894: error: expected ‘}’ at end of input
    libsass/sass_context.cpp:894: error: expected ‘}’ at end of input
    libsass/sass_context.cpp: At global scope:
    libsass/sass_context.cpp:894: error: expected ‘}’ at end of input
    libsass/sass_context.cpp:170: warning: ‘void copy_options(Sass_Options*, Sass_Options*)’ defined but not used
    libsass/sass_context.cpp:187: warning: ‘const char* safe_str(const char*)’ defined but not used
    libsass/sass_context.cpp:191: warning: ‘void copy_strings(const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, char***)’ defined but not used
    libsass/sass_context.cpp:207: warning: ‘void free_string_array(char**)’ defined but not used
    libsass/sass_context.cpp:220: warning: ‘int handle_errors(Sass_Context*)’ defined but not used
    error: command 'gcc' failed with exit status 1                                                                                                                                                                                                                                                                               Complete output from command /tmp/venv/bin/python -c "import setuptools;__file__='/tmp/venv/build/libsass/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Kb4ZgT-record/install-record.txt --single-version-externally-managed --install-headers /tmp/venv/include/site/python2.6:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.6

copying sass.py -> build/lib.linux-x86_64-2.6

copying sassc.py -> build/lib.linux-x86_64-2.6

copying sasstests.py -> build/lib.linux-x86_64-2.6

creating build/lib.linux-x86_64-2.6/sassutils

copying sassutils/builder.py -> build/lib.linux-x86_64-2.6/sassutils

copying sassutils/distutils.py -> build/lib.linux-x86_64-2.6/sassutils

copying sassutils/wsgi.py -> build/lib.linux-x86_64-2.6/sassutils

copying sassutils/__init__.py -> build/lib.linux-x86_64-2.6/sassutils

running build_ext

building '_sass' extension

creating build/temp.linux-x86_64-2.6

creating build/temp.linux-x86_64-2.6/libsass

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./libsass -I/usr/include/python2.6 -c libsass/sass2scss.cpp -o build/temp.linux-x86_64-2.6/libsass/sass2scss.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./libsass -I/usr/include/python2.6 -c libsass/sass_context.cpp -o build/temp.linux-x86_64-2.6/libsass/sass_context.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses

libsass/sass_context.cpp: In function ‘int handle_errors(Sass_Context*)’:

libsass/sass_context.cpp:238: error: expected initializer before ‘:’ token

libsass/sass_context.cpp:894: error: expected primary-expression at end of input

libsass/sass_context.cpp:894: error: expected ‘;’ at end of input

libsass/sass_context.cpp:894: error: expected primary-expression at end of input

libsass/sass_context.cpp:894: error: expected ‘)’ at end of input

libsass/sass_context.cpp:894: error: expected statement at end of input

libsass/sass_context.cpp:236: warning: unused variable ‘got_newline’

libsass/sass_context.cpp:894: error: expected ‘}’ at end of input

libsass/sass_context.cpp:894: error: expected ‘}’ at end of input

libsass/sass_context.cpp: At global scope:

libsass/sass_context.cpp:894: error: expected ‘}’ at end of input

libsass/sass_context.cpp:170: warning: ‘void copy_options(Sass_Options*, Sass_Options*)’ defined but not used

libsass/sass_context.cpp:187: warning: ‘const char* safe_str(const char*)’ defined but not used

libsass/sass_context.cpp:191: warning: ‘void copy_strings(const std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, char***)’ defined but not used

libsass/sass_context.cpp:207: warning: ‘void free_string_array(char**)’ defined but not used

libsass/sass_context.cpp:220: warning: ‘int handle_errors(Sass_Context*)’ defined but not used

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /tmp/venv/bin/python -c "import setuptools;__file__='/tmp/venv/build/libsass/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Kb4ZgT-record/install-record.txt --single-version-externally-managed --install-headers /tmp/venv/include/site/python2.6 failed with error code 1 in /tmp/venv/build/libsass
Storing complete log in /home/vagrant/.pip/pip.log

@frimik
Copy link
Author

frimik commented Jun 6, 2015

Above is centos 6 ... it works fine on CentOS 7, with newer GCC. I understand it's an issue upstream but I thought I'd ask you first anyway as I see that you've had intentions of supporting GCC 4.3+ before...

@frimik
Copy link
Author

frimik commented Jun 6, 2015

most of the issues seem to be because of range-based for loops in libsass, they require GCC 4.6

@dahlia
Copy link
Member

dahlia commented Jun 8, 2015

According to libsass’s README:

LibSass requires GCC 4.6+ or Clang/LLVM. If your OS is older, this version may not compile.

On Windows, you need MinGW with GCC 4.6+ or VS 2013 Update 4+. It is also possible to build LibSass with Clang/LLVM on Windows.

I will update the outdated information of libsass-python’s README.

@dahlia dahlia closed this as completed in c8ddf7f Jun 8, 2015
@asottile
Copy link
Member

asottile commented Jun 8, 2015

@dahlia might be worth just linking to the upstream so this doesn't rot further when sass/libsass changes requirements again

(Since our python wrapper just needs a simple C compiler to work)

dahlia added a commit that referenced this issue Jun 8, 2015
@asottile
Copy link
Member

asottile commented Jun 8, 2015

<3

@frimik
Copy link
Author

frimik commented Jun 9, 2015

Happy for you, sad for me :).. well thanks for confirming your part... not sure if upstream libsass is "aware" that they now require more of C++11 than they did originally... mostly because of range-based for loops I think unfortunately.

@dahlia
Copy link
Member

dahlia commented Jun 9, 2015

@frimik Could you try LLVM/Clang?

@frimik
Copy link
Author

frimik commented Jun 11, 2015

CentOS 6 is just too old.... it's unfortunate to have libsass break simply
because of a new for loop... but well... CentOS 7+ works fine so guess we
just bite the bullet and go for that or building with a newer glibc
explicitly.... thanks. close issue.

tis 9 juni 2015 kl 15:49 skrev Hong Minhee [email protected]:

@frimik https://github.com/frimik Could you try LLVM/Clang?


Reply to this email directly or view it on GitHub
#74 (comment)
.

@k-funk
Copy link

k-funk commented May 17, 2016

There's a PR in libsass to work with GCC 4.4. If anyone has the time to review it/help them: sass/libsass#1623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants