PR# 18300 Precompiling EiffelBase SCOOP gives C compilation errors with Sun C compiler on Linux
Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2012/08/14
Class: Bug
Severity: Serious
Number: 18300
Release: 7.1.88986
Confidential: No
Status: Open
Responsible:
Environment: Linux x86 64-bit
Synopsis: Precompiling EiffelBase SCOOP gives C compilation errors with Sun C compiler on Linux
Description
We are experimenting with Linux x86 and Linux x86 64-bit versions of Eiffel 7.1.88986. We are using the Sun C compiler 12.3 (now "Oracle Solaris Studio") instead of gcc. When I try to precompile base-scoop-safe.ecf the C compiler reports the following errors: "/home/eiffel/Eiffel7.1.88986/studio/spec/linux-x86-64/include/eif_atomops.h", line 44: cannot find include file: <sys/atomic.h> "at15.c", line 109: warning: implicit function declaration: atomic_cas_32 "at15.c", line 154: warning: implicit function declaration: atomic_swap_32 "at15.c", line 195: warning: implicit function declaration: atomic_add_32_nv Note that if we do use Eiffel on Linux, we plan to use the Sun C compiler. This problem makes it hard to run the full eweasel test suite, since all tests using precompiled SCOOP base will fail.
To Reproduce
Precompile base-scoop-safe.ecf on Linux 86 64-bit using Sun C compiler (free for commercial use, but updates are not free of course).
Problem Report Interactions
I can't find any header files named atomic.h on the Linux machine: hilbert.isi.edu 175% find /opt/oracle/solarisstudio12.3/include -name atomic.h hilbert.isi.edu 176% find /usr/include -name atomic.h On Solaris 10 (SPARC or x86): cantor 684% find /usr/include -name atomic.h /usr/include/atomic.h /usr/include/sys/atomic.h Perhaps there is a missing package that we need to install on RHEL. I will ask about that today.
Hi Dave, The current atomic operations preprocessing is as follows. #if defined(__SUNPRO_C) #if defined (__SunOS_5_9) // Atomic Operations are for Solaris 10 and above #else #include <sys/atomic.h> #define __EIF_SUNPRO_C_ATOMOPS__ #endif #endif Does the Sun Studio C compiler on Linux include atomic.h? The fix may be as simple as changing <sys/atomic.h> to just <atomic.h>.