[CMake] cmake can't find some crtbegin.so, libgcc, libgcc_s under certain conditions

2012-01-31 Thread Jim Galarowicz


Hi all,

I'm running into issues with cmake or likely our set-up/usage of cmake, when 
trying to build the component based tool framework (CBTF) with cmake.
The issue I'm seeing only occurs on machines where binutils-devel is not 
installed and I build my own version of binutils.
It seems that something gets out of sync with ld and gcc.  I'm on laboratory 
machines where I don't control the software that is installed, so that
is why I'm building my own version of binutils.

Has anyone seen something like this (output listed below) or has any 
suggestions on where to look and/or what to look for to solve this?

*
CMAKE OUTPUT:
*
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- broken
CMake Error at 
/global/common/hopper2/usg/cmake/2.8.2/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
(MESSAGE):
  The C compiler /usr/bin/gcc is not able to compile a simple test program.
  It fails with the following output:
   Change Dir: 
/global/homes/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp

  Run Build Command:/usr/bin/gmake cmTryCompileExec/fast

  /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  gmake[1]: Entering directory
  `/global/u2/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp'

  /global/common/hopper2/usg/cmake/2.8.2/bin/cmake -E  cmake_progress_report

/global/homes/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp/CMakeFiles
  1
  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
  /usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c 
/global/homes/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp/testCCompiler.c

  Linking C executable cmTryCompileExec

  /global/common/hopper2/usg/cmake/2.8.2/bin/cmake -E cmake_link_script 
CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1

  /usr/bin/gcc CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o 
cmTryCompileExec -rdynamic

  /global/u2/j/jgalaro/hopper/cbtf_install/bin/ld: cannot find crtbegin.o: No 
such file or directory

  /global/u2/j/jgalaro/hopper/cbtf_install/bin/ld: cannot find -lgcc

  /global/u2/j/jgalaro/hopper/cbtf_install/bin/ld: cannot find -lgcc_s

  collect2: ld returned 1 exit status

  gmake[1]: *** [cmTryCompileExec] Error 1

  gmake[1]: Leaving directory
  `/global/u2/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp'

  gmake: *** [cmTryCompileExec/fast] Error 2


In experimenting to get some clues about what is causing the cmake failures, I 
tried not setting PATH and LD_LIBRARY_PATH to point to my version of binutils.
That didn't make a difference.  I don't think the fact that binutils-devel is 
not installed is what tweaking the cmake build,
it seems more like the alternative bintuils install that does it.

I've tried setting LD_LIBRARY_PATH to point to the library location of 
crtbegin.so, libgcc, and libgcc_s that the cmake build complains that it can 
not find.
But, this doesn't work either.   I then added a line to the CMakeLists.txt file 
we have for building CBTF, but that also did not make a difference.
When I play with this on my laptop, I can reproduce what I see on the 
laboratory machines.

I've listed the build file (CMakeLists.txt) below.

This is the line that I added to see if I could help cmake file the 
crtbegin.so, libgcc and libgcc_s:

list( APPEND libSearchDirs /usr/lib64/gcc/x86_64-suse-linux/4.3)


Any tips/help will be greatly appreciated.

Thanks,
Jim G


*
Shows where crtbegin.so, etc. are located.
*
hopper08-796lsr /usr/lib64/gcc/x86_64-suse-linux/4.3
total 35824
4 drwxr-xr-x 3 root root 4096 2010-05-05 05:44 ../
  756 -rw-r--r-- 1 root root   766626 2010-05-05 05:46 libsupc++.a
12148 -rw-r--r-- 1 root root 12420868 2010-05-05 05:46 libstdc++.a
  252 -rw-r--r-- 1 root root   253440 2010-05-05 05:46 libgcc_eh.a
 5824 -rw-r--r-- 1 root root  5951124 2010-05-05 05:46 libgcc.a
  176 -rw-r--r-- 1 root root   174428 2010-05-05 05:46 libgcov.a
4 -rw-r--r-- 1 root root  170 2010-05-05 05:46 libgomp.spec
  300 -rw-r--r-- 1 root root   299624 2010-05-05 05:46 libgomp.a
4 -rw-r--r-- 1 root root 3288 2010-05-05 05:46 crtprec80.o
4 -rw-r--r-- 1 root root 3480 2010-05-05 05:46 crtprec64.o
4 -rw-r--r-- 1 root root 3288 2010-05-05 05:46 crtprec32.o
4 -rw-r--r-- 1 root root 3320 2010-05-05 05:46 crtfastmath.o
4 -rw-r--r-- 1 root root 1928 2010-05-05 05:46 crtendS.o
4 -rw-r--r-- 1 root root 1928 2010-05-05 05:46 crtend.o
4 -rw-r--r-- 1 root root 3024 2010-05-05 05:46 

Re: [CMake] cmake can't find some crtbegin.so, libgcc, libgcc_s under certain conditions

2012-01-31 Thread Rolf Eike Beer
Jim Galarowicz wrote:
 Hi all,
 
 I'm running into issues with cmake or likely our set-up/usage of cmake, when
 trying to build the component based tool framework (CBTF) with cmake. The
 issue I'm seeing only occurs on machines where binutils-devel is not
 installed and I build my own version of binutils. It seems that something
 gets out of sync with ld and gcc.  I'm on laboratory machines where I don't
 control the software that is installed, so that is why I'm building my own
 version of binutils.
 
 Has anyone seen something like this (output listed below) or has any
 suggestions on where to look and/or what to look for to solve this?

