sisoputnfrba / so-commons-library

TADs de uso comun en aplicaciones desarrolladas en C
http://sisoputnfrba.github.io/so-commons-library/
GNU General Public License v3.0
106 stars 174 forks source link

En OSX hay errores al instalar #109

Open leoncalermo opened 6 years ago

leoncalermo commented 6 years ago

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 commented 6 years ago

Hola, cómo estás?

La idea de la vm de la cátedra que les brindamos es para (entre otras cosas) evitar estos tipos de problemas que dependen según el entorno que estemos usando. Por eso les recomendamos que la usen.

Si mal no recuerdo, el problema en MacOS era de gcc y hay un issue en algún lado sobre ésto mismo pero no lo estoy encontrando :/

Si no, el genio de @mgarciaisaia nos puede ayudar :)

On Sun, Sep 9, 2018, 12:45 AM leoncalermo notifications@github.com wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sisoputnfrba/so-commons-library/issues/109, or mute the thread https://github.com/notifications/unsubscribe-auth/ARPXlUWdwEhsnXJMB3Hoyp6sBeE74TH2ks5uZI7lgaJpZM4WgISR .

mgarciaisaia commented 6 years ago

¡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 commented 2 years ago

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

mgarciaisaia commented 2 years ago

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 commented 2 years ago

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.