Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A guide to compiling for a dummy in windows #3

Open
henrique-vazzz opened this issue Oct 1, 2020 · 11 comments
Open

A guide to compiling for a dummy in windows #3

henrique-vazzz opened this issue Oct 1, 2020 · 11 comments

Comments

@henrique-vazzz
Copy link

Hola, estimado Victor.

This issue is being submitted mainly for the purpose of elucidating the compilation procedures taking a "non-programmer" facing a windows machine into consideration. Any regard given would be in the best interest of the community.
Thanks in advance for the patience and understanding.

@sonoro1234
Copy link
Owner

Hi Henrique,

First you should download some programs:

GIT: https://gitforwindows.org/
CMAKE: https://cmake.org/download/

and one compiler (for 64 bits if you Supercollider is 64 bits)
MSVC: google for visual studio community 2019
or
MinGW-W64: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-posix/seh/

With git you should download Supercollider sources from github:
git clone --recursive https://github.com/supercollider/supercollider.git

Then follow the instructions given on: https://github.com/sonoro1234/MyUGens
where you can skip the cmake -G flag because having only one compiler it is not necessary

If everything goes ok it would be a great surprise!!
If not, cut and paste any error message in this issue and we will try to solve it.

@sonoro1234 sonoro1234 changed the title A guide to compiling for a dummy A guide to compiling for a dummy in windows Oct 2, 2020
@henrique-vazzz
Copy link
Author

Unable to point out by myself my own mistake and being as much optimistic as I can, I dare say it's almost got there but not quite... :-)

C:\>PATH= C:\Users\Laboratorio\Documents\CMake\bin\;%PATH%

C:\>cmake -DCMAKE_BUILD_TYPE=Release  -DSUPERNOVA=ON -DCMAKE_INSTALL_PREFIX=C:\Users\Laboratorio\AppData\Local\SuperCollider\Extensions\Victor_Bombi -DSC_PATH= C:\Users\Laboratorio\supercollider\MyUGens

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 6.1.7601.
-- The C compiler identification is MSVC 19.27.29112.0
-- The CXX compiler identification is MSVC 19.27.29112.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/
2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_BUILD_TYPE

-- Build files have been written to: C:/

C:\>cmake --build . --target install

Building Custom Rule C:/Users/Laboratorio/supercollider/MyUGens/AdachiAyers/CMak
  eLists.txt
  AdachiAyers.cpp
C:\Users\Laboratorio\supercollider\MyUGens\AdachiAyers\AdachiAyers.cpp(3,10): fatal error C1083: Não é possível abrir arquivo incluir: 'SC_PlugIn.h': No such file or directory [C:\AdachiAyers\AdachiAyers.vcxproj]
  
Building Custom Rule C:/Users/Laboratorio/supercollider/MyUGens/AdachiAyers/CMak
  eLists.txt
  AdachiAyers.cpp
C:\Users\Laboratorio\supercollider\MyUGens\AdachiAyers\AdachiAyers.cpp(3,10): fatal error C1083: Não é possível abrir arquivo incluir: 'SC_PlugIn.h': No such file or directory [C:\AdachiAyers\AdachiAyers_supernova.vcxproj]

Building Custom Rule C:/Users/Laboratorio/supercollider/MyUGens/DWGClarinet/CMak
  eLists.txt
  DWGClarinet.cpp
C:\Users\Laboratorio\supercollider\MyUGens\DWGReverb\dwglib\DWG.hpp(22,10): fatal error C1083: Não é possível abrir arquivo incluir: 'SC_PlugIn.h': No such file or directory [C:\DWGClarinet\DWGClarinet.vcxproj]

Building Custom Rule C:/Users/Laboratorio/supercollider/MyUGens/DWGClarinet/CMak
  eLists.txt
  DWGClarinet.cpp
C:\Users\Laboratorio\supercollider\MyUGens\DWGReverb\dwglib\DWG.hpp(22,10): fatal error C1083: Não é possível abrir arquivo incluir: 'SC_PlugIn.h': No such file or directory [C:\DWGClarinet\DWGClarinet_supernova.vcxproj]

