Re: [CMake] help with shared-lib make failure

2012-06-18 Thread Andreas Naumann

Am 18.06.2012 08:34, schrieb luxInteg:

On Sunday 17 June 2012 14:13:00 Andreas Naumann wrote:

   

#--build2: gs_test/results.c.  build  disabled   near beginning
but comes in ~65%   of build
[ 65%] Building C object Lib/CMakeFiles/gsl.dir/__/test/results.c.o
cd /home/TESTS/BUILDgsl/Lib   /usr/bin/gcc  -Dgsl_EXPORTS
-DHAVE_CONFIG_H - DPIC -m64 -fPIC  -msse2 -fPIC -I~SRS/blas -I~SRS/block
-I~SRS/bspline - I~SRS/cblas -I~SRS/cdf -I~SRS/cheb -I~SRS/deriv
-I~SRS/dht -I~SRS/eigen - I~SRS/err -I~SRS/fit -I~SRS/gsl
-I~SRS/histogram -I~SRS/iee-utils - I~SRS/integration
-I~SRS/interpolation -I~SRS/linalg -I~SRS/matrix -I~SRS/min -I~SRS/monte
-I~SRS/multifit -I~SRS/multimin -I~SRS/multiroots -I~SRS/multiset
-I~SRS/ntuple -I~SRS/ode-initval -I~SRS/permuation -I~SRS/poly
-I~SRS/qrng - I~SRS/randist -I~SRS/rng -I~SRS/roots -I~SRS/siman
-I~SRS/sort -I~SRS/specfunc -I~SRS/statistics -I~SRS/sum -I~SRS/sys
-I~SRS/test -I~SRS/utils -I~SRS/vector -I~SRS/wavelet
-I/home/TESTS/BUILDgsl -I~SRS   -msse2 -mfpmath=sse -msse3 - mfpmath=sse
-Wall -o CMakeFiles/gsl.dir/__/test/results.c.o   -c ~SRS/test/results.c
~SRS/test/results.c: In function 'gsl_test':
~SRS/test/results.c:89: error: 'va_list' undeclared (first use in this
function)
~SRS/test/results.c:89: error: (Each undeclared identifier is reported
only once
~SRS/test/results.c:89: error: for each function it appears in.)
~SRS/test/results.c:89: error: expected ';' before 'ap'
~SRS/test/results.c:93: warning: implicit declaration of function
'va_start' ~SRS/test/results.c:93: error: 'ap' undeclared (first use in
this function) ~SRS/test/results.c:96: warning: implicit declaration of
function 'va_end' ~SRS/test/results.c: In function 'gsl_test_rel':
~SRS/test/results.c:149: error: 'va_list' undeclared (first use in this
function)
~SRS/test/results.c:149: error: expected ';' before 'ap'
~SRS/test/results.c:153: error: 'ap' undeclared (first use in this
function) ~SRS/test/results.c: In function 'gsl_test_abs':
~SRS/test/results.c:225: error: 'va_list' undeclared (first use in this
function)
~SRS/test/results.c:225: error: expected ';' before 'ap'
~SRS/test/results.c:230: error: 'ap' undeclared (first use in this
function) ~SRS/test/results.c: In function 'gsl_test_factor':
~SRS/test/results.c:302: error: 'va_list' undeclared (first use in this
function)
~SRS/test/results.c:302: error: expected ';' before 'ap'
~SRS/test/results.c:307: error: 'ap' undeclared (first use in this
function) ~SRS/test/results.c: In function 'gsl_test_int':
~SRS/test/results.c:357: error: 'va_list' undeclared (first use in this
function)
~SRS/test/results.c:357: error: expected ';' before 'ap'
~SRS/test/results.c:362: error: 'ap' undeclared (first use in this
function) ~SRS/test/results.c: In function 'gsl_test_str':
~SRS/test/results.c:401: error: 'va_list' undeclared (first use in this
function)
~SRS/test/results.c:401: error: expected ';' before 'ap'
~SRS/test/results.c:406: error: 'ap' undeclared (first use in this
function) make[2]: *** [Lib/CMakeFiles/gsl.dir/__/test/results.c.o]
Error 1 make[2]: Leaving directory `/home/TESTS/BUILDgsl'
make[1]: *** [Lib/CMakeFiles/gsl.dir/all] Error 2
make[1]: Leaving directory `/home/TESTS/BUILDgsl'
make: *** [all] Error 2



