Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: mingw to compile lame (Read 5638 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

mingw to compile lame

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: [Select]
$ ./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.

mingw to compile lame

Reply #1
No one else uses mingw to compile lame?  What do you all use?

mingw to compile lame

Reply #2
MSVC, ICL... :B

mingw to compile lame

Reply #3
Instead of

make

try

make CFLAGS="-O3 -march=athlonxp -mtune=athlonxp"

mingw to compile lame

Reply #4
Here's what I did based on your suggestion:

Code: [Select]
$ ./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: [Select]
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: [Select]
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

mingw to compile lame

Reply #5
Do you have nasm installed?

mingw to compile lame

Reply #6
Actually, I'm using nasmw.  My mistake in the post.

mingw to compile lame

Reply #7
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

mingw to compile lame

Reply #8
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