Building Custom Rule C:/Users/Laboratorio/supercollider/MyUGens/DWGFlute/CMakeLi
  sts.txt
  DWGFlute.cpp
C:\Users\Laboratorio\supercollider\MyUGens\DWGReverb\dwglib\DWG.hpp(22,10): fatal error C1083: Não é possível abrir arquivo incluir: 'SC_PlugIn.h': No such file or directory [C:\DWGFlute\DWGFlute.vcxproj]
  
Building Custom Rule C:/Users/Laboratorio/supercollider/MyUGens/DWGFlute/CMakeLi
  sts.txt
  DWGFlute.cpp
C:\Users\Laboratorio\supercollider\MyUGens\DWGReverb\dwglib\DWG.hpp(22,10): fatal error C1083: Não é possível abrir arquivo incluir: 'SC_PlugIn.h': No such file or directory [C:\DWGFlute\DWGFlute_supernova.vcxproj]
...

...and so on for every subsequent building...

@sonoro1234
Copy link
Owner

sonoro1234 commented Oct 3, 2020

1 - You should not run cmake from C:\ as it will generate building files in C:\ which is terrible: create a directory sibling to C:\Users\Laboratorio\supercollider\MyUGens it could be for example C:\Users\Laboratorio\supercollider\buildMyUGens and run cmake from there.

2 - -DSC_PATH= C:\Users\Laboratorio\supercollider\MyUGens leaves -DSC_PATH empty and searchs cmake files on C:\Users\Laboratorio\supercollider\MyUGens. You should have the supercollider repository (not supercollider installed) in C:\Users\Laboratorio\supercollider\MyUGens in a sibling folder as: C:\Users\Laboratorio\supercollider\supercollider and point -DSC_PATH to it as -DSC_PATH= C:\Users\Laboratorio\supercollider\supercollider

The resulting cmake command would be:

C:\Users\Laboratorio\supercollider\buildMyUGens\>cmake -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=ON -DCMAKE_INSTALL_PREFIX=C:\Users\Laboratorio\AppData\Local\SuperCollider\Extensions\Victor_Bombi -DSC_PATH=C:\Users\Laboratorio\supercollider\supercollider ../MyUGens

I dont know what is in C:\Users\Laboratorio\supercollider but ideally it should only contain the three folders needed by the build process: supercollider(supercollider repository), MyUGens(MyUGens repository) and buildMyUGens(empty folder for building)

another point is that cmake says:

Manually-specified variables were not used by the project:

    CMAKE_BUILD_TYPE

According to https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html I thing that it is because cmake is generating a Visual Studio 16 2019 project as would be choosen by -G"Visual Studio 16 2019". If there is a problem whith that (I still dont know) you can also choose another compiler from MSVC as -G"NMake Makefiles" in the cmake command

@henrique-vazzz
Copy link
Author

1 - Let me expound the directories contents for your examination:

C:\Users\Henrique\SC\MyUGens contains the "MyUGens" repository;
C:\Users\Henrique\SC\supercollider contains the "Supercollider" repository;
C:\Users\Henrique\SC\buildMyUGens only contains the "cmake-3.18.3-win64-x64" folder.

2 - And now let me delineate the commands executed:

C:\>cd C:\Users\Henrique\SC\buildMyUGens\cmake-3.18.3-win64-x64\bin

cmake  -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=ON -DCMAKE_INSTALL_PREFIX= C:\Users\Henrique\AppData\Local\SuperCollider\Extensions\Victor_Bombi -DSC_PATH= C:\Users\Henrique\SC\supercollider

3 - The subsequent "errors":

