[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Request for help] mash



Hi Nilesh,

On Thu, Mar 11, 2021 at 12:30:37AM +0530, Nilesh Patra wrote:
> I was trying to make mash cross-buildable, since this has build-dep on
> sphinx, and also a doc package, it makes sense to move that to B-D-I
> The patch for changes I did is at the end of this mai

The idea is good in principle. I have a couple of remarks concerning the
implementation though.

> The native build doesn't get affected which is a good sign. However, now
> the cross compilation ends with:
> 
> g++ -c -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++14 -Isrc -I/usr/include -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2  -o src/mash/mash.o src/mash/mash.cpp
> g++ -c -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++14 -Isrc -I/usr/include -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2  -o src/mash/Sketch.o src/mash/Sketch.cpp
> g++ -c -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++14 -Isrc -I/usr/include -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2  -o src/mash/sketchParameterSetup.o src/mash/sketchParameterSetup.cpp
> g++ -c -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++14 -Isrc -I/usr/include -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2  -o src/mash/capnp/MinHash.capnp.o src/mash/capnp/MinHash.capnp.c++
> g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++14 -Isrc -I/usr/include -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2  -o mash src/mash/Command.o src/mash/CommandBounds.o src/mash/CommandContain.o src/mash/CommandDistance.o src/mash/CommandScreen.o src/mash/CommandTriangle.o src/mash/CommandFind.o src/mash/CommandInfo.o src/mash/CommandPaste.o src/mash/CommandSketch.o src/mash/CommandList.o src/mash/hash.o src/mash/HashList.o src/mash/HashPriorityQueue.o src/mash/HashSet.o src/mash/MinHashHeap.o src/mash/mash.o src/mash/Sketch.o src/mash/sketchParameterSetup.o src/mash/capnp/MinHash.capnp.o -lkj -lcapnp -L/usr/lib -lgsl -lgslcblas -lstdc++ -lz -lm -lpthread -lmurmurhash -Wl,-z,relro -Wl,-z,now
> ar -cr libmash.a src/mash/Command.o src/mash/CommandBounds.o src/mash/CommandContain.o src/mash/CommandDistance.o src/mash/CommandScreen.o src/mash/CommandTriangle.o src/mash/CommandFind.o src/mash/CommandInfo.o src/mash/CommandPaste.o src/mash/CommandSketch.o src/mash/CommandList.o src/mash/hash.o src/mash/HashList.o src/mash/HashPriorityQueue.o src/mash/HashSet.o src/mash/MinHashHeap.o src/mash/mash.o src/mash/Sketch.o src/mash/sketchParameterSetup.o src/mash/capnp/MinHash.capnp.o
> /usr/bin/ld: cannot find -lkj
> /usr/bin/ld: cannot find -lcapnp
> /usr/bin/ld: cannot find -lgsl
> /usr/bin/ld: cannot find -lgslcblas
> /usr/bin/ld: cannot find -lz
> /usr/bin/ld: cannot find -lmurmurhash
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:36: mash] Error 1
> make[1]: *** Waiting for unfinished jobs....
> ranlib libmash.a
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> dh_auto_build: error: make -j5 returned exit code 2
> make: *** [debian/rules:16: build-arch] Error 25
> dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2

It's an issue with the Makefile.in. While configure correctly detects a
cross compiler, the Makefile.in fails to pick it up. Usually a
Makefile.in contains lines such as:

    CXX = @CXX@

This one does not. When using automake, the Makefile.in is generated and
automake generates these lines. Since automake is not being used here,
these assignments must be given manually.

Also running uname -s in Makefile.in is bad (for cross compilation).
Such detection should happen at configure time and the resulting value
should be substituted (e.g. using AC_SUBST).

> -include /usr/share/dpkg/architecture.mk
> +#include /usr/share/dpkg/architecture.mk

Why?

> +include /usr/share/dpkg/buildtools.mk

How do you use this include?

> -	dh $@ --with sphinxdoc
> +	dh $@

Why do you entirely disable the sphinxdoc addon? I think it should be
enabled for arch:all builds. An easy way of doing so is adding
dh-sequence-sphinxdoc to Build-Depends-Indep.

> -override_dh_auto_build:
> -	dh_auto_build
> +override_dh_auto_build-indep:
> +	dh_auto_build --indep

Consider using execute_after_dh_auto_build-indep.

Helmut


Reply to: