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

Floating Point libraries failing to build when targeting Fixed Point support only. MSVC 2017 v141 #348

Open
theyyg opened this issue May 22, 2024 · 3 comments

Comments

@theyyg
Copy link

theyyg commented May 22, 2024

I'm trying to build the opus library from source. My target is Windows 10.0.17763.0 x64 using the v141 (Visual Studio 2017) toolset. My use case needs to decode a 16-bit fixed-point opus.

I was able to generate the opus library and several accompanying projects when using OPUS_ENABLE_FLOAT_API=ON. I was also able to build without problems.

Then, I started configuring for my desired build. I disabled this option (as we're not using floating point) and enabled OPUS_FIXED_POINT=ON. Visual Studio projects were generated without issue, but when trying to build, I received this error.

`

------ Build All started: Project: opus, Configuration: x64-Debug ------
[1/5] Building C object CMakeFiles\opus.dir\silk\float\x86\inner_product_FLP_avx2.c.obj
FAILED: CMakeFiles/opus.dir/silk/float/x86/inner_product_FLP_avx2.c.obj
C:\PROGRA2\MICROS2\2019\COMMUN1\VC\Tools\MSVC\14161.270\bin\HostX64\x64\cl.exe /nologo -DCUSTOM_MODES -DDISABLE_DEBUG_FLOAT -DDISABLE_FLOAT_API -DDLL_EXPORT -DENABLE_HARDENING -DFIXED_POINT=1 -DHAVE_CONFIG_H -DHAVE_LRINT -DHAVE_LRINTF -DOPUS_BUILD -DOPUS_HAVE_RTCD -DOPUS_X86_MAY_HAVE_AVX2 -DOPUS_X86_MAY_HAVE_SSE -DOPUS_X86_MAY_HAVE_SSE2 -DOPUS_X86_MAY_HAVE_SSE4_1 -DOPUS_X86_PRESUME_SSE -DOPUS_X86_PRESUME_SSE2 -DUSE_ALLOCA -D_CRT_SECURE_NO_WARNINGS -Dopus_EXPORTS -I......\include -I. -I......\ -I......\dnn -I......\celt -I......\silk -I......\silk\fixed /DWIN32 /D_WINDOWS /Zi /Ob0 /Od /RTC1 -MDd /w44244 /w44305 /w44267 /GS /arch:AVX2 /showIncludes /FoCMakeFiles\opus.dir\silk\float\x86\inner_product_FLP_avx2.c.obj /FdCMakeFiles\opus.dir\ /FS -c ......\silk\float\x86\inner_product_FLP_avx2.c
D:\dev\git\opus\opus\silk\float\x86\inner_product_FLP_avx2.c(33): fatal error C1083: Cannot open include file: 'SigProc_FLP.h': No such file or directory
ninja: build stopped: subcommand failed.

Build All failed.
`

It appears to try and compile some of the floating point code when targeting fixed point, but the headers are not included. I'm a novice with CMake, so I'm looking for some guidance. I'll dive in and try to track down the problem in the meantime.

Additional Info/Context:

I'm not currently working with the absolute latest code. My revision is at commit 20568812 * README related osce fixes III from 3 weeks ago. I will update and see if it's still an issue.

I have verified this using the built-in tools for a CMake project in Visual Studio 2019 (VS 2019) and with the command prompt also using the CMake version shipping with 2019. If needed, I will also post the output when running in command prompt as it doesn't use ninja and provides more verbose errors.
Using VS 2017 was not an options as the accompanying CMake version is too old. The project which needs to use opus is managed with VS 2017, but I intend to build with the v141 toolset and move the built library.

@theyyg
Copy link
Author

theyyg commented May 22, 2024

As a work around, removing 'inner_product_FLP_avx2.c' from the generated project allows the library to build successfully. I'll see if I can find where in the CMake files that the this file is included in the opus project.

@xnorpx
Copy link
Contributor

xnorpx commented May 22, 2024

maybe something like?

if(NOT OPUS_FIXED_POINT)
    add_sources_group(opus silk ${silk_sources_float_avx2})
endif()

@theyyg
Copy link
Author

theyyg commented May 22, 2024

Yep, I've created a pull request. I went the other direction though:

if (OPUS_ENABLE_FLOAT_API)
  add_sources_group(opus silk ${silk_sources_float_avx2})
endif()

#349

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