3

I have this setup.py:

from distutils.core import setup, Extension
from setuptools import setup, Extension
import numpy as np

module1 = Extension('filename',
                    sources = ['utilities/filename.c'])

setup (name = 'library',
       version = '1.0',
       description = 'library',
       include_dirs = [np.get_include()],
       ext_modules = [module1])

I want to create the filename.so into the folder utilities. I tried with

python setup.py build -f --build-temp=. -e utilities/

but this put only the filename.o file into utilities/ and the .so into build/lib...

Any idea? Is it possible or not?

2 Answers 2

6

If you want extensions modules to be build in the same directory you could use this:

python setup.py build_ext --inplace

Or you can add this parameter to specify a build folder

--build-lib=folderx
Sign up to request clarification or add additional context in comments.

Comments

1

To build up on @J.Serra's answer, you can also create a setup.cfg file and write inside either:

[build_ext]
inplace=1

or

[build_ext]
build-lib=./path/to/folder/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.