kmatheussen/radium

make ends on 'error 2'

dchmelik opened this issue · 24 comments

1. Steps to reproduce the problem.

  • Step 1:
#!/bin/sh
# radium_build
cd radium
make very_clean
export RADIUM_USE_CLANG=1
export INCLUDE_FAUSTDEV_BUT_NOT_LLVM=jadda
export RADIUM_QT_VERSION=5
make packages
#BUILDTYPE=RELEASE ./build_linux.sh -j `nproc`
#QT_QPA_PLATFORM_PLUGIN_PATH=`$(./find_moc_and_uic_paths.sh qmake) -query QT_INSTALL_PLUGINS` bin/radium
  • I expected this to happen: make packages

  • This is what actually happened: error 2 (gist)

  • I've tried this recipe several times.

  • The unexpected behavior has happened 100% of the times.

2. Which version of Radium are you using? df4d588 to fb9d199. Do you know if an earlier version has worked? No.

3. If relevant, which operating system did you run Radium on? Slackware64 15+current

Done, but it seems my redirect (radium_build 2>&1>~/radium_make_err_log.txt) didn't capture some output; the last three lines are below.

make[1]: *** [Makefile:212: pure-data/extra/choice/choice.pd_linux] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:850: bin/packages/deletemetorebuild] Error 2

@dchmelik can you check lib_pd branch is working for you: https://github.com/kmatheussen/radium/tree/lib_pd

@kmatheussen I also can't compile current master without removing sqrt definition in libpd-master.tar.gz

Error:

In file included from fiddle~.c:118:
fiddle~.c:45:15: error: conflicting types for ‘sqrt’; have ‘float(double)’
   45 | #define fsqrt sqrt

Fixed in lib_pd branch I don't know this fix can broke compilation on older systems.

@dchmelik Those three lines doesn't tell anything. Can you edit bin/packages/build.sh and comment out all packages except build_libpds and try again?

I.e. like this, in the bottom of the file:

#build_faust
#build_Visualization-Library
build_libpds
#build_qhttpserver
#build_gc
#build_fluidsynth
#build_libgig
#build_qscintilla
#build_xcb

@akimaze is "fsqrt" a real function? "man fsqrt" doesn't give any results. The float-version is called "sqrtf".

Also, there are no fsqrt-functions in the code:

kjetil@tthp:/radium/bin/packages/libpd-master$ grep -r fsqrt *
pure-data/extra/fiddle
/fiddle~.c:#define fsqrt sqrt
pure-data/extra/fiddle~/fiddle~.c:#define fsqrt sqrt
pure-data/extra/fiddle~/fiddle~.c:#define fsqrt sqrt
pure-data/extra/fiddle~/fiddle~.c: total_loudness = fsqrt(fsqrt(total_power));
pure-data/extra/fiddle~/fiddle~.c: stdev = fsqrt(var);
pure-data/extra/fiddle~/fiddle~.c: pk1->p_loudness = fsqrt(fsqrt(height));
pure-data/extra/fiddle~/fiddle~.c: cumstrength += fsqrt(fsqrt(peaklist[j].p_pow));
pure-data/extra/bonk~/bonk~.c:#define fsqrt sqrt

I guess the correct solution is just to remove all the "fsqrt" definitions, and replace all remaning "fsqrt" with "sqrtf".

@akimaze is "fsqrt" a real function? "man fsqrt" doesn't give any results. The float-version is called "sqrtf".

I haven't checked it thoroughly. Perhaps some other library defines it as well.
BTW. I also tried to use master of libpd but it's not working with Radium. Is it a lot of patching to update it?

I haven't checked it thoroughly. Perhaps some other library defines it as well.
BTW. I also tried to use master of libpd but it's not working with Radium. Is it a lot of patching to update it?

Probably a lot yes. Radium doesn't use "libpd", it uses "libpds"! (notice the extra "s"). It's a forked version of "libpd" that supports running more than one pd instance at once, and it's from 2014 I think.

It's probably possible to merge the two repositories though, but it's probably a lot of work: https://github.com/kmatheussen/libpd (92 commits ahead, 777 commits behind)

libpds also has support for GUI, which libpd doesn't.

Probably a lot yes. Radium doesn't use "libpd", it uses "libpds"! (notice the extra "s"). It's a forked version of "libpd" that supports running more than one pd instance at once, and it's from 2014 I think.

So the name of archive is misleading there is libpd-master.tar.gz in bin/packages ;)

@dchmelik any success compiling with my branch (https://github.com/kmatheussen/radium/tree/lib_pd) ?

I fixed the gist link; doesn't that help? I don't know how to get and compile the lib_pd branch.

I don't know how to get and compile the lib_pd branch.

Full recipe to compile lib_pd branch (that works for me):

git clone https://github.com/kmatheussen/radium.git
cd radium/
git checkout lib_pd

export RADIUM_QT_VERSION=5
export INCLUDE_FAUSTDEV_BUT_NOT_LLVM="jadda"
export QT_QPA_PLATFORM_PLUGIN_PATH=`$(./find_moc_and_uic_paths.sh qmake) -query QT_INSTALL_PLUGINS`
make packages
BUILDTYPE=RELEASE ./build_linux.sh -j `nproc`

Same error trying to build libpds (gist), lib_pd branch.

check this patch >> https://aur.archlinux.org/cgit/aur.git/tree/build_libpds.patch?h=radium7
it let's me compile it on artix
please check if puredata works as intended

Sadly I get the same error when compiling using the default method. When using the recipe from @akimaze it seems to compile on latest Fedora virtual machine (although the output goes into /tmp folder) but then I can't run the program on my main system which is openSUSE Tumbleweed due to missing libraries (I can run the demo though).

Had the same error and did a quick fix on the build script. Seems to have fixed that, though it's a little bit wonky I think.

sed -i 's/define fsqrt sqrt/define fsqrt ERROR/g' pure-data/extra/fiddle~/fiddle~.c
sed -i 's/fsqrt/sqrtf/g' pure-data/extra/fiddle~/fiddle~.c

@kmatheussen Just for your information. I still need remove line 45 from pure-data/extra/fiddle~/fiddle~.c (the line: #define fsqrt sqrt). With that line I have an error that leads to /usr/include/x86_64-linux-gnu/bits/mathcalls.h:

In file included from fiddle~.c:118:
fiddle~.c:45:15: error: conflicting types for ‘sqrt’; have ‘float(double)’
   45 | #define fsqrt sqrt
      |               ^~~~
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h:9,
                 from ../../src/m_pd.h:73,
                 from fiddle~.c:101:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:143:1: note: previous declaration of ‘sqrt’ with type ‘double(double)’
  143 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~

This is Linux Mint 21.1 based on Ubuntu 22.04.3 LTS.

Seems kjetil still uses glibc older than 2.35 to compile ?
https://lists.gnu.org/archive/html/info-gnu/2022-02/msg00002.html

* <math.h> functions that round their results to a narrower type, and
  corresponding <tgmath.h> macros, are added from TS 18661-1:2014, TS
  18661-3:2015 and draft ISO C2X:

  - fsqrt, fsqrtl, dsqrtl and corresponding fMsqrtfN, fMsqrtfNx,
    fMxsqrtfN and fMxsqrtfNx functions.

just a guess ...

@akimaze I know you have to do that manually on some systems. But I don't know how to change the script so that it compiles for everyone, well, until now that is. Thanks @yust1n for finding out that this might have changed in glibc 2.35. I'll add a test for that to the build script. Also, yes I use a glibc older than 2.35. Glibc 2.35 is not very old, so I need to use an older version of glibc in order to create binaries that works for most people.

@kmatheussen I tested the latest commit, and it works without any change in sources just git clone and compilation, so @yust1n 's prediction was accurate. Thank you :)

Thanks for testing. I assume it's fixed now.