MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0012575 | CMake | CMake | public | 2011-11-11 18:55 | 2011-11-13 21:47 |
|
Reporter | David Bjornbak | |
Assigned To | Bill Hoffman | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | no change required | |
Platform | Linux | OS | Redhat | OS Version | 4.9 |
Product Version | CMake 2.8.6 | |
Target Version | | Fixed in Version | | |
|
Summary | 0012575: I'm getting a Link error on Linux when I use CMake 2.8.6 or 2.8.5. If use CMake 2.6.3, with the exact same configuration, the l |
Description | I'm getting a Link error on Linux when I use CMake 2.8.6 or 2.8.5. If use CMake 2.6.3, with the exact same configuration, the link works.
I did a diff on the build.make from 2.8.6 and 2.6.3 and found when I use cmake 2.8.6 On Linux adding headers to ..._EXTERNAL_OBJECTS for executables under the build.make.
The following is the link error I get, it looks for a header but, the link.txt does need it and the diff on build.make that looks like is causing this.
Link Error Message
nux_x86_64/lib/libeemdump.so /hped/builds/tools/google-breakpad/784/lib.linux_x86_64/release/libbreakpad.a /hped/builds/tools/google-breakpad/78
4/lib.linux_x86_64/release/libbreakpad_client.a /hped/builds/tools/google-breakpad/784/lib.linux_x86_64/release/libbreakpad_server.a /gfs/sr/blu efin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib/libplugin_manager.so /hped/builds/tools/qt/4.7.4/linux_x86_6
4/lib/libQtCore.so /hped/builds/tools/cryptopp/5.6.0_0/linux_x86_64/release/libcryptopp.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64
/release/libboost_date_time.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_filesystem.a /hped/builds/tools/boost/boos t_1_45_0/lib.linux_x86_64/release/libboost_program_options.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_system.a /h ped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_thread.a /hped/builds/tools/stl/5.2.1/lib.linux_x86_64/libstlport_gcc.so - Wl,-rpath,/hped/builds/tools/qt/4.7.4/linux_x86_64/lib:/hped/builds/tools/stl/5.2.1/lib.linux_x86_64:/gfs/sr/bluefin/d1/build/hped/builds/sr/dev
XXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib:/release:
msgs_eesofpvm_multitool.h:4:19: fatal error: Diag.h: No such file or directory compilation terminated.
make[3]: *** [/gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/bin/eesofpvm_multitool] Error 1
make[3]: Leaving directory `/hfs/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease'
make[2]: *** [projects/simsys/source/eesofpvm_multitool/CMakeFiles/eesofpvm_multitool.dir/all] Error 2
Diff with the build.make file, notice the file msgs_eesofpvm_multitool.h
< eesofpvm_multitool_EXTERNAL_OBJECTS =
---
> eesofpvm_multitool_EXTERNAL_OBJECTS = \
> "/hfs/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/projects/simsys/source/eesofpvm_multitool/msgs_eesofpvm_multitool.h"
498d482
< /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/bin/eesofpvm_multitool: /hped/builds/tools/qt/4.7.4 /linux_x86_64/lib/libQtCLucene.so
500,502d483
< /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/bin/eesofpvm_multitool: /usr/X11R6/lib64/libXext.so < /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/bin/eesofpvm_multitool: /usr/X11R6/lib64/libX11.so < /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/bin/eesofpvm_multitool: /usr/lib64/libm.so
519a501
> /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bit
> release/linux_x86_64/bin/eesofpvm_multitool:
> projects/simsys/source/eeso
fpvm_multitool/msgs_eesofpvm_multitool.h
Attached is the diff under the CMakefiles area between 2.6.3 and 2.8.6
|
Steps To Reproduce | |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | diff.log (12,430) 2011-11-11 18:55 https://public.kitware.com/Bug/file/4117/diff.log
CMakeLists.txt (1,140) 2011-11-12 12:40 https://public.kitware.com/Bug/file/4118/CMakeLists.txt |
|
Issue History |
Date Modified | Username | Field | Change |
2011-11-11 18:55 | David Bjornbak | New Issue | |
2011-11-11 18:55 | David Bjornbak | File Added: diff.log | |
2011-11-12 11:10 | Bill Hoffman | Note Added: 0027788 | |
2011-11-12 11:11 | Bill Hoffman | Note Deleted: 0027788 | |
2011-11-12 11:13 | Bill Hoffman | Note Added: 0027789 | |
2011-11-12 12:40 | David Bjornbak | File Added: CMakeLists.txt | |
2011-11-12 12:40 | David Bjornbak | Note Added: 0027790 | |
2011-11-12 13:04 | David Bjornbak | Note Added: 0027791 | |
2011-11-12 13:06 | David Bjornbak | Note Edited: 0027791 | bug_revision_view_page.php?bugnote_id=27791#r449 |
2011-11-12 16:53 | Bill Hoffman | Note Added: 0027792 | |
2011-11-12 16:53 | Bill Hoffman | Assigned To | => Bill Hoffman |
2011-11-12 16:53 | Bill Hoffman | Status | new => assigned |
2011-11-13 21:11 | David Bjornbak | Note Added: 0027795 | |
2011-11-13 21:15 | David Bjornbak | Note Added: 0027796 | |
2011-11-13 21:22 | David Bjornbak | Note Added: 0027797 | |
2011-11-13 21:46 | Bill Hoffman | Note Added: 0027798 | |
2011-11-13 21:47 | Bill Hoffman | Status | assigned => closed |
2011-11-13 21:47 | Bill Hoffman | Resolution | open => no change required |
Notes |
|
(0027789)
|
Bill Hoffman
|
2011-11-12 11:13
|
|
Some how CMake things that fpvm_multitool/msgs_eesofpvm_multitool.h is an external object file, and is trying to link it. Where does that file show up in the CMakeLists.txt files? |
|
|
(0027790)
|
David Bjornbak
|
2011-11-12 12:40
|
|
Attached is the CMakeLiss files in question and the header msgs_eesofpvm_multitool.h is listed under the add_executable dependency |
|
|
(0027791)
|
David Bjornbak
|
2011-11-12 13:04
(edited on: 2011-11-12 13:06) |
|
Bill stated "You need to run make VERBOSE=1 for both and see what the difference is in the command line that is being produced. From the error it looks like a -I flag is missing from one of them. Please post the results of make VERBOSE=1. "
This is a link time error and the use of -I is not relevant unless you're compiling a *.cxx file at link time. This project is not trying to compile *.cxx files and this project has been working for the last 2 yours under CMake 2.6.3
The shown below, the link line make VERBOSE=1 output is from the "good" or working link command form CMake 2.6.3, there's no -I in the command:
/hped/builds/tools/gcc/4.6.1/bin/g++ -fPIC -pipe -m32 -g -DDEBUG -D_DEBUG -DQT_DEBUG -fPIC CMakeFiles/eesofpvm_multitool.dir/addhost.cpp.o
CMakeFiles/eesofpvm_multitool.dir/copy.cpp.o CMakeFiles/eesofpvm_multitool.dir/cti_permuter_ds_creator.cpp.o CMakeFiles/eesofpvm_multitool.dir/d
ataset_updater.cpp.o CMakeFiles/eesofpvm_multitool.dir/mkdir.cpp.o CMakeFiles/eesofpvm_multitool.dir/mom_mesh_installer.cpp.o CMakeFiles/eesofpv
m_multitool.dir/move.cpp.o CMakeFiles/eesofpvm_multitool.dir/multitool.cpp.o CMakeFiles/eesofpvm_multitool.dir/remote_file_updater.cpp.o CMakeFi
les/eesofpvm_multitool.dir/remove.cpp.o CMakeFiles/eesofpvm_multitool.dir/rmdir.cpp.o CMakeFiles/eesofpvm_multitool.dir/rsync.cpp.o CMakeFiles/e
esofpvm_multitool.dir/simdir_manager.cpp.o CMakeFiles/eesofpvm_multitool.dir/spawn_child.cpp.o CMakeFiles/eesofpvm_multitool.dir/spawn_pipe_exte
nsion.cpp.o CMakeFiles/eesofpvm_multitool.dir/msgs_eesofpvm_multitool.c.o -o ../../../../linux_x86/bin/eesofpvm_multitool -rdynamic -L/hped/bui
lds/sr/devXXX/rcupgrd_int/build/32bitdebug/linux_x86/lib -L/debug ../../../../linux_x86/lib/libgsl.so /hped/builds/tools/qt/4.7.4/linux_x86/lib/
libQtCore.so ../../../../linux_x86/lib/libPhysUtlPro.so ../../../../linux_x86/lib/libpvm3.so ../../../../linux_x86/lib/libgpvm3.a /hped/builds/t
ools/boost/boost_1_45_0/lib.linux_x86/debug/libboost_date_time.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/debug/libboost_filesystem.a
/hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/debug/libboost_program_options.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/debug/
libboost_system.a /hped/builds/tools/stl/5.2.1/lib.linux_x86/libstlport_gcc.so ../../../../linux_x86/lib/libgsl.so /hped/builds/tools/qt/4.7.4/l
inux_x86/lib/libQtOpenGL.so -lGLU -lGL /hped/builds/tools/qt/4.7.4/linux_x86/lib/libQtScript.so /hped/builds/tools/qt/4.7.4/linux_x86/lib/libQtH
elp.so /hped/builds/tools/qt/4.7.4/linux_x86/lib/libQtCLucene.so /hped/builds/tools/qt/4.7.4/linux_x86/lib/libQtGui.so /usr/X11R6/lib/libXext.so
/usr/X11R6/lib/libX11.so -lm /hped/builds/tools/qt/4.7.4/linux_x86/lib/libQtXml.so /hped/builds/tools/qt/4.7.4/linux_x86/lib/libQtSql.so /hped/
builds/tools/qt/4.7.4/linux_x86/lib/libQtNetwork.so -lpthread -ldl ../../../../linux_x86/lib/libeemdump.so /hped/builds/tools/google-breakpad/78
4/lib.linux_x86/debug/libbreakpad.a /hped/builds/tools/google-breakpad/784/lib.linux_x86/debug/libbreakpad_client.a /hped/builds/tools/google-br
eakpad/784/lib.linux_x86/debug/libbreakpad_server.a ../../../../linux_x86/lib/libplugin_manager.so /hped/builds/tools/qt/4.7.4/linux_x86/lib/lib
QtCore.so /hped/builds/tools/cryptopp/5.6.0_0/linux_x86/debug/libcryptopp.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/debug/libboost_d
ate_time.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/debug/libboost_filesystem.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/d
ebug/libboost_program_options.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86/debug/libboost_system.a /hped/builds/tools/boost/boost_1_45_
0/lib.linux_x86/debug/libboost_thread.a /hped/builds/tools/stl/5.2.1/lib.linux_x86/libstlport_gcc.so -Wl,-rpath,/hped/builds/tools/qt/4.7.4/linu
x_x86/lib:/hped/builds/tools/stl/5.2.1/lib.linux_x86:/hped/builds/sr/devXXX/rcupgrd_int/build/32bitdebug/linux_x86/lib:/debug:/usr/X11R6/lib
The followng is the failing link line from make VERBOSE=1 output from the faiing command uncer CMake 2.8.6 This is from a 64-bit build but, the same error occurs under 32-bit build.
/hped/builds/tools/gcc/4.6.1/bin/g++ -fPIC -pipe -m64 -DCEDA_64_BIT -Dlinux -Dlinux64 -O2 -ggdb -DOPT_BUILD -DNDEBUG -DQT_NO_DEBUG -s
CMakeFiles/eesofpvm_multitool.dir/addhost.cpp.o CMakeFiles/eesofpvm_multitool.dir/copy.cpp.o CMakeFiles/eesofpvm_multitool.dir/cti_permuter_ds
_creator.cpp.o CMakeFiles/eesofpvm_multitool.dir/dataset_updater.cpp.o CMakeFiles/eesofpvm_multitool.dir/mkdir.cpp.o CMakeFiles/eesofpvm_multito
ol.dir/mom_mesh_installer.cpp.o CMakeFiles/eesofpvm_multitool.dir/move.cpp.o CMakeFiles/eesofpvm_multitool.dir/multitool.cpp.o CMakeFiles/eesofp
vm_multitool.dir/remote_file_updater.cpp.o CMakeFiles/eesofpvm_multitool.dir/remove.cpp.o CMakeFiles/eesofpvm_multitool.dir/rmdir.cpp.o CMakeFil
es/eesofpvm_multitool.dir/rsync.cpp.o CMakeFiles/eesofpvm_multitool.dir/simdir_manager.cpp.o CMakeFiles/eesofpvm_multitool.dir/spawn_child.cpp.o
CMakeFiles/eesofpvm_multitool.dir/spawn_pipe_extension.cpp.o CMakeFiles/eesofpvm_multitool.dir/msgs_eesofpvm_multitool.c.o msgs_eesofpvm_multit
ool.h -o /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/bin/eesofpvm_multitool -rdynamic -L/gfs/sr/
bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib -L/release /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX
/rcupgrd_int/build/64bitrelease/linux_x86_64/lib/libgsl.so /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtCore.so /gfs/sr/bluefin/d1/build/hp
ed/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib/libPhysUtlPro.so /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/
build/64bitrelease/linux_x86_64/lib/libpvm3.so /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib/li
bgpvm3.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_date_time.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86
_64/release/libboost_filesystem.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_program_options.a /hped/builds/tools/b
oost/boost_1_45_0/lib.linux_x86_64/release/libboost_system.a /hped/builds/tools/stl/5.2.1/lib.linux_x86_64/libstlport_gcc.so /gfs/sr/bluefin/d1/
build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib/libgsl.so /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtOpenGL.s
o /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtScript.so /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtHelp.so /hped/builds/tools/qt/4.
7.4/linux_x86_64/lib/libQtGui.so /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtXml.so /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtSql.
so /hped/builds/tools/qt/4.7.4/linux_x86_64/lib/libQtNetwork.so /gfs/sr/bluefin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/li
nux_x86_64/lib/libeemdump.so /hped/builds/tools/google-breakpad/784/lib.linux_x86_64/release/libbreakpad.a /hped/builds/tools/google-breakpad/78
4/lib.linux_x86_64/release/libbreakpad_client.a /hped/builds/tools/google-breakpad/784/lib.linux_x86_64/release/libbreakpad_server.a /gfs/sr/blu
efin/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib/libplugin_manager.so /hped/builds/tools/qt/4.7.4/linux_x86_6
4/lib/libQtCore.so /hped/builds/tools/cryptopp/5.6.0_0/linux_x86_64/release/libcryptopp.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64
/release/libboost_date_time.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_filesystem.a /hped/builds/tools/boost/boos
t_1_45_0/lib.linux_x86_64/release/libboost_program_options.a /hped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_system.a /h
ped/builds/tools/boost/boost_1_45_0/lib.linux_x86_64/release/libboost_thread.a /hped/builds/tools/stl/5.2.1/lib.linux_x86_64/libstlport_gcc.so -
Wl,-rpath,/hped/builds/tools/qt/4.7.4/linux_x86_64/lib:/hped/builds/tools/stl/5.2.1/lib.linux_x86_64:/gfs/sr/bluefin/d1/build/hped/builds/sr/dev
XXX/rcupgrd_int/build/64bitrelease/linux_x86_64/lib:/release:
gmake[1]: Leaving directory `/hfs/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease'
~
|
|
|
(0027792)
|
Bill Hoffman
|
2011-11-12 16:53
|
|
I also deleted that request right after I posted the note... :)
Anyway, for some reason it thinks that a .h file is an object file.
Can you run cmake --trace and post the output?
The problem is here: > eesofpvm_multitool_EXTERNAL_OBJECTS = \
> "/hfs/d1/build/hped/builds/sr/devXXX/rcupgrd_int/build/64bitrelease/projects/simsys/source/eesofpvm_multitool/msgs_eesofpvm_multitool.h"
Trouble could be in this function:
void cmSourceFile::CheckExtension()
{
// Compute the extension.
std::string realExt =
cmSystemTools::GetFilenameLastExtension(this->FullPath);
if(!realExt.empty())
{
// Store the extension without the leading '.'.
this->Extension = realExt.substr(1);
}
// Look for object files.
if(this->Extension == "obj" ||
this->Extension == "o" ||
this->Extension == "lo")
{
this->SetProperty("EXTERNAL_OBJECT", "1");
}
Can you compile CMake with some debug print stuff in this function? Or alternatively can you create a small example that shows this problem.
Thanks. |
|
|
(0027795)
|
David Bjornbak
|
2011-11-13 21:11
|
|
I added some cout line to the code you've pointed to with no luck. Creating a small example of my project might not be possible. Is there any other places in the code that's related to this issue?
void cmSourceFile::CheckExtension()
{
// Compute the extension.
std::string realExt =
cmSystemTools::GetFilenameLastExtension(this->FullPath);
cout << "file " << this->FullPath << " Exit " << realExt << " \n" ;
if(!realExt.empty())
{
// Store the extension without the leading '.'.
this->Extension = realExt.substr(1);
}
// Look for object files.
if(this->Extension == "obj" ||
this->Extension == "o" ||
this->Extension == "lo")
{
cout << "!!! Got to EXTERNAL_OBJ - file " << this->FullPath << " Exit " << realExt << " \n" ;
this->SetProperty("EXTERNAL_OBJECT", "1");
}
// Try to identify the source file language from the extension.
if(this->Language.empty())
{
//cout << "!!! In language empt- file " << this->FullPath << " Exit " << realExt << " \n" ;
this->CheckLanguage(this->Extension);
}
} |
|
|
(0027796)
|
David Bjornbak
|
2011-11-13 21:15
|
|
The following is the relevent out put form my debugging info.
file /hfs/d1/local/dbjornba/cwork/src/simsys/source/eesofpvm_multitool/spawn_child.cpp Exit .cpp
file /hfs/d1/local/dbjornba/cwork/src/simsys/source/eesofpvm_multitool/spawn_pipe_extension.cpp Exit .cpp
file /hfs/d1/local/dbjornba/cwork/32bitdebug/projects/simsys/source/eesofpvm_multitool/msgs_eesofpvm_multitool.c Exit .c
file /hfs/d1/local/dbjornba/cwork/32bitdebug/projects/simsys/source/eesofpvm_multitool/msgs_eesofpvm_multitool.h Exit .h
file /hfs/d1/local/dbjornba/cwork/src/simsys/source/gen_vmid/eesofpvm_gen_vmid.cpp Exit .cpp
file /hfs/d1/local/dbjornba/cwork/32bitdebug/CMakeFiles/Continuous.rule Exit .rule
file /hfs/d1/local/dbjornba/cwork/32bitdebug/CMakeFiles/ContinuousBuild.rule Exit .rule |
|
|
(0027797)
|
David Bjornbak
|
2011-11-13 21:22
|
|
I found the issue and I guess you can close this bug report.
The header file in question is generated in a custom command. The behavior has changed between 2.6.3 and 2.8.5 but, it appears you fixed something, it's doing what the macro is specifying:
MACRO(MDB2SRC outfiles)
SET(infiles ${ARGN})
SET(outdir ${CMAKE_CURRENT_BINARY_DIR})
IF(NOT EXISTS ${outdir})
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E make_directory ${outdir}
)
ENDIF(NOT EXISTS ${outdir})
FOREACH(it ${infiles})
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
SET(outsrc ${outdir}/${outfile}.c)
SET(outhdr ${outdir}/${outfile}.h)
ADD_CUSTOM_COMMAND(OUTPUT ${outsrc} ${outhdr}
COMMAND ${PERL_COMMAND}
ARGS ${MSGTRAN} -c ${outsrc} -h ${outhdr} ${infile}
MAIN_DEPENDENCY ${infile}
COMMENT "Converting ${infile}..."
)
SET(${outfiles} ${${outfiles}} ${outsrc} ${outhdr})
ENDFOREACH(it)
SET_SOURCE_FILES_PROPERTIES(${${outfiles}} PROPERTIES EXTERNAL_OBJECT true)
SOURCE_GROUP(MDB\ Files FILES ${infiles})
ENDMACRO(MDB2SRC) |
|
|
(0027798)
|
Bill Hoffman
|
2011-11-13 21:46
|
|
I thought it might be something like that. Must have fixed a bug to accept any file as an object file. |
|