Running setup.py produces build artifacts in the ufc/ directory
The result is a build process that doesn't always work without manually deleting some files.
The files should rather be in the build/ directory.
Johannes: do you know how to fix this?
Comments (7)
-
-
I couldn't find a nice way to do this. It would be nice if we could use the
swig
options-o <outfile>
and-outdir <dir>
. The latter works fine. I can do-outdir build
and theufc_wrap.cpp
file will be placed in thebuild
directory. However, the-o
option which generates theufc.py
file, is hardcoded inbuild_ext.py
in distutils.The only workaround I could find was to copy the
ufc
directory to thebuild
directory and generate the files from there, as in the following patch:diff --git a/setup.py b/setup.py index a5425cc..348d60a 100755 --- a/setup.py +++ b/setup.py @@ -257,8 +257,13 @@ def run_install(): "-fastinit", "-fastunpack", "-fastquery", "-nobuildnone"] if sys.version_info[0] > 2: swig_options.insert(0, "-py3") + if not os.path.exists("build"): + os.makedirs("build") + if os.path.exists(os.path.join("build", "ufc")): + shutil.rmtree(os.path.join("build", "ufc")) + shutil.copytree("ufc", os.path.join("build", "ufc")) ext_module_ufc = Extension("ufc._ufc", - sources=[os.path.join("ufc", "ufc.i")], + sources=[os.path.join("build", "ufc", "ufc.i")], depends=[os.path.join("ufc", "ufc.h"), os.path.join("ufc", "ufc_geometry.h")], swig_opts=swig_options,
What do you think?
-
- changed status to resolved
Move generated swig files to build directory (fixes issue
#66).→ <<cset a19e85457e4c>>
-
- changed status to open
The fix in a19e85457e4c resulted in an incomplete installation, so the change has been reverted.
-
- changed milestone to 1.7
Not sure how to fix this or if it is important.
-
reporter - changed status to resolved
No longer relevant
-
- removed milestone
Removing milestone: 1.7 (automated comment)
- Log in to comment
I will take a look.