re-cmake open source release

This forum is for developers of Rack Extensions to discuss the RE SDK, share code, and offer tips to other developers.
User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 02 Jan 2023

I released re-cmake 1.5.0 this morning with support for RE Edit. What it means is that you can simply type

./re.sh edit

and it will start RE Edit with your plugin so that you can edit it in a WYSIWYG editor (note that you must install RE Edit separately)

If you generate a new plugin with re-quickstart, the new command comes with it

Yan

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 29 Mar 2023

Hi Yan, I am having trouble getting re-cmake working.
I have downloaded the re-blank-plugin project, I am using Windows 10 and MS VS 2022.
When I run
python configure.py -p "C:\Users\murf\Projects\Reason\SDK"

I get:
-- Fetching re-cmake from https://github.com/pongasoft/re-cmake/a ... v1.5.0.zip
CMake Error: Error: generator : Visual Studio 17 2022
Does not match the generator used previously: Visual Studio 16 2019
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

If I remove CMakeCache.txt i get this:
CMake Error: The source directory "C:/Users/murf/Projects/Reason/MyReasonDev/ReasonProjects/MISC/re-blank-plugin" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Seems to be a bit of a catch 22 situation!

Any suggestions welcome.

thanks,
Murf.

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 30 Mar 2023

Murf wrote:
29 Mar 2023
Hi Yan, I am having trouble getting re-cmake working.
I have downloaded the re-blank-plugin project, I am using Windows 10 and MS VS 2022.
When I run
python configure.py -p "C:\Users\murf\Projects\Reason\SDK"

I get:
-- Fetching re-cmake from https://github.com/pongasoft/re-cmake/a ... v1.5.0.zip
CMake Error: Error: generator : Visual Studio 17 2022
Does not match the generator used previously: Visual Studio 16 2019
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

If I remove CMakeCache.txt i get this:
CMake Error: The source directory "C:/Users/murf/Projects/Reason/MyReasonDev/ReasonProjects/MISC/re-blank-plugin" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Seems to be a bit of a catch 22 situation!

Any suggestions welcome.

thanks,
Murf.
Solved! I just deleted the "build" folder.
Murf

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 30 Mar 2023

Murf wrote:
30 Mar 2023
Murf wrote:
29 Mar 2023
Hi Yan, I am having trouble getting re-cmake working.
I have downloaded the re-blank-plugin project, I am using Windows 10 and MS VS 2022.
When I run
python configure.py -p "C:\Users\murf\Projects\Reason\SDK"

I get:
-- Fetching re-cmake from https://github.com/pongasoft/re-cmake/a ... v1.5.0.zip
CMake Error: Error: generator : Visual Studio 17 2022
Does not match the generator used previously: Visual Studio 16 2019
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

If I remove CMakeCache.txt i get this:
CMake Error: The source directory "C:/Users/murf/Projects/Reason/MyReasonDev/ReasonProjects/MISC/re-blank-plugin" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Seems to be a bit of a catch 22 situation!

Any suggestions welcome.

thanks,
Murf.
Solved! I just deleted the "build" folder.
Murf
Yes. With CMake, it is always safer to delete the build folder or run configure.py with the -f option which deletes the build folder...

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 30 Mar 2023

pongasoft wrote:
30 Mar 2023
Murf wrote:
30 Mar 2023


Solved! I just deleted the "build" folder.
Murf
Yes. With CMake, it is always safer to delete the build folder or run configure.py with the -f option which deletes the build folder...
Thanks Yan.

What version of Visual Studio do you use? (or are you a Mac person?)

I could not get re-cmake working with 2019, as the cmake was too old. (3.20)
I upgraded to 2022 and then nothing worked, including my normal build environment!

I am back down at 2019 now, and was wondering about the best way to bump up cmake to the minimum required (3.24?) ?

Murf.

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 30 Mar 2023

Hmm now it is working with cmake v3.20 so all good!!!
Thanks again Yan for an awesome tool!
Murf.

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 31 Mar 2023

