[CMake] Regression between 2.4.8 and 2.6.2 for the macada version of the gcc compiler

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Jan 28 00:37:15 EST 2009


One of the PLplot developers has been using the macada version of the gcc
compiler on Mac OS X for a long time because that version gives him an
integrated Ada compiler as well.  That compiler worked well for cmake-2.4,
but he has recently run into build problems for cmake-2.6.

The issue can be illustrated by a simple "hello-world" shared library
build test project with SOVERSION and VERSION specified for the library.
You can svn checkout that simple test from 
https://plplot.svn.sourceforge.net/svnroot/plplot/branches/test_cmake/test_c_library_build

His platform is OS X version 10.4.11 on a ppc processor.

I present three different VERBOSE=1 "make" output results that he obtained
with the above simple test project.

I) CMake-2.6.2 using the standard Apple compiler with the following gcc -v
results:

Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5363.obj~28/src/configure -- 
disable-checking -enable-werror --prefix=/usr --mandir=/share/man -- 
enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg] 
[^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with- 
slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc-apple- 
darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5363)

For this compiler all is well for CMake-2.6.2 (see the attached
make.out_gcc_std_2.6.2). However, note he cannot use that standard compiler
for his ordinary PLplot development that strongly focusses on Ada.

II) CMake-2.4.8 using the macada gcc compiler with the following gcc -v
results:

Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /Users/drew/Developer/Compiler/gcc-head/configure
--disable-checking --disable-nls --enable-static --prefix=/usr/local/ada-4.3
--host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
--build=powerpc-apple-darwin8
--enable-languages=c,ada,c++,fortran,objc,obj-c++
Thread model: posix
gcc version 4.3.0 20070904 (experimental) [trunk revision 128067] (GCC)

For this compiler all is well for CMake-2.4.8 (see the attached 
make.out_gcc_macada_2.4.8).  The macada compiler package also provides an
integrated Ada compiler so this is the one he has been using for his PLplot
development. Note, the linking for 2.4.8 is done without use of the
-current_version flag.

III) CMake-2.6.2 using the macada gcc compiler with the above
gcc -v results.  For this compiler all is not well for CMake-2.6.2 (see the
attached make.out_gcc_macada_2.6.2).  The -current_version
flag used by CMake-2.6.2 is not recognized by this compiler (or probably more
likely the linker associated with this compiler).

That flag is specified by cmake-2.6/Modules/Platform/Darwin.cmake.

Can somebody recommend a fix to that file so that CMake-2.6.2 works just as
well as CMake-2.4.8 for the macada version of the gcc compiler?

I have no idea whether gcc should always be expected to recognize the
-current_version flag.  That is, I cannot conclude one way or the other
whether this problem is due to a macada compiler deficiency or incorrect
CMake-2.6.2 assumption about gcc.  However, this developer is currently
completely stuck because PLplot now uses 2.6.0 as the minimum version. (I
got tired of maintaining build-system logic for the two separate versions so
I recently ripped out the 2.4.8-specific stuff.  It was only at that point,
that it turned out this developer had failed to do the requested testing of
2.6.0 before the final changeover, but that is the way it often goes when
testing is requested.)

I hope somebody can come up with an idea to at least work around the issue
for CMake-2.6.x because I would hate to be forced to put the 2.4.8 cruft
back into the PLplot build system.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
-------------- next part --------------
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp
Running make.
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -H/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build -B/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp --check-build-system CMakeFiles/Makefile.cmake 0
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_start /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/depend
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_depends "Unix Makefiles" /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake --color=
Dependee "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake" is newer than depender "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/depend.internal".
Scanning dependencies of target Hello
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/build
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 1
[ 50%] Building C object Hello/CMakeFiles/Hello.dir/hello.c.o
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && /usr/bin/gcc   -DHello_EXPORTS -fPIC   -o CMakeFiles/Hello.dir/hello.c.o   -c /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello/hello.c
Linking C shared library libHello.dylib
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/Hello.dir/link.txt --verbose=1
/usr/bin/gcc   -dynamiclib -headerpad_max_install_names -Wl,-current_version,0.0.1 -o libHello.0.0.1.dylib -install_name /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/libHello.0.0.dylib CMakeFiles/Hello.dir/hello.c.o 
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_symlink_library libHello.0.0.1.dylib libHello.0.0.dylib libHello.dylib
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles  1
[ 50%] Built target Hello
make -f Demo/CMakeFiles/helloDemo.dir/build.make Demo/CMakeFiles/helloDemo.dir/depend
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_depends "Unix Makefiles" /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Demo /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo/CMakeFiles/helloDemo.dir/DependInfo.cmake --color=
Dependee "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo/CMakeFiles/helloDemo.dir/DependInfo.cmake" is newer than depender "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo/CMakeFiles/helloDemo.dir/depend.internal".
Scanning dependencies of target helloDemo
make -f Demo/CMakeFiles/helloDemo.dir/build.make Demo/CMakeFiles/helloDemo.dir/build
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 2
[100%] Building C object Demo/CMakeFiles/helloDemo.dir/demo.c.o
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo && /usr/bin/gcc   -I/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello   -o CMakeFiles/helloDemo.dir/demo.c.o   -c /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Demo/demo.c
Linking C executable helloDemo
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/helloDemo.dir/link.txt --verbose=1
/usr/bin/gcc   -Wl,-search_paths_first -headerpad_max_install_names -fPIC CMakeFiles/helloDemo.dir/demo.c.o  -o helloDemo  -L/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello ../Hello/libHello.0.0.1.dylib 
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles  2
[100%] Built target helloDemo
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_start /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 0
Done
-------------- next part --------------
/usr/bin/cmake -H/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build -B/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp --check-build-system CMakeFiles/Makefile.cmake 0
Clearing dependencies in "Hello/CMakeFiles/Hello.dir/depend.make".
Clearing dependencies in "Hello/CMakeFiles/Hello.dir/depend.internal".
Clearing dependencies in "Demo/CMakeFiles/helloDemo.dir/depend.make".
Clearing dependencies in "Demo/CMakeFiles/helloDemo.dir/depend.internal".
/usr/bin/cmake -E cmake_progress_start /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 2
make -f CMakeFiles/Makefile2 all
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/depend
Scanning dependencies of target Hello
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/build
/usr/bin/cmake -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 1
[ 50%] Building C object Hello/CMakeFiles/Hello.dir/hello.o
/usr/local/ada-4.3/bin/gcc  -DHello_EXPORTS   -fPIC   -o Hello/CMakeFiles/Hello.dir/hello.o   -c /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello/hello.c
Linking C shared library libHello.dylib
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && /usr/bin/cmake -P CMakeFiles/Hello.dir/cmake_clean_target.cmake
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && /usr/bin/cmake -E cmake_link_script CMakeFiles/Hello.dir/link.txt --verbose=1
/usr/local/ada-4.3/bin/gcc    -dynamiclib -headerpad_max_install_names  -o libHello.0.0.1.dylib -install_name /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/libHello.0.0.dylib "CMakeFiles/Hello.dir/hello.o" 
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && /usr/bin/cmake -E cmake_symlink_library libHello.0.0.1.dylib libHello.0.0.dylib libHello.dylib
/usr/bin/cmake -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles  1
[ 50%] Built target Hello
make -f Demo/CMakeFiles/helloDemo.dir/build.make Demo/CMakeFiles/helloDemo.dir/depend
Scanning dependencies of target helloDemo
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Demo /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo/CMakeFiles/helloDemo.dir/DependInfo.cmake
make -f Demo/CMakeFiles/helloDemo.dir/build.make Demo/CMakeFiles/helloDemo.dir/build
/usr/bin/cmake -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 2
[100%] Building C object Demo/CMakeFiles/helloDemo.dir/demo.o
/usr/local/ada-4.3/bin/gcc  -I/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello   -o Demo/CMakeFiles/helloDemo.dir/demo.o   -c /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Demo/demo.c
Linking C executable helloDemo
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo && /usr/bin/cmake -P CMakeFiles/helloDemo.dir/cmake_clean_target.cmake
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Demo && /usr/local/ada-4.3/bin/gcc    -headerpad_max_install_names -fPIC "CMakeFiles/helloDemo.dir/demo.o"   -o helloDemo  -L/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello -lHello 
/usr/bin/cmake -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles  2
[100%] Built target helloDemo
/usr/bin/cmake -E cmake_progress_start /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 0
Done
-------------- next part --------------
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/local/ada-4.3/bin/gcc
-- Check for working C compiler: /usr/local/ada-4.3/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp
Running make.
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -H/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build -B/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp --check-build-system CMakeFiles/Makefile.cmake 0
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_start /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/depend
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_depends "Unix Makefiles" /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake --color=
Dependee "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake" is newer than depender "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/depend.internal".
Scanning dependencies of target Hello
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/build
"/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 1
[ 50%] Building C object Hello/CMakeFiles/Hello.dir/hello.c.o
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && /usr/local/ada-4.3/bin/gcc   -DHello_EXPORTS -fPIC   -o CMakeFiles/Hello.dir/hello.c.o   -c /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello/hello.c
Linking C shared library libHello.dylib
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && "/Applications/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/Hello.dir/link.txt --verbose=1
/usr/local/ada-4.3/bin/gcc   -dynamiclib -headerpad_max_install_names -Wl,-current_version,0.0.1 -o libHello.0.0.1.dylib -install_name /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/libHello.0.0.dylib CMakeFiles/Hello.dir/hello.c.o 
/usr/bin/ld: unknown flag: -current_version
collect2: ld returned 1 exit status
make[2]: *** [Hello/libHello.0.0.1.dylib] Error 1
make[1]: *** [Hello/CMakeFiles/Hello.dir/all] Error 2
make: *** [all] Error 2
Done


More information about the CMake mailing list