Conan problem compiling for windows

I’m having an issue with a cmake error while trying to compile Audacity 3.4.0 x64 in Windows with ASIO support. I’ve followed the instructions in the BUILD.md and in several other posts but it dies in the cmake with the following.

Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
The ASM_NASM compiler identification is unknown
Didn't find assembler
Build Info:
  Host System: Windows-10.0.19045
  Host System Name: Windows
  Host System Processor: AMD64
  Host System Version: 10.0.19045
  Host System Architecture: 64-bit

  Compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
  Compiler Version: 19.37.32825.0
  Compiler Standard: 17
  Compiler Standard Required: ON
  Compiler Extensions: 

  MSVC Version: 1937
  MSVC Toolset: 143

  Current Commit: unknown

========== Using Conan version of ZLIB ==========
========== Using Conan version of EXPAT ==========
========== Using Conan version of PNG ==========
========== Using Conan version of JPEG ==========
========== Using Conan version of wxWidgets ==========
========== Using Conan version of libmp3lame ==========
========== Using Conan version of mpg123 ==========
========== Using Conan version of libid3tag ==========
========== Using Conan version of WavPack ==========
========== Using Conan version of Ogg ==========
========== Using Conan version of FLAC ==========
========== Using Conan version of Opus ==========
========== Using Conan version of opusfile ==========
========== Using Conan version of Vorbis ==========
========== Using Conan version of SndFile ==========
========== Using Conan version of PortAudio ==========
========== Using Conan version of RapidJSON ==========
========== Using Conan version of PortMidi ==========
========== Using Conan version of vst3sdk ==========
========== Using Conan version of Catch2 ==========
Traceback (most recent call last):
  File "E:\Src\Audacity\conan\conan_runner.py", line 91, in <module>

    conan_version = validate_conan(required_conan_version)

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Src\Audacity\conan\helpers\conan_environment.py", line 141, in validate_conan

    conan_version = get_conan_version()
                    ^^^^^^^^^^^^^^^^^^^
  File "E:\Src\Audacity\conan\helpers\conan_environment.py", line 90, in get_conan_version

    version_string = subprocess.check_output([get_conan(), '--version']).decode('utf-8').strip()

                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python312\Lib\subprocess.py", line 466, in check_output

    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\subprocess.py", line 548, in run

    with Popen(*popenargs, **kwargs) as process:

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\subprocess.py", line 992, in __init__

    errread, errwrite) = self._get_handles(stdin, stdout, stderr)

                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\subprocess.py", line 1348, in _get_handles

    p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

OSError: [WinError 6] The handle is invalid

CMake Error at cmake-proxies/cmake-modules/AudacityDependencies.cmake:209 (message):
  Conan failed to install dependencies (1) C:/Program
  Files/Python312/python.exe
Call Stack (most recent call first):
  CMakeLists.txt:578 (include)


Configuring incomplete, errors occurred!

I’ve installed and reinstalled several different versions of conan with the same results.
TIA for any suggestions.

Note:

If you have tried conan 2.x with unsatisfactory results, then repost your query on Discord #dev-general here: Audacity dev

Conan --version returns 2.0.13. I’m pretty sure that I cloned the 3.4.0 version of Audacity. Where do you find the Version in the source headers?

repost your query on Discord #dev-general here: Audacity dev

I’ll give that a try, thank you for your help.

I checked there, one other user with the identical problem, no answers. I’ll just put the project on hold for a bit and wait to see if anyone posts a solution.

After trying a number of different things I believe the problem was that cmake-gui was not spawning conan for some reason.
I did the initial configure in cmake-gui and it error-ed out here…
version_string = subprocess.check_output([get_conan(), ‘–version’]).decode(‘utf-8’).strip()
which should have run conan --version but did not return a handle to the output.

The fix… Open a command prompt, do a “cd \src\audacity-build”, and do a “cmake .”

Glad to hear it is working now for you and thanks for posting your fix. :grinning:

So step by step what worked for me as I had to repeat it a couple of times having downloaded Audacity 3.5.0-alpha the first time.
Do all the steps in the BUILDING.md - install all of the prerequisites. Python, cmake, visual studio, conan. I downloaded the ASIO dev kit but never did anything with it.
Git or download the right set of source code for Audacity.
With cmake-gui set up the compiler, source directory, build directory. Pick x64 because even though it says that it is the default it defaults to Program Files (x86) for a install target if you don’t.
Config - it errors, check box the ASIO support, generate - it errors again but will set all of the compile directives.
Close cmake-gui, open a CMD window, cd to the build directory, run cmake . (or cmake \path\to\build) and let it do its thing. conan will download of the requirements etc.
Open cmake-gui and do a generate again which should complete and enable the open Visual Studio button. Click, into Visual Studio, pick the release target, and build.

Hopefully this spares the next person a day of banging head against desk.

2 Likes

Been there, done that! :wink:

I just updated my ASIO build script to 3.4

It’s aimed at non techy folks with no dev env but might work without the --install option if you have the same VS version.

Mind you given all the problems listed here I might have to roll back or give a version option, a pain given the different conan versions.

Thanks for posting. I remember using your script a few years back. :grinning:

I vote for 3.4.1 which is likely just around the corner. :wink:

1 Like

Coo.

After way to much fiddling the script now builds 3.3.3 unless you specify 3.4.

I’ll keep an eye out for updates as usual.

Maybe the script could be added to the BUILDING.md. it does appear on one of several pages on ASIO.

Here is my procedure how to compile Audacity 3.3.x

Fix the compiler version bug:
conan\conan_runner.py

def get_conan_compiler_version(args):
    if args.compiler == 'MSVC':
        ver = version_tuple(args.compiler_version)

        if ver[0] < 19:
            raise RuntimeError(f'Visual Studio {args.compiler_version} is not supported')
        else:
            # Specific modification for version 19.41
            if ver[1] == 41:
                return 17
            else:
                return ver[1] // 10 - 2 + 16
    else:
        compiler_version = version_tuple(args.compiler_version)

        if args.compiler == 'AppleClang' and compiler_version[0] < 13:
            return f'{compiler_version[0]}.{compiler_version[1]}'

        return version_tuple(args.compiler_version)[0]
-------------------------------------------------------------------------

run Anaconda Prompt

conda create -n p10 python=3.10

conda activate p10

conda install cmake

pip install conan==1.59.0

cd <Audacity source directory>

del CMakeCache.txt
rmdir /s /q CMakeFiles

mkdir build
cd build
cmake ..