suggestions welcome

sincerely
luxInteg
   

The comp misses the declaration of the type va_list. if those errors
are the first ones, then this type is simply never declared. If it works
with the static library, you should have look which preprocessor flags
are used for the static libraries and compare them with the shared ones.

 

The  preprocessor flag appears to be -M.  When this is sumstituted  a 'patched
version of results.c does indeed compile and the build progresses to  ~70%
where   th results.c is again compiled  with a load of other files  into a
large library and there   are no obvius ways   to isolate its  compilation to
add the -M definition.  I tried set_source_file_properties(PROPERTIES compile
definitions -M)  but this adds a -D-M  which does not seem to be the same -
M.

Anyway the problem seems to be a troublesome test/results.c file.
(It is attached for your info )
   the unpatched version gives this response at the start of the build :-

#
In file included from ~/TESTS/gsl-1.15/test/results.c:32:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.2/include/varargs.h:4:2: error:
#error GCC no longer implementsvarargs.h.
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.2/include/varargs.h:5:2: error:
#error Revise your code to usestdarg.h.
make[2]: *** [test/CMakeFiles/gsltest-static.dir/results.c.o] Error 1
#

the file seems to need  updating   (extensively patched ) for newer compilers
so any suggestiions  you have  will be gratefully received.


sincerely
luxInteg
   
I think it is a bad idea to rely on the -M flag, because cmake tries to 
figure out the dependencies..


You could start with defining STDC_HEADERS, or let cmake look for the 
needed headers and set the flag appropriatly.


Re: [CMake] help with shared-lib make failure

2012-06-17 Thread luxInteg
On Sunday 17 June 2012 08:35:07 Andreas Naumann wrote:
 Am 17.06.2012 01:39, schrieb luxInteg:
  On Saturday 16 June 2012 09:45:56 luxInteg wrote:
  Greetings,
  
  Its been about 1 year since  since I had a go at learning cmake.
  My current setup has these:- OS 64bit(AMD) cblfs linux, gcc-4.4.2,
  cmake-2.8.7
  
  This is my current problem:
  My project has a  file  call this file1.c.
  CMake is used o generate makefile etc
  
  When make  compiles file1.c  it compiles it to  file1.c.o
  
  I have these directives in the CMake script
  
  --1--add_library(file1-static  file1.c)
  --2--add_library(file1  shared file1.c)
  
  --1-- executes and genetates a static library but  with --2-- I now get
  the error
  
  usr/bin/ld/CMakeFiles/... file1.c.o  file format not recognised 
  treating as a linker script
  usr/bin/ld/CMakeFiles/... file1.c.o:1 syntax error
  collect2 ld returned 1 exit status
  
  
  I never had this problem before so advice on what I  have wrong or doing
  wrong would be much appreciated.
  
  The linker for my project seems to require the object file(s) as   
  file1.o as opposed to file1.c.o othewise it will not make a shared
  library. I tried setting CMAKE_R_PATH as ${CMAKE_INSTALL_PREFIX}/lib
  and fiddled around with set_target_properties()  to no avail.
  
  So are there simple scripts that can  convert the file1.c.o ihto file1.o 
  or symlink to file1.o in
  in the ${PROJECT_BINARY_DIR}  to execute  just after compilation and
  before linking?
  
  thanks in advance
  luxInteg
  --
  
  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
 
 Hallo Lux,
 
 can you set the Makefiles to verbose mode, i.e. set the variabe
 CMAKE_VERBOSE_MAKEFILE to true and post the link commands?
 Possibly there is some error when using the linker.
 
 Regards
 Andreas Naumann

