csound / csound

Main repository for Csound
https://csound.com
GNU Lesser General Public License v2.1
1.24k stars 191 forks source link

build fail on AlmaLinux 9.0 #1630

Closed jmd28 closed 2 years ago

jmd28 commented 2 years ago

I am trying to build the latest version of the develop branch on AlmaLinux 9.0 by following the instructions under "general linux without root" in BUILD.md.

Warnings being treated as errors by default, meaning that make install does not complete, failing at Engine/musmon.c.o. I think this means that -Werror compiler flag is being set somewhere but I can't work it out where. The CFLAGS environment variable is set to -Wno-error, but this seems to make no difference. The build also fails if I pass the -k flag to make install. Please could someone help me get to the bottom of this? Apologies if raising an issue is the wrong procedure here - I have struggled to find answers elsewhere.

Thanks!

Below is the output of make install from within csound/build after completing all steps described in BUILD.md.

--- TRUNCATED ---
[  2%] Building C object CMakeFiles/csound64.dir/Engine/musmon.c.o
/usr/lib64/ccache/cc -DCS_DEFAULT_PLUGINDIR=\"/home/jmd28/Documents/lib/csound/plugins64-7.0\" -DCS_DEFAULT_USER_PLUGINDIR=\".local/lib/csound/7.0/plugins64\" -DHAVE_EXECINFO -DHAVE_SOCKETS -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DLINUX -DNO_FLTK_THREADS -DPIPES -D_CSOUND_RELEASE_ -D_GNU_SOURCE -Dcsound64_EXPORTS -I/home/jmd28/Documents/src/csound/ENV{HOME}/Documents/include -I/home/jmd28/Documents/include -I/home/jmd28/Documents/src/csound/./H -I/home/jmd28/Documents/src/csound/./include -I/home/jmd28/Documents/src/csound/./Engine -I/home/jmd28/Documents/src/csound/./util -I/home/jmd28/Documents/src/csound/. -I/home/jmd28/Documents/src/csound/build -I/home/jmd28/Documents/src/csound/build/include -ffast-math -mfpmath=sse -msse2 -fomit-frame-pointer -DBETA -Wall -Werror -Wno-missing-field-initializers -fvisibility=hidden -std=gnu99 -DUSE_LIBSNDFILE -DHAVE_ATOMIC_BUILTIN -DHAVE_CURL -DHAVE_PTHREAD -g -fPIC -D__BUILDING_LIBCSOUND -DHAVE_PTHREAD_SPIN_LOCK -DHAVE_PTHREAD_BARRIER_INIT -DPARCS -DGNU_GETTEXT -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H -DHAVE_VALUES_H -MD -MT CMakeFiles/csound64.dir/Engine/musmon.c.o -MF CMakeFiles/csound64.dir/Engine/musmon.c.o.d -o CMakeFiles/csound64.dir/Engine/musmon.c.o -c /home/jmd28/Documents/src/csound/Engine/musmon.c
/home/jmd28/Documents/src/csound/Engine/musmon.c: In function ‘sensevents’:
/home/jmd28/Documents/src/csound/Engine/musmon.c:66:1: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
   66 | if(csound->oparms->realtime) \
      | ^~
/home/jmd28/Documents/src/csound/Engine/musmon.c:1023:3: note: in expansion of macro ‘RT_SPIN_UNLOCK’
 1023 |   RT_SPIN_UNLOCK
      |   ^~~~~~~~~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:68:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   68 |   trylock = CSOUND_SUCCESS; } }
      |   ^~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:1023:3: note: in expansion of macro ‘RT_SPIN_UNLOCK’
 1023 |   RT_SPIN_UNLOCK
      |   ^~~~~~~~~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:66:1: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
   66 | if(csound->oparms->realtime) \
      | ^~
/home/jmd28/Documents/src/csound/Engine/musmon.c:1056:11: note: in expansion of macro ‘RT_SPIN_UNLOCK’
 1056 |           RT_SPIN_UNLOCK
      |           ^~~~~~~~~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:68:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   68 |   trylock = CSOUND_SUCCESS; } }
      |   ^~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:1056:11: note: in expansion of macro ‘RT_SPIN_UNLOCK’
 1056 |           RT_SPIN_UNLOCK
      |           ^~~~~~~~~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:66:1: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
   66 | if(csound->oparms->realtime) \
      | ^~
/home/jmd28/Documents/src/csound/Engine/musmon.c:1251:5: note: in expansion of macro ‘RT_SPIN_UNLOCK’
 1251 |     RT_SPIN_UNLOCK
      |     ^~~~~~~~~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:68:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   68 |   trylock = CSOUND_SUCCESS; } }
      |   ^~~~~~~
/home/jmd28/Documents/src/csound/Engine/musmon.c:1251:5: note: in expansion of macro ‘RT_SPIN_UNLOCK’
 1251 |     RT_SPIN_UNLOCK
      |     ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/csound64.dir/build.make:267: CMakeFiles/csound64.dir/Engine/musmon.c.o] Error 1
make[2]: Leaving directory '/cs/home/jmd28/Documents/src/csound/build'
make[1]: *** [CMakeFiles/Makefile2:463: CMakeFiles/csound64.dir/all] Error 2
make[1]: Leaving directory '/cs/home/jmd28/Documents/src/csound/build'
make: *** [Makefile:169: all] Error 2
vlazzarini commented 2 years ago

Try setting CMAKE_BUILD_TYPE="Release" and see if it works for you.

jmd28 commented 2 years ago

Perfect that's done the trick - I just needed to change that value in Custom.cmake.