SC3Plugins keeps failing to compile

I am trying to compile the latest version of SC3Plugins against the latest version of SuperCollider on Archlinux 6.9.4-arch1-1 - a process I have done many times. The terminal commands are as usual:

sudo  pacman -Syy && \
    sudo pacman -S base-devel git icu gcc cmake jack2 avahi alsa-utils libsndfile rsync \
    fftw libxt readline ncurses qt6-base boost  --needed --noconfirm && \
    git clone --recursive https://github.com/SuperCollider/SuperCollider.git && \
    git clone --recursive https://github.com/supercollider/sc3-plugins.git # && \
    cd sc3-plugins && \
    mkdir build && cd build && \
    cmake -DSC_PATH=../../SuperCollider -DCMAKE_BUILD_TYPE=Release -DNATIVE=ON  -DSC_EL=NO -DSUPERNOVA=OFF -DSYSTEM_BOOST=ON ..

However when I do:

cmake --build . --config Release --target install

I get:

[  1%] Building CXX object source/CMakeFiles/AntiAliasingOscillators.dir/AntiAliasingOscillators/AntiAliasingOscillators.cpp.o
In file included from /home/xxxxx/SuperCollider/include/plugin_interface/SC_PlugIn.h:25,
                 from /home/xxxxx/sc3-plugins/source/AntiAliasingOscillators/AntiAliasingOscillators.cpp:15:
/home/xxxxxx/SuperCollider/include/plugin_interface/SC_Unit.h:96:32: error: ‘copyAndCastToTypeOfFirstArg’ function uses ‘auto’ type specifier without trailing return type
   96 | [[nodiscard]] inline constexpr auto copyAndCastToTypeOfFirstArg(const ToType&, const Value& value) noexcept {
      |                                ^~~~
/home/xxxx/SuperCollider/include/plugin_interface/SC_Unit.h:96:32: note: deduced return type only available with ‘-std=c++14’ or ‘-std=gnu++14’
/home/xxxxx/SuperCollider/include/plugin_interface/SC_Unit.h: In function ‘constexpr auto copyAndCastToTypeOfFirstArg(const ToType&, const Value&)’:
/home/xxxxxxx/SuperCollider/include/plugin_interface/SC_Unit.h:97:26: error: ‘remove_cv_t’ in namespace ‘std’ does not name a template type; did you mean ‘remove_cv’?
   97 |     using TargetT = std::remove_cv_t<std::remove_reference_t<ToType>>;
      |                          ^~~~~~~~~~~
      |                          remove_cv
/home/xxxxxx/SuperCollider/include/plugin_interface/SC_Unit.h:98:24: error: ‘TargetT’ does not name a type
   98 |     return static_cast<TargetT>(value);
      |                        ^~~~~~~
make[2]: *** [source/CMakeFiles/AntiAliasingOscillators.dir/build.make:76: source/CMakeFiles/AntiAliasingOscillators.dir/AntiAliasingOscillators/AntiAliasingOscillators.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:484: source/CMakeFiles/AntiAliasingOscillators.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I cannot find any errors in the terminal commands I am using and a week ago i used the exact same commands and the plugins compiled without any problems. Has anyone else come across this issue on Arch or any distro other than Arch? I note that the cmake package on Arch was updated 1 week ago; it may be there’s a problem with that update. Thx.

Ah that is my code! I don’t know why it is failing because function uses ‘auto’ type specifier without trailing return type is a C++ 14 feature and supercollider uses C++17.

It looks like you are compiling with C++ 11 rather than 17.

I wonder if SCPlugin’s build script was ever upgraded to C++ 17?

Ah yes, that is exactly the problem…

	if(CPP11)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
		if(CMAKE_COMPILER_IS_CLANG)
			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
		endif()
	endif()

@KameronOspen
Alright, I’ve made a PR.

Its a quick fix and quite simple for you to apply to your own clone if you need to build right now.

My apologise for this, I didn’t actually build SCPlugins while testing because the change didn’t affect it.

1 Like

Ok thx Jordan. For anybody encountering similar problem; so now instead of

cmake -DSC _PATH=../../SuperCollider -DCMAKE_BUILD_TYPE=Realease -DNATIVE=ON -DSC_EL=NO -DSUPERNOVA=OFF .. 

I’m using:

cmake -DSC_PATH=../../SuperCollider -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_BUILD_TYPE=Release -DNATIVE=ON  -DSC_EL=NO -DSUPERNOVA=OFF .. 

SC3Plugins compiles OK now…

1 Like