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

Error compiling on Ubuntu 18.04 #178

Open
pedrocamargo opened this issue Sep 8, 2018 · 6 comments
Open

Error compiling on Ubuntu 18.04 #178

pedrocamargo opened this issue Sep 8, 2018 · 6 comments

Comments

@pedrocamargo
Copy link

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
@pedrocamargo
Copy link
Author

pedrocamargo commented Sep 8, 2018

The source of the error is confirmed. Changing the line for

const StopStateKey zero_ssk = { 0, 0, 0, 0, 0 };

solves the problem, but I have NO idea if that has any impact in the code, as I haven't gone through it yet...

@e-lo
Copy link
Member

e-lo commented Sep 8, 2018 via email

@e-lo
Copy link
Member

e-lo commented Sep 10, 2018

This issue doesn't exist in our Trusty Ubuntu 14.04 test environment and Travis doesn't support later Ubuntu versions out of the box right now so we'd have to pull a docker image, which I'm not super keen on dealing with at this point.

Will run a test with the line change and see if this affects anything.

cc: @lmz

@pedrocamargo
Copy link
Author

I have also been testing a few things on the Python 3 branch with newer versions of the most important dependencies, but several things are coming up regarding functions that will be deprecated or have its behaviour change. Are you guys planning to upgrade those dependencies? If so, I am happy to make a pull request targeting that branch with all the changes I have been making...

@e-lo
Copy link
Member

e-lo commented Sep 11, 2018 via email

@timothyjamesbecker
Copy link

Travis now supports Ubuntu 18.04 LTS via the bionic name, I just finished three .travis.xml builds.

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

3 participants