Help - Search - Members - Calendar
Full Version: mingw to compile lame
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
bluesky
I've been trying to compile lame on mingw 3.2.0-rc3 and msys 1.0.11 on my win32 mahcine. The only way I could get it to work is with this:

CODE
$ ./configure --prefix=/mingw --enable-nasm --disable-gtktest --disable-decoder
$ make
$ make install


What is the command line to compile an Athlon XP optimized binary? I've read some threads about this here, but I will admit to not understanding them. I have no programing skills to speak of so please be nice in your replies.

Thanks all.
bluesky
No one else uses mingw to compile lame? What do you all use?
rjamorim
MSVC, ICL... :B
Garf
Instead of

make

try

make CFLAGS="-O3 -march=athlonxp -mtune=athlonxp"
bluesky
Here's what I did based on your suggestion:

CODE
$ ./configure --prefix=/mingw --enable-nasm --disable-gtktest --disable-decoder
CFLAGS="-march=athlon-xp -O3 -pipe -ffast-math -fomit-frame-pointer -fsched-sp
ec-load -fforce-addr -mtune=athlon-xp" CXXFLAGS="-march=athlon-xp -O3 -pipe -ff
ast-math -fomit-frame-pointer-fsched-spec-load -fforce-addr -mtune=athlon-xp";
make CFLAGS="-O3 -march=athlon-xp -mtune=athlon-xp"; make install


It gives me lame.exe okay, but when I compare the output to the icl version of lame I got from rarewares.org, mine seems to be lacking the "CPU features: MMX (ASM used), 3DNow! (ASM used), SSE" line that the intel build has... here's the output from my build:

CODE
D:\incoming>lame test.wav --alt-preset extreme
LAME version 3.96.1 (http://lame.sourceforge.net/)
Using polyphase lowpass filter, transition band: 19383 Hz - 19916 Hz
Encoding test.wav to test.wav.mp3
Encoding as 44.1 kHz VBR(q=0) j-stereo MPEG-1 Layer III (ca. 5.7x) qval=3


And here's the output from the ICL build from rarewares.org:

CODE
D:\incoming>lame test.wav --alt-preset extreme
LAME version 3.96.1 (http://lame.sourceforge.net/)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE
Using polyphase lowpass filter, transition band: 19383 Hz - 19916 Hz
Encoding test.wav to test.mp3
Encoding as 44.1 kHz VBR(q=0) j-stereo MPEG-1 Layer III (ca. 5.7x) qval=3
Garf
Do you have nasm installed?
bluesky
Actually, I'm using nasmw. My mistake in the post.
Bogalvator
Bluesky,

I too tried for ages to get a nasm build with MinGW and had no success, until I ditched the "./configure" approach and used the Makefile.unix file that comes with the Lame sourcecode.

First off, make a copy of the 'configMS.h' file in the lame directory, and rename the copy to 'config.h'

Second, make sure you have a 'nasmw.exe' installed in your mingw/bin directory (either by renaming 'nasm.exe' or by installing the latest nasm for Win32 package from Sourceforge)

Thirdly (optional), edit the 'makefile.unix' file and find the following section, about two thirds of the way down:

QUOTE
###########################################################################
# MSDOS/Windows
###########################################################################
ifeq ($(UNAME),MSDOS)
  RM =
  CC_OPTS = \
      -Wall -pipe -O3 -fomit-frame-pointer -ffast-math -funroll-loops \
      -fschedule-insns2 -fmove-all-movables -freduce-all-givs        \
      -mcpu=pentium -march=pentium -mfancy-math-387
  CC_OPTS += -D_cdecl=__cdecl
  PGM = lame.exe
endif


then edit it so it say something like

QUOTE
###########################################################################
# MSDOS/Windows
###########################################################################
ifeq ($(UNAME),MSDOS)
  RM =
  CC_OPTS = \
      -Wall -pipe -O3 -fomit-frame-pointer -march=athlon-xp
  PGM = lame.exe
endif


or whichever CPU you have etc.


Lastly, type the following command line:

make -f makefile.unix UNAME=MSDOS HAVE_NASM=YES

And you should get your lame.exe in the 'frontend' directory.

Just tried this on 3.96.1 and it worked a treat! If it fails, revert to an older version on MinGW (like 3.1.0), and DON'T update your GCC version (3.2.3 is fine!)

P.S. -march implies -mtune, so no need for the -mtune option
bluesky
Finally got it to work: I've summarized the process that worked for doing this in a new thread so the three I started will all have some closure and so others in the future can easily find the answer when using MinGW.

Check it out here
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.