-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 6.1.7601.
-- The C compiler identification is MSVC 19.27.29112.0
-- The CXX compiler identification is MSVC 19.27.29112.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/
2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SuperCollider Version: 3.11.1
-- Building from branch develop, commit hash is 96079e09a
-- Please specify the build configuration in the next step
-- Could NOT find ASIOSDK (missing: ASIOSDK_ROOT_DIR ASIOSDK_INCLUDE_DIR)
-- Could NOT find DXSDK (missing: DXSDK_ROOT_DIR DXSDK_INCLUDE_DIR)
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Compiling with Qt GUI
-- Using bundled boost
-- Using bundled yaml-cpp
-- HIDAPI components:
--     Windows
--     hidapi_parser
-- Building with HID support
-- Could NOT find Sndfile (missing: SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
CMake Error at server/plugins/CMakeLists.txt:129 (message):
  Cannot find libsndfile

CMake Error at server/plugins/CMakeLists.txt:199 (message):
  Cannot find libsndfile

-- Could NOT find Sndfile (missing: SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
-- FFT library (scsynth): Green
-- Audio API (scsynth): portaudio
CMake Error at server/scsynth/CMakeLists.txt:169 (message):
  Cannot find libsndfile

-- FFT library (supernova): Green
-- Audio API (supernova): portaudio
-- Could NOT find Sndfile (missing: SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
CMake Error at server/supernova/CMakeLists.txt:179 (message):
  Cannot find libsndfile

-- Could NOT find Sndfile (missing: SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
CMake Error at QtCollider/CMakeLists.txt:30 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" (requested
  version 5.7) with any of the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  lang/CMakeLists.txt:185 (include)

-- Configuring incomplete, errors occurred!
See also "C:/Users/Henrique/SC/buildMyUGens/cmake-3.18.3-win64-x64/bin/CMakeFile
s/CMakeOutput.log".

Let me know if you want the "CMakeOutput.log" fully discriminated...
Once more, accept my endless gratitude.
Your generosity overwhelms me.

@sonoro1234
Copy link
Owner

You were building supercollider.

The errors are:

C:\>cd C:\Users\Henrique\SC\buildMyUGens\cmake-3.18.3-win64-x64\bin

You should not run from there but from buildMyUGens with:

C:\>cd C:\Users\Henrique\SC\buildMyUGens

buildMyUGens should be empty and not contain cmake-3.18.3-win64-x64 that should be were it was in the other build (or perhaps you dont need it at all because I think MSVC has cmake included)

the error in the cmake command is: the last argument points to the repository to be built so in

cmake -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=ON -DCMAKE_INSTALL_PREFIX= C:\Users\Henrique\AppData\Local\SuperCollider\Extensions\Victor_Bombi -DSC_PATH= C:\Users\Henrique\SC\supercollider

you are pointing to build supercollider.
If you are inside buildMyUGens the command should be (no spaces after = and ../MyUGens as last argument)

cmake -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=ON -DCMAKE_INSTALL_PREFIX=C:\Users\Henrique\AppData\Local\SuperCollider\Extensions\Victor_Bombi -DSC_PATH=C:\Users\Henrique\SC\supercollider ../MyUGens

@henrique-vazzz
Copy link
Author

"And on the seventh day" it will get an end, I believe (jajaja), but, in the meantime though, what we got are:

1 - "CMake" is not recognized as an internal or external command, so I set the path myself:

C:\>PATH=C:\Users\Henrique\cmake-3.18.3-win64-x64\bin\;%PATH%

2 - "buildMyUGens" is now an empty directory:

C:\>cd C:\Users\Henrique\SC\buildMyUGens

3 - Since "MyUGens" is the last argument for -DSC_PATH, I assumed I should have included such repository in the "supercollider" source directory which induce the following command:

C:\Users\Henrique\SC\buildMyUGens>cmake -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=
ON -DCMAKE_INSTALL_PREFIX=C:\Users\Henrique\AppData\Local\SuperCollider\Extensio
ns\Victor_Bombi -DSC_PATH=C:\Users\Henrique\SC\supercollider\MyUGens

4 - The "warning" and the "error":

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

CMake Error: The source directory "C:/Users/Henrique/SC/buildMyUGens" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

@sonoro1234
Copy link
Owner

3 - Since "MyUGens" is the last argument for -DSC_PATH, I assumed I should have included such repository in the "supercollider" source directory which induce the following command:

../MyUGens is not the last argument for -DSC_PATH but the last argument for cmake. -DSC_PATH should point to supercollider repository.

MyUGens repository should not be inside supercollider repository but in a sibling folder (side by side): So inside C:\Users\Henrique\SC\ there should be three folders: buildMyUGens, supercollider and MyUGens (all three are sibling folders or side by side folder)

So the cmake command should be:

C:\Users\Henrique\SC\buildMyUGens>cmake -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=ON -DCMAKE_INSTALL_PREFIX=C:\Users\Henrique\AppData\Local\SuperCollider\Extensions\Victor_Bombi -DSC_PATH=C:\Users\Henrique\SC\supercollider   ..\MyUGens

@henrique-vazzz
Copy link
Author

Oh, dear Victor, it seems that some magic happened this time! I was getting stuck on the meaning of ..\MyUGens stated since the first instruction. Too many characters in the terminal to share, but I'm gonna leave these ones to summarize the whole atmosphere:

:-)

*note: the most recurring warning during the process concerned the "truncation/conversion" from "double" to "float" and from "float" to "int" with a possible data loss.

Getting further in the process, let me share things that go far beyond my comprehension:

1 - C:\Users\Henrique\AppData\Local\SuperCollider\Extensions\Victor_Bombi remains empty;

2 - For each "UGen" built into "buildMyUGens" directory I have subfolders containing scx.recipe files, for example: DWGClarinet directory contains a DWGClarinet.dir and a DWGClarinet_supernova.dir with a DWGClarinet.scx.recipe and a DWGClarinet_supernova.scx.recipe files respectively... Should I move them for somewhere?

If it seems that the compilation process well succeed, what is the next step?

@sonoro1234
Copy link
Owner

sonoro1234 commented Oct 5, 2020

if you used cmake --build . --target install after the build process is finished succesfuly (Was it succesful?) there will be some lines telling you where every file is installed.

I have just tried building with MSVC and there is an error in PitchTracker compilation, I have corrected the code so you should git clone MyUGens again. Or if you dont want to clone again you can just update using the following commands from inside MyUGens directory

git checkout master
git pull
git submodule update --init --recursive

You can set -DCMAKE_INSTALL_PREFIX="./scinstall" so that all the installed files will go in buildMyUGens\scinstall folder and from there you can manually move them where you desire. Just copy Myplugins folder and move it to one of the extensions directory of supercollider.

(you should move them to any of the folders that supercollider will point when asking for Platform.userExtensionDir
or Platform.systemExtensionDir)

For each "UGen" built into "buildMyUGens" directory I have subfolders containing scx.recipe files, for example: DWGClarinet directory contains a DWGClarinet.dir and a DWGClarinet_supernova.dir with a DWGClarinet.scx.recipe and a DWGClarinet_supernova.scx.recipe files respectively... Should I move them for somewhere?

Dont mess with this files, they are generated for the build process but they are not what you want.

@henrique-vazzz
Copy link
Author

...and finally the rabbit came out of the hat!

The "telling lines" appeared this time to report every file installed and the C:\Users\Henrique\AppData\Local\SuperCollider\Extensions\Victor_Bombi brought together a package full of happiness.

Things that extrapolate the purpose of this issue could be stated this way: I'm gonna meditate upon this journey and try to apply such great learning in a Manjaro machine; another resolution is keeping studying Lua2SC so that someday I can contribute to the "write sc files" issue.

Any last recommendation you could feel inclined to draw will be highly appreciated.

What remains is my gratitude for your spirit and generosity.

P.S. - Since you mentioned that if anyone interested in having sc classes for any other UGen you could possibly write them under the condition that somebody could test them, I'd love to address my interest in experimenting with your trombone/trumpet physical model.

@sonoro1234
Copy link
Owner

sonoro1234 commented Oct 6, 2020

I would appreciate it if you could write, now that you have had the experience, some kind of instructions about the process necessary for compiling MyUGens in windows. It would be addressed to people with your background and situation and I would add it to the readme.

I'd love to address my interest in experimenting with your trombone/trumpet physical model.

Just added AdachiAyers sc classes. AdachiAyers is difficult to use because output frequency depends on flip, mouth pressure and delay length. In Lua2SC I implemented some functions for getting flip and delay for a given desired output frequency and mouth pressure in the piece 7thtrumpet. Also implemented a control feedback delay loop for achieving the same goal that I will push to the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants