I'm trying to resolve bug report 1040 with respect to amarok not building with cmake.
Under normal conditions, the build always fails with the following:
/dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:914: error: 'ScriptManager' has not been declared /dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:919: error: 'ScriptManager' has not been declared /dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:924: error: 'ScriptManager' has not been declared
I concluded that amarokdcophandler.cpp was not finding scriptmanager.h, which is in the parent directory.
As a test, I copied scriptmanager.h to the same directory as amarokdcophandler.cpp. The build failures disappeared and the package built.
Seems that amarok/amarok/src/amarokcore/CMakeLists.txt needs to be fixed but I don't know what to do.
Thanks much!
Darrell
On Friday 19 October 2012 08:27:33 Darrell Anderson wrote:
I'm trying to resolve bug report 1040 with respect to amarok not building with cmake.
Under normal conditions, the build always fails with the following:
/dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:914: error: 'ScriptManager' has not been declared /dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:919: error: 'ScriptManager' has not been declared /dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:924: error: 'ScriptManager' has not been declared
I concluded that amarokdcophandler.cpp was not finding scriptmanager.h, which is in the parent directory.
As a test, I copied scriptmanager.h to the same directory as amarokdcophandler.cpp. The build failures disappeared and the package built.
Try to add ${CMAKE_CURRENT_SOURCE_DIR}/.. to include_directories()
Seems that amarok/amarok/src/amarokcore/CMakeLists.txt needs to be fixed but I don't know what to do.
Thanks much!
Darrell
I'm trying to resolve bug report 1040 with respect to amarok not building with cmake.
Under normal conditions, the build always fails with the following:
/dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:914: error:
'ScriptManager' has not been declared
/dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:919: error:
'ScriptManager' has not been declared
/dev/shm/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:924: error:
'ScriptManager' has not been declared
I concluded that amarokdcophandler.cpp was not finding scriptmanager.h, which is in the parent directory.
As a test, I copied scriptmanager.h to the same directory as amarokdcophandler.cpp. The build failures disappeared and the package built.
Try to add ${CMAKE_CURRENT_SOURCE_DIR}/.. to include_directories()
No success. :(
I tried all of the following:
${CMAKE_CURRENT_SOURCE_DIR}/.. .. ${CMAKE_BINARY_DIR}/amarok/src ${CMAKE_SOURCE_DIR}/amarok/src ${CMAKE_BINARY_DIR}/amarok/src/amarokcore/.. ${CMAKE_SOURCE_DIR}/amarok/src/amarokcore/..
The only thing that works is copying scriptmanager.h to the same directory or reversing commit 477d071b.
Commit 477d071b:
diff --git a/cmake/modules/FindTQt.cmake b/cmake/modules/FindTQt.cmake index bf2ca8a..889a84c 100644 --- a/cmake/modules/FindTQt.cmake +++ b/cmake/modules/FindTQt.cmake @@ -86,6 +86,6 @@ tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
# TQT_CXX_FLAGS -foreach( _flag ${TQT_CFLAGS_OTHER} ) +foreach( _flag ${TQT_CFLAGS} ${TQT_CFLAGS_OTHER} ) set( TQT_CXX_FLAGS "${TQT_CXX_FLAGS} ${_flag}" ) endforeach()
Maybe the cure is somewhere else?
Darrell
On Friday 19 October 2012 23:11:43 Darrell Anderson wrote: [...]
Try to add ${CMAKE_CURRENT_SOURCE_DIR}/.. to include_directories()
No success. :(
I tried all of the following:
${CMAKE_CURRENT_SOURCE_DIR}/.. .. ${CMAKE_BINARY_DIR}/amarok/src ${CMAKE_SOURCE_DIR}/amarok/src ${CMAKE_BINARY_DIR}/amarok/src/amarokcore/.. ${CMAKE_SOURCE_DIR}/amarok/src/amarokcore/..
The only thing that works is copying scriptmanager.h to the same directory or reversing commit 477d071b.
Commit 477d071b:
diff --git a/cmake/modules/FindTQt.cmake b/cmake/modules/FindTQt.cmake index bf2ca8a..889a84c 100644 --- a/cmake/modules/FindTQt.cmake +++ b/cmake/modules/FindTQt.cmake @@ -86,6 +86,6 @@ tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
# TQT_CXX_FLAGS -foreach( _flag ${TQT_CFLAGS_OTHER} ) +foreach( _flag ${TQT_CFLAGS} ${TQT_CFLAGS_OTHER} ) set( TQT_CXX_FLAGS "${TQT_CXX_FLAGS} ${_flag}" ) endforeach()
I'm not sure what this loop is doing. Run make VERBOSE=1 and check what arguments are passed to g++
Maybe the cure is somewhere else?
Darrell
I'm not sure what this loop is doing. Run make VERBOSE=1 and check what arguments are passed to g++
Here is a copy of the full build log:
http://humanreadable.nfshost.com/trinity/build_logs/amarok-R14.0.0-i486-13.1...
To avoid parallel processing I ran this specific build with NUMJOBS=-j1. The build fails very early.
The build output is at the end of the full log. At line 103 is the cmake cache output.
Darrell
On Saturday 20 October 2012 00:15:32 Darrell Anderson wrote:
I'm not sure what this loop is doing. Run make VERBOSE=1 and check what arguments are passed to g++
Here is a copy of the full build log:
http://humanreadable.nfshost.com/trinity/build_logs/amarok-R14.0.0-i486-13. 1_32_git_8283_1-build.log
To avoid parallel processing I ran this specific build with NUMJOBS=-j1. The build fails very early.
The build output is at the end of the full log. At line 103 is the cmake cache output.
Darrell
Everything seems fine. Maybe you have somewhere another scriptmanager.h which is included accidentally?
Everything seems fine. Maybe you have somewhere another scriptmanager.h which is included accidentally?
Ah, um, well...
You might be on to something.
There is another scriptmanager.h on the system, installed by the tdelibs package. :)
/opt/trinity/include/scriptmanager.h
GIT sources: tdelibs/interfaces/kscript/scriptmanager.h
So how do I edit CMakeLists.txt, or amarokdcophandler.cpp or amarokdcophandler.h to use the local scriptmanager.h and not the one installed in /opt/trinity/include?
Darrell
On Saturday 20 October 2012 01:08:58 Darrell Anderson wrote:
Everything seems fine. Maybe you have somewhere another scriptmanager.h which is included accidentally?
Ah, um, well...
You might be on to something.
There is another scriptmanager.h on the system, installed by the tdelibs package. :)
/opt/trinity/include/scriptmanager.h
GIT sources: tdelibs/interfaces/kscript/scriptmanager.h
So how do I edit CMakeLists.txt, or amarokdcophandler.cpp or amarokdcophandler.h to use the local scriptmanager.h and not the one installed in /opt/trinity/include?
Darrell
Well, this a side effect of altering CXX flags, the order of searching is broken.
As a workaround, change
#include "scriptmanager.h"
to
#include "../scriptmanager.h"
As a workaround, change
#include "scriptmanager.h"
to
#include "../scriptmanager.h"
Yes, that works too and seems consistent with other such occurrences in the sources. I will propose that patch as the solution.
Thank you.
Darrell
Everything seems fine. Maybe you have somewhere another scriptmanager.h which is included accidentally?
Ah, um, well...
You might be on to something.
There is another scriptmanager.h on the system, installed by the tdelibs package. :)
/opt/trinity/include/scriptmanager.h
GIT sources: tdelibs/interfaces/kscript/scriptmanager.h
So how do I edit CMakeLists.txt, or amarokdcophandler.cpp or amarokdcophandler.h to use the local scriptmanager.h and not the one installed in /opt/trinity/include?
This seems to be the problem. I temporarily renamed /opt/trinity/include/scriptmanager.h. Thereafter amarok built without failure. The package size and contents look sane.
I don't know what cmake or gcc tricks are needed. I suppose one option is in amarok to rename scriptmanager.h and scriptmanager.cpp, or rename the same in tdelibs (and all Trinity *.h/*.cpp files calling that header file).
Grepping the entire Trinity source tree reveals the following calls to "scriptmanager.h":
./applications/koffice/kexi/formeditor/scripting/formscript.cpp:21:#include "scriptmanager.h" ./applications/koffice/kexi/formeditor/scripting/scriptmanager.cpp:20:#include "scriptmanager.h"
./applications/amarok/amarok/src/playlist.cpp:40:#include "scriptmanager.h" ./applications/amarok/amarok/src/scriptmanager.cpp:31:#include "scriptmanager.h" ./applications/amarok/amarok/src/collectiondb.cpp:36:#include "scriptmanager.h" ./applications/amarok/amarok/src/playlistwindow.cpp:38:#include "scriptmanager.h" ./applications/amarok/amarok/src/contextbrowser.cpp:34:#include "scriptmanager.h" ./applications/amarok/amarok/src/amarokcore/amarokdcophandler.cpp:42:#include "scriptmanager.h" ./applications/amarok/amarok/src/mediabrowser.cpp:37:#include "scriptmanager.h" ./applications/amarok/amarok/src/app.cpp:45:#include "scriptmanager.h" ./applications/amarok/amarok/src/deviceconfiguredialog.cpp:21:#include "scriptmanager.h"
./applications/konversation/konversation/src/konversationmainwindow.cpp:53:#include <scriptmanager.h>
./tdelibs/interfaces/kscript/scriptmanager.cpp:1:#include "scriptmanager.h"
I thought using quotation marks indicates a local header file and using brackets meant using a system header file.
I don't know why commit 477d071b causes this name clash or why reversing the commit avoids the name clash. I suspect we'll have more of these types of bugs in the future as more packages are converted to cmake. Thus, I hope we find a universal solution.
Any ideas how to fix?
Darrell