[CMake] Compile/install on HPUX on ia64 (Itanium)

David Akdikmen dakdikmen at accusoft.com
Wed Jun 28 16:51:03 EDT 2006


HI,

Sorry for the almost double posts,  I found that changing the test code
to put the __attribute__ inside the format parameters cause error as
expected:
It compiles on gcc fine and fails on HPUX cc.

test.c
-------------------------------------------------------------
#include <stdio.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <wchar.h>

int main(int argc __attribute__((__unused__)), char **argv
__attribute__((__unused__))) { int x __attribute__((__unused__)) ;
return 0; }
---------------------------------------------------------------
cc gives errors on the __attribute__

Error 20: "test.c", line 6 # ',' expected before '__attribute__'.
    int main(int argc __attribute__((__unused__)), char **argv
__attribute__((__unused
                      ^^^^^^^^^^^^^

Error 20: "test.c", line 6 # ',' expected before '__attribute__'.
    int main(int argc __attribute__((__unused__)), char **argv
__attribute__((__unused__))) { int x __attribute__((__unused__))
 
^^^^^^^^^^^^^    
Error 341: "test.c", line 6 # ANSI C expects identifier name for
parameter declaration.
    int main(int argc __attribute__((__unused__)), char **argv
__attribute__((__unused
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error 341: "test.c", line 6 # ANSI C expects identifier name for
parameter declaration.
    int main(int argc __attribute__((__unused__)), char **argv
__attribute__((__unused__))) { int x __attribute__((__unused__))
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^

-----Original Message-----
From: cmake-bounces+dakdikmen=accusoft.com at cmake.org
[mailto:cmake-bounces+dakdikmen=accusoft.com at cmake.org] On Behalf Of
David Akdikmen
Sent: Wednesday, June 28, 2006 4:37 PM
To: Brad King
Cc: cmake at cmake.org; William A. Hoffman
Subject: RE: [CMake] Compile/install on HPUX on ia64 (Itanium)

Odd, I'm not sure what's going on.  When I cc the file at the command
prompt, it doesn't complain about the __attribute__ symbols. It looks
like it is complaining about not having a LF at the end of the file?

It looks like it thinks __attribute__ is just some function returning
int?

Does your version of the HPUX compiler have __attribute__ defined?  What
happens on your machine for the ATTR_UNUSED_VAR test?

I'll include both the results, one with "+p" and one without "+p"

I unset the "+p" flag and re-ran the configure (after deleting all the
CMakeCache.txt files)

Here is the CMakeOutput.log (it claims success with out the +p)
--------------------------------------------
Performing C SOURCE FILE Test ATTR_UNUSED_VAR succeded with the
following output:
        make -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
Building C object CMakeFiles/cmTryCompileExec.dir/src.o
        /usr/bin/cc  -Aa -Ae     -o
CMakeFiles/cmTryCompileExec.dir/src.o   -c
/home/khoros/cmake-2.4.2/CMakeFiles/CMakeTmp/src.c
Error (future) 690:
"/home/khoros/cmake-2.4.2/CMakeFiles/CMakeTmp/src.c", line 6 # Nonempty
source files must end with a newline that is not preceded by a
backslash.
Warning:        1 future errors were detected and ignored. Add a '+p'
option to detect and fix them before they become fatal errors in a
future release. Behavior of this ill-formed program is not guaranteed to
match that of a well-formed program
Linking C executable cmTryCompileExec
        /home/khoros/cmake-2.4.2/Bootstrap.cmk/cmake -P
CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
        /usr/bin/cc     -Aa -Ae    +Z
"CMakeFiles/cmTryCompileExec.dir/src.o"   -o cmTryCompileExec -Wl,+s
-Wl,-E

Source file was:
#include <stdio.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <wchar.h>

int main() { int x __attribute__((__unused__)) ; return 0; }
APPEND-------------------------------

Here is the CMakeError.log when +p is added to the CFLAG.
--------------------------------------------
Performing C SOURCE FILE Test ATTR_UNUSED_VAR failed with the following
output:
        make -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompi
leExec.dir/build
Building C object CMakeFiles/cmTryCompileExec.dir/src.o
        /usr/bin/cc  +p  -Aa -Ae     -o
CMakeFiles/cmTryCompileExec.dir/src.o
-c /home/khoros/cmake-2.4.2/CMakeFiles/CMakeTmp/src.c
Error 690: "/home/khoros/cmake-2.4.2/CMakeFiles/CMakeTmp/src.c", line 6
# Nonempty source files must end with a newline that is not preceded by
a backslash.
*** Error exit code 2

Stop.
*** Error exit code 1

Stop.

Source file was:
#include <stdio.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <wchar.h>

int main() { int x __attribute__((__unused__)) ; return 0; }
APPEND----------------------------------------------------------

-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com] 
Sent: Wednesday, June 28, 2006 3:19 PM
To: David Akdikmen
Cc: cmake at cmake.org; William A. Hoffman
Subject: Re: [CMake] Compile/install on HPUX on ia64 (Itanium)

David Akdikmen wrote:
> Success with latest from CVS!!! Both make and make install seems to
> work, Thanks,

Great.

> I added the option by setting the environment variables before running
> configure.
> 
> (At the bash prompt before running configure)
> 
> export CFLAGS="+p"
> export CXXFLAGS="+p"

What was the original output in the log file that told you that this 
option is needed?  Can you compile the source

------ t1.c -------------
int main() { return 0; }
-------------------------

with just

cc +p t1.c

using the C compiler?  What about the C++ compiler (rename to t1.cxx)?

> BTW: I had to delete the whole directory in order to run configure
> again, otherwise it would pick up the old results.

Actually you just had to remove CMakeCache.txt where the results are
stored.

-Brad
_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list