bliksemlabs / rrrr

RRRR rapid real-time routing
BSD 2-Clause "Simplified" License
163 stars 32 forks source link

Compilation fails #201

Open chazanov opened 5 years ago

chazanov commented 5 years ago

I've tried with either clang 7 and 9, both fail.

clang -c -ggdb3 -march=native -Wall -Wno-unused -O3 -D_GNU_SOURCE  worker-web.c -o worker-web.o
In file included from worker-web.c:12:
In file included from ./tdata.h:10:
./gtfs-realtime.pb-c.h:10:1: error: unknown type name 'PROTOBUF_C_BEGIN_DECLS'
PROTOBUF_C_BEGIN_DECLS
^
./gtfs-realtime.pb-c.h:13:1: error: expected identifier or '('
typedef struct _TransitRealtime__FeedMessage TransitRealtime__FeedMessage;
^
./gtfs-realtime.pb-c.h:325:23: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
                     (TransitRealtime__FeedMessage         *message);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:327:29: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
                     (const TransitRealtime__FeedMessage   *message);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:329:29: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
                     (const TransitRealtime__FeedMessage   *message,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:332:29: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
                     (const TransitRealtime__FeedMessage   *message,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:334:1: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
TransitRealtime__FeedMessage *
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:340:23: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
                     (TransitRealtime__FeedMessage *message,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:582:25: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
                 (const TransitRealtime__FeedMessage *message,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
./gtfs-realtime.pb-c.h:659:1: error: unknown type name 'PROTOBUF_C_END_DECLS'
PROTOBUF_C_END_DECLS
^
In file included from worker-web.c:12:
./tdata.h:14:1: error: expected identifier or '('
typedef uint32_t calendar_t;
^
./tdata.h:74:5: error: unknown type name 'calendar_t'
    calendar_t dst_active;
    ^
./tdata.h:106:5: error: unknown type name 'calendar_t'
    calendar_t *trip_active;
    ^
./tdata.h:107:5: error: unknown type name 'calendar_t'
    calendar_t *route_active;
    ^
./tdata.h:115:5: error: unknown type name 'TransitRealtime__FeedMessage'; did you mean 'TransitRealtime__FeedHeader'?
    TransitRealtime__FeedMessage *alerts;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TransitRealtime__FeedHeader
./gtfs-realtime.pb-c.h:14:45: note: 'TransitRealtime__FeedHeader' declared here
typedef struct _TransitRealtime__FeedHeader TransitRealtime__FeedHeader;
                                            ^
In file included from worker-web.c:12:
./tdata.h:173:1: error: unknown type name 'calendar_t'
calendar_t *tdata_trip_masks_for_route(tdata_t*, uint32_t route_index);
^
In file included from worker-web.c:14:
./router.h:36:5: error: unknown type name 'calendar_t'
    calendar_t mask;
    ^
./router.h:52:5: error: unknown type name 'calendar_t'
    calendar_t day_mask;
    ^
./router.h:100:5: error: unknown type name 'calendar_t'
    calendar_t day_mask; // bit for the day on which we are searching, relative to the timetable calendar
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
skinkie commented 5 years ago

Looking at the first error message something happens with your protocol buffers includes. If you would disable the realtime component, it is likely you can at least proceed testing. I have recently compiled rrrr with both gcc and clang without issues, but consider our enormous number of branches, knowing which branch you tried would also help.

chazanov commented 5 years ago

I've tried the master branch. How can I disable realtime?

skinkie commented 5 years ago

Can you try the tdata4 branch?

chazanov commented 5 years ago

With tdata4 I'm getting

clang -DRRRR_STRICT -DRRRR_TDATA_IO_DYNAMIC -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_64 -Wextra -Wall -ansi -pedantic -DRRRR_DEBUG -DRRRR_INFO -DRRRR_TDATA -ggdb -O0 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v4_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c router_dump.c hashgrid.c plan_render_text.c polyline.c json.c plan_render_otp.c api.c set.c string_pool.c hashgrid_street_network.c street_network.c
clang-7: error: no such file or directory: 'gtfs-realtime.pb-c.c'
skinkie commented 5 years ago

@chazanov have you actually got protocol buffers and protobuf-c installed?

chazanov commented 5 years ago

@skinkie Yes, of course (protobuf 3.7.0 and p-c 1.3.1):

protobuf /usr/bin/protoc
protobuf /usr/include/google/
protobuf /usr/include/google/protobuf/
protobuf /usr/include/google/protobuf/any.h
protobuf /usr/include/google/protobuf/any.pb.h
protobuf /usr/include/google/protobuf/any.proto
protobuf /usr/include/google/protobuf/api.pb.h
protobuf /usr/include/google/protobuf/api.proto
protobuf /usr/include/google/protobuf/arena.h
protobuf /usr/include/google/protobuf/arena_impl.h
protobuf /usr/include/google/protobuf/arenastring.h
protobuf /usr/include/google/protobuf/compiler/
protobuf /usr/include/google/protobuf/compiler/code_generator.h
protobuf /usr/include/google/protobuf/compiler/command_line_interface.h
protobuf /usr/include/google/protobuf/compiler/cpp/
protobuf /usr/include/google/protobuf/compiler/cpp/cpp_generator.h
protobuf /usr/include/google/protobuf/compiler/csharp/
protobuf /usr/include/google/protobuf/compiler/csharp/csharp_generator.h
protobuf /usr/include/google/protobuf/compiler/csharp/csharp_names.h
protobuf /usr/include/google/protobuf/compiler/importer.h
protobuf /usr/include/google/protobuf/compiler/java/
protobuf /usr/include/google/protobuf/compiler/java/java_generator.h
protobuf /usr/include/google/protobuf/compiler/java/java_names.h
protobuf /usr/include/google/protobuf/compiler/js/
protobuf /usr/include/google/protobuf/compiler/js/js_generator.h
protobuf /usr/include/google/protobuf/compiler/js/well_known_types_embed.h
protobuf /usr/include/google/protobuf/compiler/objectivec/
protobuf /usr/include/google/protobuf/compiler/objectivec/objectivec_generator.h
protobuf /usr/include/google/protobuf/compiler/objectivec/objectivec_helpers.h
protobuf /usr/include/google/protobuf/compiler/parser.h
protobuf /usr/include/google/protobuf/compiler/php/
protobuf /usr/include/google/protobuf/compiler/php/php_generator.h
protobuf /usr/include/google/protobuf/compiler/plugin.h
protobuf /usr/include/google/protobuf/compiler/plugin.pb.h
protobuf /usr/include/google/protobuf/compiler/plugin.proto
protobuf /usr/include/google/protobuf/compiler/python/
protobuf /usr/include/google/protobuf/compiler/python/python_generator.h
protobuf /usr/include/google/protobuf/compiler/ruby/
protobuf /usr/include/google/protobuf/compiler/ruby/ruby_generator.h
protobuf /usr/include/google/protobuf/descriptor.h
protobuf /usr/include/google/protobuf/descriptor.pb.h
protobuf /usr/include/google/protobuf/descriptor.proto
protobuf /usr/include/google/protobuf/descriptor_database.h
protobuf /usr/include/google/protobuf/duration.pb.h
protobuf /usr/include/google/protobuf/duration.proto
protobuf /usr/include/google/protobuf/dynamic_message.h
protobuf /usr/include/google/protobuf/empty.pb.h
protobuf /usr/include/google/protobuf/empty.proto
protobuf /usr/include/google/protobuf/extension_set.h
protobuf /usr/include/google/protobuf/extension_set_inl.h
protobuf /usr/include/google/protobuf/field_mask.pb.h
protobuf /usr/include/google/protobuf/field_mask.proto
protobuf /usr/include/google/protobuf/generated_enum_reflection.h
protobuf /usr/include/google/protobuf/generated_enum_util.h
protobuf /usr/include/google/protobuf/generated_message_reflection.h
protobuf /usr/include/google/protobuf/generated_message_table_driven.h
protobuf /usr/include/google/protobuf/generated_message_util.h
protobuf /usr/include/google/protobuf/has_bits.h
protobuf /usr/include/google/protobuf/implicit_weak_message.h
protobuf /usr/include/google/protobuf/inlined_string_field.h
protobuf /usr/include/google/protobuf/io/
protobuf /usr/include/google/protobuf/io/coded_stream.h
protobuf /usr/include/google/protobuf/io/gzip_stream.h
protobuf /usr/include/google/protobuf/io/printer.h
protobuf /usr/include/google/protobuf/io/strtod.h
protobuf /usr/include/google/protobuf/io/tokenizer.h
protobuf /usr/include/google/protobuf/io/zero_copy_stream.h
protobuf /usr/include/google/protobuf/io/zero_copy_stream_impl.h
protobuf /usr/include/google/protobuf/io/zero_copy_stream_impl_lite.h
protobuf /usr/include/google/protobuf/map.h
protobuf /usr/include/google/protobuf/map_entry.h
protobuf /usr/include/google/protobuf/map_entry_lite.h
protobuf /usr/include/google/protobuf/map_field.h
protobuf /usr/include/google/protobuf/map_field_inl.h
protobuf /usr/include/google/protobuf/map_field_lite.h
protobuf /usr/include/google/protobuf/map_type_handler.h
protobuf /usr/include/google/protobuf/message.h
protobuf /usr/include/google/protobuf/message_lite.h
protobuf /usr/include/google/protobuf/metadata.h
protobuf /usr/include/google/protobuf/metadata_lite.h
protobuf /usr/include/google/protobuf/parse_context.h
protobuf /usr/include/google/protobuf/port.h
protobuf /usr/include/google/protobuf/port_def.inc
protobuf /usr/include/google/protobuf/port_undef.inc
protobuf /usr/include/google/protobuf/reflection.h
protobuf /usr/include/google/protobuf/reflection_ops.h
protobuf /usr/include/google/protobuf/repeated_field.h
protobuf /usr/include/google/protobuf/service.h
protobuf /usr/include/google/protobuf/source_context.pb.h
protobuf /usr/include/google/protobuf/source_context.proto
protobuf /usr/include/google/protobuf/struct.pb.h
protobuf /usr/include/google/protobuf/struct.proto
protobuf /usr/include/google/protobuf/stubs/
protobuf /usr/include/google/protobuf/stubs/bytestream.h
protobuf /usr/include/google/protobuf/stubs/callback.h
protobuf /usr/include/google/protobuf/stubs/casts.h
protobuf /usr/include/google/protobuf/stubs/common.h
protobuf /usr/include/google/protobuf/stubs/fastmem.h
protobuf /usr/include/google/protobuf/stubs/hash.h
protobuf /usr/include/google/protobuf/stubs/logging.h
protobuf /usr/include/google/protobuf/stubs/macros.h
protobuf /usr/include/google/protobuf/stubs/mutex.h
protobuf /usr/include/google/protobuf/stubs/once.h
protobuf /usr/include/google/protobuf/stubs/platform_macros.h
protobuf /usr/include/google/protobuf/stubs/port.h
protobuf /usr/include/google/protobuf/stubs/status.h
protobuf /usr/include/google/protobuf/stubs/stl_util.h
protobuf /usr/include/google/protobuf/stubs/stringpiece.h
protobuf /usr/include/google/protobuf/stubs/strutil.h
protobuf /usr/include/google/protobuf/stubs/template_util.h
protobuf /usr/include/google/protobuf/text_format.h
protobuf /usr/include/google/protobuf/timestamp.pb.h
protobuf /usr/include/google/protobuf/timestamp.proto
protobuf /usr/include/google/protobuf/type.pb.h
protobuf /usr/include/google/protobuf/type.proto
protobuf /usr/include/google/protobuf/unknown_field_set.h
protobuf /usr/include/google/protobuf/util/
protobuf /usr/include/google/protobuf/util/delimited_message_util.h
protobuf /usr/include/google/protobuf/util/field_comparator.h
protobuf /usr/include/google/protobuf/util/field_mask_util.h
protobuf /usr/include/google/protobuf/util/json_util.h
protobuf /usr/include/google/protobuf/util/message_differencer.h
protobuf /usr/include/google/protobuf/util/time_util.h
protobuf /usr/include/google/protobuf/util/type_resolver.h
protobuf /usr/include/google/protobuf/util/type_resolver_util.h
protobuf /usr/include/google/protobuf/wire_format.h
protobuf /usr/include/google/protobuf/wire_format_lite.h
protobuf /usr/include/google/protobuf/wire_format_lite_inl.h
protobuf /usr/include/google/protobuf/wrappers.pb.h
protobuf /usr/include/google/protobuf/wrappers.proto
protobuf /usr/lib/libprotobuf-lite.so
protobuf /usr/lib/libprotobuf-lite.so.18
protobuf /usr/lib/libprotobuf-lite.so.18.0.0
protobuf /usr/lib/libprotobuf.so
protobuf /usr/lib/libprotobuf.so.18
protobuf /usr/lib/libprotobuf.so.18.0.0
protobuf /usr/lib/libprotoc.so
protobuf /usr/lib/libprotoc.so.18
protobuf /usr/lib/libprotoc.so.18.0.0
protobuf /usr/lib/pkgconfig/
protobuf /usr/lib/pkgconfig/protobuf-lite.pc
protobuf /usr/lib/pkgconfig/protobuf.pc

protobuf-c /usr/bin/protoc-c
protobuf-c /usr/bin/protoc-gen-c
protobuf-c /usr/include/google/
protobuf-c /usr/include/google/protobuf-c/
protobuf-c /usr/include/google/protobuf-c/protobuf-c.h
protobuf-c /usr/include/protobuf-c/
protobuf-c /usr/include/protobuf-c/protobuf-c.h
protobuf-c /usr/lib/libprotobuf-c.so
protobuf-c /usr/lib/libprotobuf-c.so.1
protobuf-c /usr/lib/libprotobuf-c.so.1.0.0
protobuf-c /usr/lib/pkgconfig/
protobuf-c /usr/lib/pkgconfig/libprotobuf-c.pc
skinkie commented 5 years ago

I just did this:

git clone git@github.com:bliksemlabs/rrrr.git 
cd rrrr/
git checkout tdata4
mkdir build
cd build/
cmake ..
make

Now if you convince cmake to use clang, I am interested in your results.

chazanov commented 5 years ago

@skinkie It now builds perfectly.

Probably that's trivial, but for me there is No rule to make target 'install'.

skinkie commented 5 years ago

https://github.com/libcheck/check

skinkie commented 5 years ago

@chazanov I guess there is no install ;-) there are binaries, a static library, some python code.

chazanov commented 5 years ago

https://github.com/libcheck/check

Nowaday github records all of my mistakes ;)

So there is nothing more than a 180 kb binary called ./cli ?

skinkie commented 5 years ago

Your profile seems to be hidden enough ;-) nobody knows you work for a fruit or number company ;-)

chazanov commented 5 years ago

@skinkie Yes, I'm very cautious with photos or information on me. I'm just a single OSM guy doing something very different in real life.

I'm always interested in doing things like navigation or geocoding with much less memory than everybody else. Example: GraphHopper is actually fast, but fat. Pelias is a gigantic geocoder, but quite heavy.

skinkie commented 5 years ago

You can probably figure out my e-mail by git log ;-)