thanks for your response the compile output i below:

cd ~/cblas  /usr/local/bin/cmake -E cmake_link_script 
CMakeFiles/gslcblas.dir/link.txt --verbose=1
/usr/bin/gcc  -fPIC -m64 -fPIC  -msse2  -shared -Wl,-soname,libgslcblas.so -o 
libgslcblas.so CMakeFiles/gslcblas.dir/sasum.c.o 
CMakeFiles/gslcblas.dir/saxpy.c.o CMakeFiles/gslcblas.dir/scasum.c.o 
CMakeFiles/gslcblas.dir/scnrm2.c.o CMakeFiles/gslcblas.dir/scopy.c.o 
CMakeFiles/gslcblas.dir/sdot.c.o CMakeFiles/gslcblas.dir/sdsdot.c.o 
CMakeFiles/gslcblas.dir/sgbmv.c.o CMakeFiles/gslcblas.dir/sgemm.c.o 
CMakeFiles/gslcblas.dir/sgemv.c.o CMakeFiles/gslcblas.dir/sger.c.o 
CMakeFiles/gslcblas.dir/snrm2.c.o CMakeFiles/gslcblas.dir/srot.c.o 
CMakeFiles/gslcblas.dir/srotg.c.o CMakeFiles/gslcblas.dir/srotm.c.o 
CMakeFiles/gslcblas.dir/srotmg.c.o CMakeFiles/gslcblas.dir/ssbmv.c.o 
CMakeFiles/gslcblas.dir/sscal.c.o CMakeFiles/gslcblas.dir/sspmv.c.o 
CMakeFiles/gslcblas.dir/sspr.c.o CMakeFiles/gslcblas.dir/sspr2.c.o 
CMakeFiles/gslcblas.dir/sswap.c.o CMakeFiles/gslcblas.dir/ssymm.c.o 
CMakeFiles/gslcblas.dir/ssymv.c.o CMakeFiles/gslcblas.dir/ssyr.c.o 
CMakeFiles/gslcblas.dir/ssyr2.c.o CMakeFiles/gslcblas.dir/ssyr2k.c.o 
CMakeFiles/gslcblas.dir/ssyrk.c.o CMakeFiles/gslcblas.dir/stbmv.c.o 
CMakeFiles/gslcblas.dir/stbsv.c.o CMakeFiles/gslcblas.dir/stpmv.c.o 
CMakeFiles/gslcblas.dir/stpsv.c.o CMakeFiles/gslcblas.dir/strmm.c.o 
CMakeFiles/gslcblas.dir/strmv.c.o CMakeFiles/gslcblas.dir/strsm.c.o 
CMakeFiles/gslcblas.dir/strsv.c.o CMakeFiles/gslcblas.dir/dasum.c.o 
CMakeFiles/gslcblas.dir/daxpy.c.o CMakeFiles/gslcblas.dir/dcopy.c.o 
CMakeFiles/gslcblas.dir/ddot.c.o CMakeFiles/gslcblas.dir/dgbmv.c.o 
CMakeFiles/gslcblas.dir/dgemm.c.o CMakeFiles/gslcblas.dir/dgemv.c.o 
CMakeFiles/gslcblas.dir/dger.c.o CMakeFiles/gslcblas.dir/dnrm2.c.o 
CMakeFiles/gslcblas.dir/drot.c.o CMakeFiles/gslcblas.dir/drotg.c.o 
CMakeFiles/gslcblas.dir/drotm.c.o CMakeFiles/gslcblas.dir/drotmg.c.o 
CMakeFiles/gslcblas.dir/dsbmv.c.o CMakeFiles/gslcblas.dir/dscal.c.o 
CMakeFiles/gslcblas.dir/dsdot.c.o CMakeFiles/gslcblas.dir/dspmv.c.o 
CMakeFiles/gslcblas.dir/dspr.c.o CMakeFiles/gslcblas.dir/dspr2.c.o 
CMakeFiles/gslcblas.dir/dswap.c.o CMakeFiles/gslcblas.dir/dsymm.c.o 
CMakeFiles/gslcblas.dir/dsymv.c.o CMakeFiles/gslcblas.dir/dsyr.c.o 
CMakeFiles/gslcblas.dir/dsyr2.c.o CMakeFiles/gslcblas.dir/dsyr2k.c.o 
CMakeFiles/gslcblas.dir/dsyrk.c.o CMakeFiles/gslcblas.dir/dtbmv.c.o 
CMakeFiles/gslcblas.dir/dtbsv.c.o CMakeFiles/gslcblas.dir/dtpmv.c.o 
CMakeFiles/gslcblas.dir/dtpsv.c.o CMakeFiles/gslcblas.dir/dtrmm.c.o 
CMakeFiles/gslcblas.dir/dtrmv.c.o CMakeFiles/gslcblas.dir/dtrsm.c.o 
CMakeFiles/gslcblas.dir/dtrsv.c.o CMakeFiles/gslcblas.dir/dzasum.c.o 
CMakeFiles/gslcblas.dir/dznrm2.c.o CMakeFiles/gslcblas.dir/caxpy.c.o 
CMakeFiles/gslcblas.dir/ccopy.c.o CMakeFiles/gslcblas.dir/cdotc_sub.c.o 
CMakeFiles/gslcblas.dir/cdotu_sub.c.o CMakeFiles/gslcblas.dir/cgbmv.c.o 

[CMake] help with shared-lib make failure

2012-06-16 Thread luxInteg
Greetings,

Its been about 1 year since  since I had a go at learning cmake.
My current setup has these:- OS 64bit(AMD) cblfs linux, gcc-4.4.2, cmake-2.8.7

This is my current problem:
My project has a  file  call this file1.c.  
CMake is used o generate makefile etc 

When make  compiles file1.c  it compiles it to  file1.c.o

I have these directives in the CMake script

--1--add_library(file1-static  file1.c)
--2--add_library(file1  shared file1.c)

--1-- executes and genetates a static library but  with --2-- I now get the 
error 

usr/bin/ld/CMakeFiles/... file1.c.o  file format not recognised  treating as a 
linker script
usr/bin/ld/CMakeFiles/... file1.c.o:1 syntax error
collect2 ld returned 1 exit status


I never had this problem before so advice on what I  have wrong or doing wrong 
would be much appreciated.

sincerely
lux-integ
--

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] help with shared-lib make failure

2012-06-16 Thread luxInteg
On Saturday 16 June 2012 09:45:56 luxInteg wrote:
 Greetings,
 
 Its been about 1 year since  since I had a go at learning cmake.
 My current setup has these:- OS 64bit(AMD) cblfs linux, gcc-4.4.2,
 cmake-2.8.7
 
 This is my current problem:
 My project has a  file  call this file1.c.
 CMake is used o generate makefile etc
 
 When make  compiles file1.c  it compiles it to  file1.c.o
 
 I have these directives in the CMake script
 
 --1--add_library(file1-static  file1.c)
 --2--add_library(file1  shared file1.c)
 
 --1-- executes and genetates a static library but  with --2-- I now get the
 error
 
 usr/bin/ld/CMakeFiles/... file1.c.o  file format not recognised  treating
 as a linker script
 usr/bin/ld/CMakeFiles/... file1.c.o:1 syntax error
 collect2 ld returned 1 exit status
 
 
 I never had this problem before so advice on what I  have wrong or doing
 wrong would be much appreciated.
 
The linker for my project seems to require the object file(s) asfile1.o as 
opposed to file1.c.o othewise it will not make a shared library.
I tried setting CMAKE_R_PATH as ${CMAKE_INSTALL_PREFIX}/lib and fiddled 
around with set_target_properties()  to no avail.

So are there simple scripts that can  convert the file1.c.o ihto file1.o  or 
symlink to file1.o in  
in the ${PROJECT_BINARY_DIR}  to execute  just after compilation and before 
linking?

thanks in advance
luxInteg
--

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