Post Reply 
 
Thread Rating:
  • 36 Votes - 2.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SDL frontend: compiling asm hq filters
Author Message
mnk Offline
Junior Member
**

Posts: 25
Joined: Mar 2008
Reputation: 0
Post: #1
SDL frontend: compiling asm hq filters
First of all, it seems that cmake 2.6.0 is required to do it,
cause for some reason I was unable to use them, till I upgraded.
Now, a question: why does compiling of c version take a few orders of magnitude more time than the asm version ?
And a minor annoyance:
unless I add '-w-orphan-labels' in CMakeLists.txt, I'm flooded with warnings while I compile those filters.
This is a reply, cause otherwise I'd have to rewrite most of first post.
It looks like it's not only version problem, I have to delete CMakeFiles/CMakeASMCompiler.cmake first time it's generated and rerun cmake to get it to work.
Also, it looks like a certain block in CMakeLists.txt should actually loke like this:
Code:
IF( NOT USE_ASM_CORE )
    ADD_DEFINITIONS (-DC_CORE)
ELSE ( NOT USE_ASM_CORE )
    ADD_DEFINITIONS (-UC_CORE)
ENDIF( NOT USE_ASM_CORE )
to work correctly.

Well, there are actually at least two problems:
the one above is caused by following line:
Code:
ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VERSION -DBKPT_SUPPORT -DSDL -DUSE_OPENGL -DC_CORE -DSYSCONFDIR='"${SYSCONFDIR}"')
-DC_CORE should be removed
the other is that that quoting of defines in incorrect, cmake_policy( SET CMP0005 NEW ) doesn't work together with current quoting style of CMakeLists.txt.
(This post was last modified: 06-09-2008 05:33 AM by mnk.)
06-09-2008 03:45 AM
Find all posts by this user Quote this message in a reply
xKiv Offline
VBA-M Contributor
*****

Posts: 39
Joined: Mar 2008
Reputation: 1
Post: #2
RE: SDL frontend: compiling asm hq filters
mnk Wrote:Now, a question: why does compiling of c version take a few orders of magnitude more time than the asm version ?
Possibly because (most modern) C compilers are optimizing (and spend a lot of time generating "best" machine code for your processor), whereas assembler compilers usually aren't (and generate the code the *programmer* (or even coder) thought would be best).

Quote:It looks like it's not only version problem, I have to delete CMakeFiles/CMakeASMCompiler.cmake first time it's generated and rerun cmake to get it to work.

This is the intended behavior for cmake.

Quote:Also, it looks like a certain block in CMakeLists.txt should actually loke like this:
Code:
IF( NOT USE_ASM_CORE )
    ADD_DEFINITIONS (-DC_CORE)
ELSE ( NOT USE_ASM_CORE )
    ADD_DEFINITIONS (-UC_CORE)
ENDIF( NOT USE_ASM_CORE )
to work correctly.

You are probably right (there's an unconditional ADD_DEFINITIONS (... -DC_CORE ...)), but I will leave this to somebody who knows.
06-09-2008 04:45 AM
Find all posts by this user Quote this message in a reply
mnk Offline
Junior Member
**

Posts: 25
Joined: Mar 2008
Reputation: 0
Post: #3
RE: SDL frontend: compiling asm hq filters
The catch is that I meant:
I have to run cmake, delete CMakeFiles/CMakeASMCompiler.cmake first time it's generated and rerun cmake to get it to work.
And it should either set that policy to old or require cmake 2.6.0.
(This post was last modified: 06-09-2008 05:38 AM by mnk.)
06-09-2008 05:36 AM
Find all posts by this user Quote this message in a reply
xKiv Offline
VBA-M Contributor
*****

Posts: 39
Joined: Mar 2008
Reputation: 1
Post: #4
RE: SDL frontend: compiling asm hq filters
mnk Wrote:The catch is that I meant:
I have to run cmake, delete CMakeFiles/CMakeASMCompiler.cmake first time it's generated and rerun cmake to get it to work.
And it should either set that policy to old or require cmake 2.6.0.

Without deleting CMakeCache.txt?
Well, that's supposedly to be expected from cmake sometimes ... but I still don't see why, this time.

----------

How does it fail?
What's in your generated CMakeFiles/CMakeASMCompiler.cmake after the first run and then after the second run?
06-09-2008 06:27 AM
Find all posts by this user Quote this message in a reply
bgK Offline
VBA-M Contributor
*****

Posts: 101
Joined: Apr 2008
Reputation: 1
Post: #5
RE: SDL frontend: compiling asm hq filters
Ooops looks like I broke CMake quite severely.
Thanks for your comments.
Does rev 571 work better ?
06-09-2008 06:47 AM
Find all posts by this user Quote this message in a reply
mnk Offline
Junior Member
**

Posts: 25
Joined: Mar 2008
Reputation: 0
Post: #6
RE: SDL frontend: compiling asm hq filters
It does work better, but that asm problem is still there.
The incorrect CMakeFiles/CMakeASMCompiler.cmake:
Code:
SET(CMAKE_ASM_COMPILER "/usr/bin/nasm")
SET(CMAKE_ASM_COMPILER_ARG1 "")
SET(CMAKE_AR "/usr/bin/ar")
SET(CMAKE_RANLIB "/usr/bin/ranlib")
SET(CMAKE_LINKER "/usr/bin/ld")
SET(CMAKE_ASM_COMPILER_LOADED 1)
SET(CMAKE_ASM_COMPILER_ENV_VAR "ASM")

SET(CMAKE_ASM_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_ASM_LINKER_PREFERENCE 0)
the correct one:
Code:
SET(CMAKE_ASM_COMPILER "/usr/bin/nasm")
SET(CMAKE_ASM_COMPILER_LOADED 1)
SET(CMAKE_ASM_COMPILER_ENV_VAR "ASM")

SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS nasm;asm;nas)
SET(CMAKE_ASM_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_ASM_LINKER_PREFERENCE None)
IF(UNIX)
        SET(CMAKE_ASM_OUTPUT_EXTENSION .o)
ELSE(UNIX)
        SET(CMAKE_ASM_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
This looks like a conflict between files in CMakeScripts and those provided by cmake 2.6.0.
(This post was last modified: 06-09-2008 10:06 PM by mnk.)
06-09-2008 10:05 PM
Find all posts by this user Quote this message in a reply
Nach Offline
VBA-M Developer
*******

Posts: 41
Joined: Mar 2008
Reputation: 1
Post: #7
RE: SDL frontend: compiling asm hq filters
I can confirm I have this problem with r571 too.
06-10-2008 05:36 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: