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

En OSX hay errores al instalar #109

Open
leoncalermo opened this issue Sep 9, 2018 · 5 comments
Open

En OSX hay errores al instalar #109

leoncalermo opened this issue Sep 9, 2018 · 5 comments
Labels

Comments

@leoncalermo
Copy link

Al correr el comando sudo make install, aparecen varios errores lo cual impide instalar las commons en el sistema, les paso a mostrar los errores

so-commons-library git:(master) sudo make all
cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make all
mkdir -p build/commons/collections
gcc -c -fmessage-length=0 -fPIC -MMD -MP -MF"build/commons/collections/list.d" -MT"build/commons/collections/list.d" -o "build/commons/collections/list.o" "commons/collections/list.c"
commons/collections/list.c:46:34: error: function definition is not allowed here
        void _add_in_list(void* element){
                                        ^
commons/collections/list.c:50:22: error: use of undeclared identifier '_add_in_list'
        list_iterate(other, _add_in_list);
                            ^
commons/collections/list.c:211:36: error: function definition is not allowed here
        void _add_if_apply(void* element) {
                                          ^
commons/collections/list.c:217:21: error: use of undeclared identifier '_add_if_apply'
        list_iterate(self, _add_if_apply);
                           ^
commons/collections/list.c:224:43: error: function definition is not allowed here
        void _add_after_transform(void* element) {
                                                 ^
commons/collections/list.c:229:21: error: use of undeclared identifier '_add_after_transform'
        list_iterate(self, _add_after_transform);
                           ^
6 errors generated.
make[1]: *** [build/commons/collections/list.o] Error 1
make: [all] Error 2 (ignored)
cd tests/unit-tests && /Applications/Xcode.app/Contents/Developer/usr/bin/make all
cd ../../ && git submodule init && git submodule update
cd ../../cspec && /Applications/Xcode.app/Contents/Developer/usr/bin/make all
mkdir -p release/cspecs/
gcc -c -fmessage-length=0 -fPIC -MMD -MP -MF"release/cspecs/cspec.d" -MT"release/cspecs/cspec.d" -o "release/cspecs/cspec.o" "cspecs/cspec.c"
cspecs/cspec.c:169:28: error: function definition is not allowed here
        char* to_s(Bool p) { return p ? "true" : "false"; }
                           ^
cspecs/cspec.c:170:36: warning: implicit declaration of function 'to_s' is invalid in C99 [-Wimplicit-function-declaration]
        __should_boolp(file, line, to_s(actual), negated, to_s(expected));
                                   ^
cspecs/cspec.c:170:36: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'String' (aka 'char *') [-Wint-conversion]
        __should_boolp(file, line, to_s(actual), negated, to_s(expected));
                                   ^~~~~~~~~~~~
cspecs/cspec.c:151:5: note: passing argument to parameter 'actual' here
    __should_declaration(boolp, String);
    ^
cspecs/cspec.h:39:64: note: expanded from macro '__should_declaration'
            void __should_##suffix(String file, Int line, type actual, Bool negated, type expected)
                                                               ^
cspecs/cspec.c:170:59: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'String' (aka 'char *') [-Wint-conversion]
        __should_boolp(file, line, to_s(actual), negated, to_s(expected));
                                                          ^~~~~~~~~~~~~~
cspecs/cspec.c:151:5: note: passing argument to parameter 'expected' here
    __should_declaration(boolp, String);
    ^
cspecs/cspec.h:39:91: note: expanded from macro '__should_declaration'
            void __should_##suffix(String file, Int line, type actual, Bool negated, type expected)
                                                                                          ^
3 warnings and 1 error generated.
make[2]: *** [release/cspecs/cspec.o] Error 1
make[1]: [install-cspec] Error 2 (ignored)
cd ../../src/ && /Applications/Xcode.app/Contents/Developer/usr/bin/make all
mkdir -p build/commons/collections
gcc -c -fmessage-length=0 -fPIC -MMD -MP -MF"build/commons/collections/list.d" -MT"build/commons/collections/list.d" -o "build/commons/collections/list.o" "commons/collections/list.c"
commons/collections/list.c:46:34: error: function definition is not allowed here
        void _add_in_list(void* element){
                                        ^
commons/collections/list.c:50:22: error: use of undeclared identifier '_add_in_list'
        list_iterate(other, _add_in_list);
                            ^
commons/collections/list.c:211:36: error: function definition is not allowed here
        void _add_if_apply(void* element) {
                                          ^
commons/collections/list.c:217:21: error: use of undeclared identifier '_add_if_apply'
        list_iterate(self, _add_if_apply);
                           ^
commons/collections/list.c:224:43: error: function definition is not allowed here
        void _add_after_transform(void* element) {
                                                 ^
commons/collections/list.c:229:21: error: use of undeclared identifier '_add_after_transform'
        list_iterate(self, _add_after_transform);
                           ^
6 errors generated.
make[2]: *** [build/commons/collections/list.o] Error 1
make[1]: [dependents] Error 2 (ignored)
mkdir -p build
gcc -I"../../src" -I"../../cspec" -c -fmessage-length=0 -fPIC -MMD -MP -MF"build/test_bitarray.d" -MT"build/test_bitarray.d" -o "build/test_bitarray.o" "test_bitarray.c"
test_bitarray.c:28:31: error: function definition is not allowed here
    describe ("LSB Bitarray") {
                              ^
test_bitarray.c:72:7: error: use of undeclared identifier '__$__'
    } end
      ^
../../cspec/cspecs/cspec.h:64:35: note: expanded from macro 'end'
        #define end               __$__;}));
                                  ^
test_bitarray.c:28:5: error: passing 'void' to parameter of incompatible type 'Function' (aka 'void (*)(void)')
    describe ("LSB Bitarray") {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../../cspec/cspecs/cspec.h:57:52: note: expanded from macro 'describe'
        #define describe(desc)    __describe(desc, ({ void __$__()
                                                   ^
../../cspec/cspecs/cspec.h:26:59: note: passing argument to parameter 'function' here
        void __describe     (String description, Function function);
                                                          ^
test_bitarray.c:74:31: error: function definition is not allowed here
    describe ("MSB Bitarray") {
                              ^
test_bitarray.c:118:7: error: use of undeclared identifier '__$__'
    } end
      ^
../../cspec/cspecs/cspec.h:64:35: note: expanded from macro 'end'
        #define end               __$__;}));
                                  ^
test_bitarray.c:74:5: error: passing 'void' to parameter of incompatible type 'Function' (aka 'void (*)(void)')
    describe ("MSB Bitarray") {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../../cspec/cspecs/cspec.h:57:52: note: expanded from macro 'describe'
        #define describe(desc)    __describe(desc, ({ void __$__()
                                                   ^
../../cspec/cspecs/cspec.h:26:59: note: passing argument to parameter 'function' here
        void __describe     (String description, Function function);
                                                          ^
6 errors generated.
make[1]: *** [build/test_bitarray.o] Error 1
make: [all] Error 2 (ignored)
➜  so-commons-library git:(master)

Me gustaria que me puedan decir como instalarlos, siendo que no modifique nada de estos archivos pero no puedo instalarlo

@varas-c
Copy link

varas-c commented Sep 9, 2018 via email

@mgarciaisaia
Copy link
Member

¡Aloha!

Algo de esto hay en #48. Para hacerla corta - las commons no soportan macOS aún.

En particular, el error que estás viendo vos tiene que ver con lo que menciono en este video de que las commons usan funcionalidades no estándar de C - en particular, las inner functions. Y macOS por defecto usa el compilador clang.

Si gustás colaborar para hacer las commons más compatibles con macOS, bienvenido sea :)

@dlopezjoffreutn
Copy link

Buenas! Queria probar hacer un mini build en Mac y pasa esto mismo. Hay alguna update del tema? Gracias!

@mgarciaisaia
Copy link
Member

Nope. Imagino que cualquier progreso lo compartiremos en este repo, pero tampoco esperaría que haya progreso porque, buen, no es una plataforma soportada.

@RaniAgus RaniAgus added the bug label Jul 27, 2022
@RaniAgus
Copy link
Contributor

RaniAgus commented Aug 25, 2022

Según el amigo Beej, si bien el gcc que viene instalado por defecto en OSX es solo un wrapper de clang, se puede instalar el de GNU usando Homebrew. Igual antes de usar OSX para desarrollar el TP hay que tener en cuenta primero esta aclaración.

@RaniAgus RaniAgus pinned this issue Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants