Errors when compiling 3R9 under Cygwin

Hello,

When helping my girlfriend (civil engineering PhD-student, CC on this
mail) compilling Radiance 3R9 I encountered the following problems:

When compiling I got the following errors:

ezxml.c: In function `ezxml_parse_fd':
ezxml.c:643: error: `MADV_SEQUENTIAL' undeclared (first use in this function)
ezxml.c:643: error: (Each undeclared identifier is reported only once
ezxml.c:643: error: for each function it appears in.)
ezxml.c:645: error: `MADV_NORMAL' undeclared (first use in this function)
make: *** [ezxml.o] Error 1
make: Target `install' not remade because of errors.

The errors are caused by the lack of a full set of definitions of the
macros in the version of the header file 'sys/mman.h' supplied with
the cygwin system (we are using the latest version available on
cygwin.com). Therefore the macros MADV_SEQUENTIAL and MADV_NORMAL are
not replaced by correct values by the preprocessor simply because no
definitions of the macros exist in the included header file.

As it can be seen this leads to a situation where the target 'install'
is not remade completely by Make leading to all sorts of strange
faults if the already built binaries are attempted used.

I have no suggestions for a resolution to the fault at the moment
since I have never developed anything for Cygwin and therefore I have
no knowledge about the internals of Cygwin. I have however been able
to identify a file in the cygwin tree where a definition of an
enumeration containing the needed macros are given. I don't know if
this is useful in any way.

I have been unable to locate a bug reporting system on your homepage
why I am writing this list instead. I hope this is all right.

Best regards
Esben Rugbjerg
M.Sc. in engineering (software)

···

--

cand.polyt
Esben Rugbjerg
Guldborgvej 44, 3.th.
2000 Frederiksberg
Danmark
email: [email protected]
mobil-tlf.: +45 28715166

Hi Esben,

Try adding "-DEZXML_NOMMAP" to the rmake script and rerunning "makeall install" in the main directory or "rmake install" in the src/gen directory. Th ezxml.c module is new with this release and was provided by a third party, so I'm not well familiar with its portability issues. So far, it seems quite robust.

There isn't a bug reporting system for Radiance, so thanks for alerting us to the problem. Cygwin is not a properly supported platform, so you're on the bleeding edge.

Cheers,
-Greg

Hi,

ezxml.c: In function `ezxml_parse_fd':
ezxml.c:643: error: `MADV_SEQUENTIAL' undeclared (first use in this function)

have a look if there's /usr/include/sys/mman.h and what is defined in
there, if the file exists at all.
If so you'll probably find POSIX_MADV_SEQUENTIAL and POSIX_MADV_NORMAL,
try to replace MADV_SEQUENTIAL/MADV_NORMAL by them. Unfortunately I
can't tell if it's save to replace them by default, but afaik it is.

Hope that helps,

Bernd

···

--
Bernd Zeimetz Debian GNU/Linux Developer
GPG Fingerprint: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79

Hi Greg,

Thank you for your quick answer.

Your proposed solution seems to solve the problem as no errror are
reported by the compiler any more.

I've found a code snippet from another project where they set
EZXML_NOMMAP whenever the code is compiled for Cygwin:

/* disable MMAP on CYGWIN, seems to cause problems... */
#ifdef CYGWIN
#define EZXML_NOMMAP
#endif

This could maybe be a solution for Radiance too. This will of course
require some modifications of the build system but will provide a
generic solution which can be extended if Cygwin causes other problems
and therefore needs special treatment :-).

Best regards
Esben

···

On Thu, Jun 5, 2008 at 5:52 PM, Gregory J. Ward <[email protected]> wrote:

Hi Esben,

Try adding "-DEZXML_NOMMAP" to the rmake script and rerunning "makeall
install" in the main directory or "rmake install" in the src/gen directory.
Th ezxml.c module is new with this release and was provided by a third
party, so I'm not well familiar with its portability issues. So far, it
seems quite robust.

There isn't a bug reporting system for Radiance, so thanks for alerting us
to the problem. Cygwin is not a properly supported platform, so you're on
the bleeding edge.

Cheers,
-Greg

_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev

--

cand.polyt
Esben Rugbjerg
Guldborgvej 44, 3.th.
2000 Frederiksberg
Danmark
email: [email protected]
mobil-tlf.: +45 28715166

Hi Bernd,

Thank you for your suggestion.

I have grep'ed around in the include dirs of Cygwin but could not
locate the Posix versions of the macros anywhere. In the file
/usr/include/d/3.4.4/std/c/linux/linux.d however at least the
MADV_SEQUENTIAL and ditto NORMAL are defined in an enumeration as
mentioned in my first mail. Since I don't know the internals of Cygwin
I don't know the purpose of this enumeration.

Best regards
Esben

···

On Thu, Jun 5, 2008 at 6:25 PM, Bernd Zeimetz <[email protected]> wrote:

Hi,

ezxml.c: In function `ezxml_parse_fd':
ezxml.c:643: error: `MADV_SEQUENTIAL' undeclared (first use in this function)

have a look if there's /usr/include/sys/mman.h and what is defined in
there, if the file exists at all.
If so you'll probably find POSIX_MADV_SEQUENTIAL and POSIX_MADV_NORMAL,
try to replace MADV_SEQUENTIAL/MADV_NORMAL by them. Unfortunately I
can't tell if it's save to replace them by default, but afaik it is.

Hope that helps,

Bernd

--
Bernd Zeimetz Debian GNU/Linux Developer
GPG Fingerprint: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79

_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev

--

cand.polyt
Esben Rugbjerg
Guldborgvej 44, 3.th.
2000 Frederiksberg
Danmark
email: [email protected]
mobil-tlf.: +45 28715166

Thanks, Esben. This is an excellent suggestion -- I didn't know what macros were predefined under Cygwin, so this is a big help. I'll check it into CVS for the next distribution.

Cheers,
-Greg

···

From: "Esben Rugbjerg" <[email protected]>
Date: June 5, 2008 1:36:24 PM PDT

Hi Greg,

Thank you for your quick answer.

Your proposed solution seems to solve the problem as no errror are
reported by the compiler any more.

I've found a code snippet from another project where they set
EZXML_NOMMAP whenever the code is compiled for Cygwin:

/* disable MMAP on CYGWIN, seems to cause problems... */
#ifdef CYGWIN
#define EZXML_NOMMAP
#endif

This could maybe be a solution for Radiance too. This will of course
require some modifications of the build system but will provide a
generic solution which can be extended if Cygwin causes other problems
and therefore needs special treatment :-).

Best regards
Esben