Oh well. The problem is that your compiler has for whatever reason forgotten 
how to find the low level libraries. The fix is basically described here:

http://www.linuxfromscratch.org/lfs/view/7.0/chapter05/adjusting.html

Since you can't influence the system directories you can put your specfile 
basically anywhere and then call gcc -specs=/my/spec/file and then hope it 
works.

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] cmake can't find some crtbegin.so, libgcc, libgcc_s under certain conditions

2012-01-31 Thread Michael Hertling
On 01/31/2012 09:14 PM, Jim Galarowicz wrote:
 
 Hi all,
 
 I'm running into issues with cmake or likely our set-up/usage of cmake, when 
 trying to build the component based tool framework (CBTF) with cmake.
 The issue I'm seeing only occurs on machines where binutils-devel is not 
 installed and I build my own version of binutils.
 It seems that something gets out of sync with ld and gcc.  I'm on laboratory 
 machines where I don't control the software that is installed, so that
 is why I'm building my own version of binutils.
 
 Has anyone seen something like this (output listed below) or has any 
 suggestions on where to look and/or what to look for to solve this?
 
 *
 CMAKE OUTPUT:
 *
 -- The C compiler identification is GNU
 -- The CXX compiler identification is GNU
 -- Check for working C compiler: /usr/bin/gcc
 -- Check for working C compiler: /usr/bin/gcc -- broken
 CMake Error at 
 /global/common/hopper2/usg/cmake/2.8.2/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
 (MESSAGE):
The C compiler /usr/bin/gcc is not able to compile a simple test program.
It fails with the following output:
 Change Dir: 
 /global/homes/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp
 
Run Build Command:/usr/bin/gmake cmTryCompileExec/fast
 
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
 
gmake[1]: Entering directory
`/global/u2/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp'
 
/global/common/hopper2/usg/cmake/2.8.2/bin/cmake -E  cmake_progress_report
 
 /global/homes/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c 
 /global/homes/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp/testCCompiler.c
 
Linking C executable cmTryCompileExec
 
/global/common/hopper2/usg/cmake/2.8.2/bin/cmake -E cmake_link_script 
 CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
 
/usr/bin/gcc CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o 
 cmTryCompileExec -rdynamic
 
/global/u2/j/jgalaro/hopper/cbtf_install/bin/ld: cannot find crtbegin.o: 
 No such file or directory
 
/global/u2/j/jgalaro/hopper/cbtf_install/bin/ld: cannot find -lgcc
 
/global/u2/j/jgalaro/hopper/cbtf_install/bin/ld: cannot find -lgcc_s
 
collect2: ld returned 1 exit status
 
gmake[1]: *** [cmTryCompileExec] Error 1
 
gmake[1]: Leaving directory
`/global/u2/j/jgalaro/hopper/cbtf/framework/build/CMakeFiles/CMakeTmp'
 
gmake: *** [cmTryCompileExec/fast] Error 2
 
 
 In experimenting to get some clues about what is causing the cmake failures, 
 I tried not setting PATH and LD_LIBRARY_PATH to point to my version of 
 binutils.
 That didn't make a difference.  I don't think the fact that binutils-devel is 
 not installed is what tweaking the cmake build,
 it seems more like the alternative bintuils install that does it.
 
 I've tried setting LD_LIBRARY_PATH to point to the library location of 
 crtbegin.so, libgcc, and libgcc_s that the cmake build complains that it can 
 not find.
 But, this doesn't work either.   I then added a line to the CMakeLists.txt 
 file we have for building CBTF, but that also did not make a difference.
 When I play with this on my laptop, I can reproduce what I see on the 
 laboratory machines.
 
 I've listed the build file (CMakeLists.txt) below.
 
 This is the line that I added to see if I could help cmake file the 
 crtbegin.so, libgcc and libgcc_s:
 
 list( APPEND libSearchDirs /usr/lib64/gcc/x86_64-suse-linux/4.3)
 
 
 Any tips/help will be greatly appreciated.
 
 Thanks,
 Jim G
 
 
 *
 Shows where crtbegin.so, etc. are located.
 *
 hopper08-796lsr /usr/lib64/gcc/x86_64-suse-linux/4.3
 total 35824
  4 drwxr-xr-x 3 root root 4096 2010-05-05 05:44 ../
756 -rw-r--r-- 1 root root   766626 2010-05-05 05:46 libsupc++.a
 12148 -rw-r--r-- 1 root root 12420868 2010-05-05 05:46 libstdc++.a
252 -rw-r--r-- 1 root root   253440 2010-05-05 05:46 libgcc_eh.a
   5824 -rw-r--r-- 1 root root  5951124 2010-05-05 05:46 libgcc.a
176 -rw-r--r-- 1 root root   174428 2010-05-05 05:46 libgcov.a
  4 -rw-r--r-- 1 root root  170 2010-05-05 05:46 libgomp.spec
300 -rw-r--r-- 1 root root   299624 2010-05-05 05:46 libgomp.a
  4 -rw-r--r-- 1 root root 3288 2010-05-05 05:46 crtprec80.o
  4 -rw-r--r-- 1 root root 3480 2010-05-05 05:46 crtprec64.o
  4 -rw-r--r-- 1 root root 3288 2010-05-05 05:46 crtprec32.o
  4 -rw-r--r-- 1 root root 3320 2010-05-05 05:46