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

setup.py fails to generate .c files #102

Open
ldesousa opened this issue Nov 12, 2021 · 0 comments
Open

setup.py fails to generate .c files #102

ldesousa opened this issue Nov 12, 2021 · 0 comments

Comments

@ldesousa
Copy link

ldesousa commented Nov 12, 2021

I am trying to build and install the programme on Ubuntu 20.04. Try as I might, setuptools does not generate the .c files by itself leading to a build failure. Details in the log below:

$ uname -a
Linux luis-notebook 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ python3 --version
Python 3.8.10

$ git clone [email protected]:ItziModel/itzi.git
Cloning into 'itzi'...
Warning: Permanently added the RSA host key for IP address '140.82.112.3' to the list of known hosts.
Enter passphrase for key '/home/duque004/.ssh/id_rsa':
Enter passphrase for key '/home/duque004/.ssh/id_rsa':
remote: Enumerating objects: 3099, done.
remote: Counting objects: 100% (3099/3099), done.
remote: Compressing objects: 100% (1166/1166), done.
remote: Total 3099 (delta 2027), reused 2971 (delta 1900), pack-reused 0
Receiving objects: 100% (3099/3099), 1.73 MiB | 2.59 MiB/s, done.
Resolving deltas: 100% (2027/2027), done.

$ cd itzi
$ python3 -m venv env
$ source env/bin/activate
$ pip3 install cython numpy
Collecting cython
  Using cached Cython-0.29.24-cp38-cp38-manylinux1_x86_64.whl (1.9 MB)
Collecting numpy
  Using cached numpy-1.21.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Installing collected packages: cython, numpy
Successfully installed cython-0.29.24 numpy-1.21.4

$ python setup.py build_ext --inplace
running build_ext
compiler: unix
building 'itzi.flow' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/itzi
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/duque004/git/itzi/env/lib/python3.8/site-packages/numpy/core/include -I/home/duque004/git/itzi/env/include -I/usr/include/python3.8 -c itzi/flow.c -o build/temp.linux-x86_64-3.8/itzi/flow.o -O3 -w -fopenmp
x86_64-linux-gnu-gcc: error: itzi/flow.c: No such file or directory
x86_64-linux-gnu-gcc: fatal error: no input files
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

It is possible to run cython manually to get things going (see below), but that is not so convinient. Am I using setuptools correctly?

$ cython -a itzi/flow.pyx
/home/duque004/git/itzi/env/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/duque004/git/itzi/itzi/flow.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

$ cython -a itzi/swmm/swmm_c.pyx
/home/duque004/git/itzi/env/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/duque004/git/itzi/itzi/swmm/swmm_c.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

$ python setup.py build_ext --inplace
running build_ext
compiler: unix
building 'itzi.swmm.swmm_c' extension
[...]
copying build/lib.linux-x86_64-3.8/itzi/flow.cpython-38-x86_64-linux-gnu.so -> itzi
copying build/lib.linux-x86_64-3.8/itzi/swmm/swmm_c.cpython-38-x86_64-linux-gnu.so -> itzi/swmm
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

1 participant