Yes I am a mac person but I do test it on Windows as well: I have tested it with Visual Studio Code (not Visual Studio) or directly the command line, but of course with the Visual Studio build tools 2019. I also install CMake separately (from the https://cmake.org/download/ page).

I don't see why Visual Studio build tools 2022 would not work, but I can give it a try...

User avatar
visheshl
Posts: 1220
Joined: 27 Sep 2019

Post 31 Mar 2023

Looks like an amazing tool, I'm inclined to try it, but I'm not that good with programming, especially dsp stuff... I'd rather leave it to the pros, I'll give ut a try sometime though

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 02 Apr 2023

pongasoft wrote:
31 Mar 2023
Yes I am a mac person but I do test it on Windows as well: I have tested it with Visual Studio Code (not Visual Studio) or directly the command line, but of course with the Visual Studio build tools 2019. I also install CMake separately (from the https://cmake.org/download/ page).

I don't see why Visual Studio build tools 2022 would not work, but I can give it a try...
Thanks Yan but no need, I am happy for the time being.

One question though, the C++ compiler seems to be more strict than when using build45.py, is there anyway to set cmake to use the same level of compliance please?

An example is that I have a library .cpp file that has a class that is not declared, it compiles fine for build45.py but not cmake:

C:\Users\murf\......\dsp\max\maximilian.cpp(758,6): error C2653: 'maxiSample': is not a class or namespace name

the code is:
bool maxiSample::load(string fileName, int channel) {
myPath = fileName;
readChannel=channel;
return read();
}


I could easily fix the library but I would rather it just did the same thing as build45.py if possible?

Thanks,
Murf.

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 03 Apr 2023

Murf wrote:
02 Apr 2023
pongasoft wrote:
31 Mar 2023
Yes I am a mac person but I do test it on Windows as well: I have tested it with Visual Studio Code (not Visual Studio) or directly the command line, but of course with the Visual Studio build tools 2019. I also install CMake separately (from the https://cmake.org/download/ page).

I don't see why Visual Studio build tools 2022 would not work, but I can give it a try...
Thanks Yan but no need, I am happy for the time being.

One question though, the C++ compiler seems to be more strict than when using build45.py, is there anyway to set cmake to use the same level of compliance please?

An example is that I have a library .cpp file that has a class that is not declared, it compiles fine for build45.py but not cmake:

C:\Users\murf\......\dsp\max\maximilian.cpp(758,6): error C2653: 'maxiSample': is not a class or namespace name

the code is:
bool maxiSample::load(string fileName, int channel) {
myPath = fileName;
readChannel=channel;
return read();
}


I could easily fix the library but I would rather it just did the same thing as build45.py if possible?

Thanks,
Murf.
Without more context about your project, it is hard for me to know why it works with build45.py and not cmake. I don't think it is because the compiler is more strict (it is the opposite...). Are you sure that the CMakeLists.txt file is including the right set of folders? Look at your build45.py INCLUDE_DIRS for example.

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 03 Apr 2023

pongasoft wrote:
03 Apr 2023
Murf wrote:
02 Apr 2023


Thanks Yan but no need, I am happy for the time being.

One question though, the C++ compiler seems to be more strict than when using build45.py, is there anyway to set cmake to use the same level of compliance please?

An example is that I have a library .cpp file that has a class that is not declared, it compiles fine for build45.py but not cmake:

C:\Users\murf\......\dsp\max\maximilian.cpp(758,6): error C2653: 'maxiSample': is not a class or namespace name

the code is:
bool maxiSample::load(string fileName, int channel) {
myPath = fileName;
readChannel=channel;
return read();
}


I could easily fix the library but I would rather it just did the same thing as build45.py if possible?

Thanks,
Murf.
Without more context about your project, it is hard for me to know why it works with build45.py and not cmake. I don't think it is because the compiler is more strict (it is the opposite...). Are you sure that the CMakeLists.txt file is including the right set of folders? Look at your build45.py INCLUDE_DIRS for example.
I just thought about something else: if you use the "local45" build command (./re.sh local45 or ./re.bat local45), then re-cmake generates a build45.py and uses it for the compilation. If you do that, does it work? Or do you get the same issue?

Thank you

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 03 Apr 2023

pongasoft wrote:
03 Apr 2023
pongasoft wrote:
03 Apr 2023


Without more context about your project, it is hard for me to know why it works with build45.py and not cmake. I don't think it is because the compiler is more strict (it is the opposite...). Are you sure that the CMakeLists.txt file is including the right set of folders? Look at your build45.py INCLUDE_DIRS for example.
I just thought about something else: if you use the "local45" build command (./re.sh local45 or ./re.bat local45), then re-cmake generates a build45.py and uses it for the compilation. If you do that, does it work? Or do you get the same issue?

Thank you
I solved it by removing the unused class from the library, but I will try this if I come across the issue again.
Thanks Yan!
Murf.

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 05 Apr 2023

Hi Yan, I have another issue with re-cmake now.
Not sure what is going on here, but when I declare this following SIMD typedef I get an error, but it builds fine with "re.bat local45"

Per the DOCs
https://developer.reasonstudios.com/doc ... types_simd

Code: Select all

typedef TJBox_Float32 float4x32 __attribute__((__vector_size__(16)));
Here is the error using "re.bat build"

Code: Select all

C:\Users\murf\Projects\MY_RE_Project\MY_RE\Constants.h(6,33): error C2146: syntax error: missing ';' before identifier '__attribute__' [
C:\Users\murf\Projects\MY_RE_Project\MY_RE\build\native-build.vcxproj]
C:\Users\murf\Projects\MY_RE_Project\MY_RE\Constants.h(6,48): error C3861: '__vector_size__': identifier not found [C:\Users\murf\Projec
ts\MY_RE_Project\MY_RE\build\native-build.vcxproj]
C:\Users\murf\Projects\MY_RE_Project\MY_RE\Constants.h(6,68): error C4430: missing type specifier - int assumed. Note: C++ does not supp
ort default-int [C:\Users\murf\Projects\MY_RE_Project\MY_RE\build\native-build.vcxproj]
I can keep working using re.bat local45 so no urgency, just wondered if it was something obvious?

Murf

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 21 Apr 2023

I just release a new version of re-cmake 1.6.0 which solves the issue that Murf was encountering.
  • Uses Clang toolchain on Windows by default:
    • SIMD support out of the box (SIMD does not work without Clang)
    • Use a similar compiler provided with the RE SDK
Windows Instructions:

Make sure you provision the build tools properly: using the Visual Studio Installer, select the "Individual components" tab, search for "clang" and make sure that "C++ Clang..." is selected (there may be more than one entry, so select all of them).

Image

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 21 Apr 2023

Thanks Yan for solving this, you are legend.

Here is my current SIMD bridge header for those who want to be able to compile standard SIMD intrinsics code without converting it.
There are a few things missing but I will update it as I solve more of them.
Murf
You do not have the required permissions to view the files attached to this post.

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 10 May 2023

Hi Yan, I am trying to compile with the -O3 optimization flag.
It works fine using build45.py with reason build workflow but I get this with cmake:

clang-cl : warning : argument unused during compilation: '-O3'

Any ideas please? I have a very CPU intensive phy modelling algorithm that just wont work w/o this.
Thanks,
Murf.

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 10 May 2023

It might be because you are building in debug mode. Have you tried building in release mode? (using -R) option? If that doesn't work, ping me at my email and I will see what I can do.

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 10 May 2023

I just tried without any option at all: if you compile (on Windows) in Debug mode, this is what you get

Code: Select all

  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe /c /I"D:\Downloads\com.acme.TestO3-plugin\build\re-logging-src\src\cpp\logging" /I"D:\Downloads\c
  om.acme.TestO3-plugin\build\generated" /IC:\Users\Public\Documents\ReasonStudios\JukeboxSDK_4.3.0\SDK\API /Z7 /nologo /W1 /WX- /diagnostics:column /Od /Ob0 /D _WINDLL /D _MBCS /D WIN32 /D _WINDOW
  S /D LOCAL_NATIVE_BUILD=1 /D DEBUG=1 /D "CMAKE_INTDIR=\"Debug\"" /D native_build_EXPORTS /EHsc /MDd /GS /fp:precise /std:c++17 /Fo"native-build.dir\Debug\\" /Gd /TP -m64  "D:\Downloads\com.acme.T
  estO3-plugin\src\cpp\Device.cpp" "D:\Downloads\com.acme.TestO3-plugin\src\cpp\JukeboxExports.cpp" "D:\Downloads\com.acme.TestO3-plugin\build\re-logging-src\src\cpp\logging\loguru.cpp"
 
If you compile in release mode (-R flag), you get this instead:

Code: Select all

  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe /c /I"D:\Downloads\com.acme.TestO3-plugin\build\re-logging-src\src\cpp\logging" /I"D:\Downloads\c
  om.acme.TestO3-plugin\build\generated" /IC:\Users\Public\Documents\ReasonStudios\JukeboxSDK_4.3.0\SDK\API /nologo /W1 /WX- /diagnostics:column /O2 /Ob2 /D _WINDLL /D _MBCS /D WIN32 /D _WINDOWS /D
   NDEBUG /D LOCAL_NATIVE_BUILD=1 /D DEBUG=1 /D "CMAKE_INTDIR=\"Release\"" /D native_build_EXPORTS /EHsc /MD /GS /fp:precise /std:c++17 /Fo"native-build.dir\Release\\" /Gd /TP -m64  "D:\Downloads\c
  om.acme.TestO3-plugin\src\cpp\Device.cpp" "D:\Downloads\com.acme.TestO3-plugin\src\cpp\JukeboxExports.cpp" "D:\Downloads\com.acme.TestO3-plugin\build\re-logging-src\src\cpp\logging\loguru.cpp"
  
The key difference is that
* in Debug mode, you get "/Od /Ob0"
* in Release mode, you get "/O2 /Ob2"

Seems that O2 is the max level anyway:

Code: Select all

  /O1                     Optimize for size  (like /Og     /Os /Oy /Ob2 /GF /Gy)
  /O2                     Optimize for speed (like /Og /Oi /Ot /Oy /Ob2 /GF /Gy)
  /Ob0                    Disable function inlining
  /Ob1                    Only inline functions explicitly or implicitly marked inline
  /Ob2                    Inline functions as deemed beneficial by the compiler
  /Od                     Disable optimization
  /Og                     No effect
  /Oi-                    Disable use of builtin functions
  /Oi                     Enable use of builtin functions
  /openmp-                Disable OpenMP support
  /openmp:experimental    Enable OpenMP support with experimental SIMD support
  /openmp                 Enable OpenMP support
  /Os                     Optimize for size
  /Ot                     Optimize for speed
  /Ox                     Deprecated (like /Og /Oi /Ot /Oy /Ob2); use /O2
  /Oy-                    Disable frame pointer omission (x86 only, default)
  /Oy                     Enable frame pointer omission (x86 only)
  /O<flags>               Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'
  
So you just need to compile in release mode to get an optimized version

Yan

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 10 May 2023

You can have different compile options applied for the different types of build (native vs jbox):

Code: Select all

#    COMPILE_OPTIONS  -Myoption                      # applies to both types of build
#   NATIVE_COMPILE_OPTIONS -Wall                     # applies to native build only
    JBOX_COMPILE_OPTIONS   -Wall -O3                 # applies to jbox build only

User avatar
Murf
RE Developer
Posts: 610
Joined: 21 Jun 2019
Location: Brisbane, Australia

Post 01 Jun 2023

Thanks Yan, I will give that a try.

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 03 Jul 2023

Just released a new version 1.7.0 of re-cmake to support the (currently beta) version of RE SDK 4.4.0 (native arm64 support)

  • Handles RE SDK 4.4.0: on macOS/arm64 platform, generate an arm64 binary (with proper name)
  • Fixed options (removed FORCE since the rack extension can define it first thus can override it!)
  • Prints a message when re-cmake detects a mismatch in version
Note that RE Quickstart and RE Convert have both been updated accordingly

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 08 Sep 2023

As an FYI, due to some changes in the final release of SDK 4.4.0, there is a failure with re-cmake which I am investigating...

User avatar
pongasoft
RE Developer
Posts: 477
Joined: 21 Apr 2016
Location: Las Vegas

Post 11 Sep 2023

I pushed a fix to address the issue with SDK 4.4.0 final: v1.7.1

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest