opus icon indicating copy to clipboard operation
opus copied to clipboard

Build from Source on MSVC 2017 cl and MSYS2 32 bit

Open DineshGuptaa opened this issue 7 years ago • 4 comments

Hi ,

I am comipling the source code with MSVC 2017 & MSYS2 as Environment

 Machine OS: Windows 10 Prof
 Visual Studio C++ : 2017
 Windows SDK : 10.0.17763.0
 MYS2 32 : MSYS_NT-10.0-WOW | uname -m i686

Compiling opus:

	tar xzf $(OPUS)
	cd $(OPUSDIR); CC=cl ./configure --prefix=$(GADEPS) --with-pic
	make -C $(OPUSDIR) $(PARALLEL_MAKE)
	make -C $(OPUSDIR) install
	rm -rf $(OPUSDIR)

And I am getting error. please help.

tar xzf opus-1.3.tar.gz
cd opus-1.3; CC=cl ./configure --prefix=/d/smallgame/gaminganywhere/deps.posix --with-pic
configure: loading site script /mingw32/etc/config.site
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... i686-w64-mingw32
checking host system type... i686-w64-mingw32
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... cl
checking whether the C compiler works... yes
checking for C compiler default output file name... conftest.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... obj
checking whether we are using the GNU C compiler... no
checking whether cl accepts -g... yes
checking for cl option to accept ISO C89... none needed
checking whether cl understands -c and -o together... no
checking dependency style of /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl... msvc7
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for non-GNU ld... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw32/bin/nm -B
checking the name lister (/mingw32/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert i686-w64-mingw32 file names to i686-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert i686-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw32/bin/nm -B output from /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... yes
checking how to run the C preprocessor... /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... no
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... no
checking for dlfcn.h... no
checking for objdir... .libs
checking for /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl option to produce PIC... -DDLL_EXPORT -DPIC
checking if /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl PIC flag -DDLL_EXPORT -DPIC works... yes
checking if /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl static flag  works... yes
checking if /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl supports -c -o file.obj... yes
checking if /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl supports -c -o file.obj... (cached) yes
checking whether the /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl linker (/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... Win32 link.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl option to accept ISO C99... unsupported
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking dependency style of /d/smallgame/gaminganywhere/deps.src/opus-1.3/compile cl... msvc7
checking for C/C++ restrict keyword... no
checking for C99 variable-size arrays... no
checking alloca.h usability... no
checking alloca.h presence... no
checking for alloca.h... no
checking for alloca... no
checking for cos in -lm... no
checking if compiler supports SSE intrinsics... yes
checking if compiler supports SSE2 intrinsics... yes
checking if compiler supports SSE4.1 intrinsics... yes
checking if compiler supports AVX intrinsics... yes
checking How to get X86 CPU Info... configure: error: no supported Get CPU Info method, please disable run-time CPU capabilities detection or intrinsics
make: *** [Makefile:94: opus] Error 1

Thanks in advance...

DineshGuptaa avatar Dec 16 '18 15:12 DineshGuptaa

configure: error: no supported Get CPU Info method, please disable run-time CPU capabilities detection or intrinsics

This test is failing because it assumes gcc-style inline assembly language support, which cl doesn't provide. You'll need to add support for this compiler to the configure.ac script if you want this to succeed.

If that's more than you want to tackle, you might have better luck modifying Makefile.unix to use your compiler. See win32/config.h for more appropriate defines for Windows targets. Or you could try the experimental cmake build in #100.

Finally, you could try passing some combination of --disable-rtcd, --disable-asm, and --disable-intrinsics to configure to disable the optimized code. This will result in a slower library, of course.

rillian avatar Dec 17 '18 04:12 rillian

CMake changes are now in master and you can also soon use vcpkg for cross platform package build.

xnorpx avatar Apr 09 '19 13:04 xnorpx

"please disable run-time CPU capabilities detection" == --disable-rtcd

mmsarquis avatar Aug 18 '21 06:08 mmsarquis

Configure sucessfully when "--disable-rtcd" used, but still get build errors while building. error log: cl: command line error D8004 :“/W” need parameters

siriusht avatar Apr 02 '24 02:04 siriusht