Can build package with native cmake but failed when using OBS.

Hello,

I have been trying to build tinyspline.
https://github.com/msteinbeck/tinyspline

I could not build tinyspline with OBS.
The fatal error is

   55s] /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:2069: undefined reference to `sqrt'
   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /tmp/libtinyspline.so.zq5CGP.ltrans0.ltrans.o: in function `ts_bspline_interpolate_catmull_rom':
   55s] /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:987: undefined reference to `pow'
   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:988: undefined reference to `pow'
   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:989: undefined reference to `pow'


I ask about this error to the author of tinyspline which the author fix it but would not work with OBS.
https://github.com/msteinbeck/tinyspline/issues/152

I tried building with normal cmake like wise and it pass.

wget https://github.com/msteinbeck/tinyspline/archive/snapshot.tar.gz
tar xf snapshot.tar.gz
cd tinyspline-snapshot
mkdir build
cd build
cmake ..
cmake --build .

I don’t understand why building with OBS did not work but building with normal cmake work.

Here is my spec file: https://build.opensuse.org/package/view_file/home:andythe_great/tinyspline/tinyspline.spec?expand=1
Here is the error log: https://build.opensuse.org/package/live_build_log/home:andythe_great/tinyspline/openSUSE_Tumbleweed/x86_64

Thanks.

Hi
When you build without the macro check the cmake, ldflags etc, or just build without the macro. Or work with upstream to review the OBS method and implement changes…

Hello,

Did you mean that the OBS change some flags that make it different from normal cmake and make it failed?

Hi
Yes, but they are checking the code in a more robust way, hence some things fail, which is likely an upstream issue with the pow error.

There were a few fixes to get libheif building with cmake (working with another user on this)…

Hello,

Any suggestion on where to report this issue?

Hi
Well it’s still missing the -lm link… upstream with the tinyspline dev…


**Working with the c++ link ** Looks like the static link **

   55s] /usr/bin/c++  -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -O2 -g -DNDEBUG  -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now CMakeFiles/time_series.dir/time_series.cpp.o  -o time_series  ../../lib/libtinysplinecpp.a -lm


**Not working with the cc link ** Looks like the shared link **

   55s] cd /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/tinyspline_shared.dir/link.txt --verbose=1
   55s] /usr/bin/cc -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -std=c89 -O2 -g -DNDEBUG -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -lm -shared -Wl,-soname,libtinyspline.so -o ../lib/libtinyspline.so CMakeFiles/tinyspline_shared.dir/tinyspline.c.o CMakeFiles/tinyspline_shared.dir/parson.c.o 

   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /tmp/libtinyspline.so.zq5CGP.ltrans0.ltrans.o: in function `ts_distance':
   55s] /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:2069: undefined reference to `sqrt'
   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /tmp/libtinyspline.so.zq5CGP.ltrans0.ltrans.o: in function `ts_bspline_interpolate_catmull_rom':
   55s] /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:987: undefined reference to `pow'
   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:988: undefined reference to `pow'
   55s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/tinyspline-0.2.0+git.1584996308.33462b8/src/tinyspline.c:989: undefined reference to `pow'

Tinyspline dev told me that they already fix that issue.

Update

With lastest tinyspline update, I can build it now, not sure if it because of tinyspline or update in OBS.

https://build.opensuse.org/package/show/home:andythe_great/tinyspline