Skip to content

Error compiling on Ubuntu 18.04 #178

@pedrocamargo

Description

@pedrocamargo

System: Ubuntu 18.04 (both branches, Master and Py3)

Stack track below. Apparently, a narrowing conversion on hyperlink.cpp line 420, due to StopStateKey being initialized with a mix of integers and floats. I am not great in C++ (or even reasonable at it), so hard to be sure.

Reference here:
https://stackoverflow.com/questions/4434140/narrowing-conversions-in-c0x-is-it-just-me-or-does-this-sound-like-a-breakin

Stack trace below

Installing collected packages: fasttrips
Running setup.py install for fasttrips ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-9e9i69pe-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-r2xf54nn-record/install-record.txt --single-version-externally-managed --compile:
  running install
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Error.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Stop.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Logger.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Performance.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/PathSet.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Trip.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Passenger.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Assignment.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/FastTrips.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/TAZ.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Util.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Run.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Transfer.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/__init__.py -> build/lib.linux-x86_64-3.6/fasttrips
  copying fasttrips/Route.py -> build/lib.linux-x86_64-3.6/fasttrips
  running build_ext
  building '_fasttrips' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-EKG1lX/python3.6-3.6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/dev/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c src/fasttrips.cpp -o build/temp.linux-x86_64-3.6/src/fasttrips.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  src/fasttrips.cpp: In function ‘PyObject* _fasttrips_initialize_supply(PyObject*, PyObject*)’:
  src/fasttrips.cpp:57:33: warning: unused variable ‘input5’ [-Wunused-variable]
       PyObject *input3, *input4, *input5, *input6;
                                   ^~~~~~
  src/fasttrips.cpp:57:42: warning: unused variable ‘input6’ [-Wunused-variable]
       PyObject *input3, *input4, *input5, *input6;
                                            ^~~~~~
  src/fasttrips.cpp:74:9: warning: unused variable ‘num_stop_times’ [-Wunused-variable]
       int num_stop_times  = PyArray_DIMS(pyo)[0];
           ^~~~~~~~~~~~~~
  src/fasttrips.cpp: In function ‘PyObject* _fasttrips_set_bump_wait(PyObject*, PyObject*)’:
  src/fasttrips.cpp:110:9: warning: unused variable ‘num_times’ [-Wunused-variable]
       int num_times   = PyArray_DIMS(pyo)[0];
           ^~~~~~~~~
  src/fasttrips.cpp: In function ‘PyObject* _fasttrips_find_pathset(PyObject*, PyObject*)’:
  src/fasttrips.cpp:179:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           for (int link_num = 0; link_num < path.size(); ++link_num) {
                                  ~~~~~~~~~^~~~~~~~~~~~~
  src/fasttrips.cpp:120:20: warning: unused variable ‘pyo’ [-Wunused-variable]
       PyArrayObject *pyo;
                      ^~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-EKG1lX/python3.6-3.6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/dev/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c src/hyperlink.cpp -o build/temp.linux-x86_64-3.6/src/hyperlink.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  src/hyperlink.cpp: In member function ‘void fasttrips::Hyperlink::updateLowCostPath(const fasttrips::StopStateKey&, const fasttrips::Hyperlink*, std::ostream&, const fasttrips::PathSpecification&, const fasttrips::PathFinder&)’:
  src/hyperlink.cpp:147:33: warning: unused variable ‘prev_ssk’ [-Wunused-variable]
               const StopStateKey& prev_ssk = it->first;
                                   ^~~~~~~~
  src/hyperlink.cpp: In member function ‘const fasttrips::Path* fasttrips::Hyperlink::getLowCostPath(bool) const’:
  src/hyperlink.cpp:199:16: warning: variable ‘low_cost’ set but not used [-Wunused-but-set-variable]
           double low_cost = 0;
                  ^~~~~~~~
  src/hyperlink.cpp: In member function ‘void fasttrips::Hyperlink::clear(bool)’:
  src/hyperlink.cpp:420:27: error: expected initializer before ‘zero_ssk’
           void StopStateKey zero_ssk = { 0.0, 0, 0, 0, 0.0 };
                             ^~~~~~~~
  src/hyperlink.cpp:439:47: error: ‘zero_ssk’ was not declared in this scope
           linkset.lder_ssk_                   = zero_ssk;
                                                 ^~~~~~~~
  src/hyperlink.cpp: In member function ‘double fasttrips::Hyperlink::getFareWithTransfer(const fasttrips::PathSpecification&, std::ostream&, const fasttrips::PathFinder&, const fasttrips::FarePeriod&, const std::map<int, fasttrips::Hyperlink>&) const’:
  src/hyperlink.cpp:1023:21: warning: unused variable ‘stop_succpred’ [-Wunused-variable]
                   int stop_succpred = ss.stop_succpred_;
                       ^~~~~~~~~~~~~
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions