Bug #1826

Python wrappers are always removed after make clean

Added by Knödlseder Jürgen almost 8 years ago. Updated almost 8 years ago.

Status:ClosedStart date:07/29/2016
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.2.0
Duration:

Description

The Python wrappers are always remove after make clean, even if they were shipped with the software. The following sequence of commands leads to an error:

./configure
make
./configure
make clean
make
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../include -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gammalib/app_wrap.cpp -o build/temp.macosx-10.11-x86_64-2.7/gammalib/app_wrap.o
clang: error: no such file or directory: 'gammalib/app_wrap.cpp'
clang: error: no input files
error: command 'clang' failed with exit status 1
make[3]: *** [build] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The reason is that after the first ./configure & make the wrappers exist, then the second ./configure detects that and does not add the swig step to make. But the files are removed in the make clean step in any case due to the following sequence in Makefile.am:
clean-local:
    rm -rf build
    rm -rf $(builddir)/gammalib/*.py
    rm -rf $(builddir)/gammalib/*.pyc
    rm -rf $(builddir)/gammalib/*_wrap.cpp
    rm -rf $(builddir)/gammalib/_*.so
    rm -rf $(builddir)/gammalib/__pycache__

Changing this sequence to;

clean-local:
    rm -rf build
if BUILD_WRAPPERS
    rm -rf $(builddir)/gammalib/*.py
    rm -rf $(builddir)/gammalib/*_wrap.cpp
endif # BUILD_WRAPPERS
    rm -rf $(builddir)/gammalib/*.pyc
    rm -rf $(builddir)/gammalib/_*.so
    rm -rf $(builddir)/gammalib/__pycache__

should solve this. We need however to check whether make dist and make distcheck are still okay.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen almost 8 years ago

  • Subject changed from Python wrappers are always remove after make clean to Python wrappers are always removed after make clean

#2 Updated by Knödlseder Jürgen almost 8 years ago

The following code fixed the problem:

clean-local:
    rm -rf build
if BUILD_WRAPPERS
    rm -rf $(builddir)/gammalib/*.py
    rm -rf $(builddir)/gammalib/*_wrap.cpp
else
    if test "x$(builddir)" != "x$(srcdir)"; then \
        rm -rf $(builddir)/gammalib/*.py; \
        rm -rf $(builddir)/gammalib/*_wrap.cpp; \
    fi
endif
    rm -rf $(builddir)/gammalib/*.pyc
    rm -rf $(builddir)/gammalib/_*.so
    rm -rf $(builddir)/gammalib/__pycache__

I executed the following sequence for testing:
make distclean
./configure
make -j8
./configure
make clean
make -j8
make -j8 distcheck

#3 Updated by Knödlseder Jürgen almost 8 years ago

  • Status changed from New to Closed
  • Assigned To set to Knödlseder Jürgen
  • Target version set to 1.2.0
  • % Done changed from 0 to 100

Merged into devel.

Also available in: Atom PDF