compile radiance HEAD 3332 with cmake on command line / linux

Dear all,

I tried to compile radiance HEAD 3332 from source (snapshot) on an openSUSE
12.2 64bit box with cmake 2.8.9; gcc 4.7.1, but don't get a working version of
radiance.

As I couldn't find much documentation on the cmake build for radiance and I
haven't used cmake much, It would be good to get some guidance.

Here is what I did:

1. Untar src
/> tar xvf radiance-HEAD-ecd3332.tar.gz

2. change into directory and call cmake
/>cd radiance-HEAD-ecd3332
/>cmake src/

Everything looks good, except for the following warning:
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present. A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file. The version specified may be lower
  if you wish to support older CMake versions for this project. For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

3. Build binaries from source
/>make -i

4. Install
/>make install -i

Following things I noticed:
1. Build fails when not using -i with make, as there are many issues regarding
a missing Version.c file, like:
:
[ 37%] Built target genworm
[ 37%] Generating /src/rt/Version.c
CMake Error: Error processing file:/src/rt/create_version.cmake
make[2]: *** [/src/rt/Version.c] Error 1
make[1]: *** [rt/CMakeFiles/radiance.dir/all] Error 2
make: *** [all] Error 2

2. There is no build/ directory created when building that holds the resulting
binaries etc.

Questions:
1. Is there anything obvious, I should do differently?
2. How do I install executables etc. to /usr/ rather than /usr/local/ e.g
/usr/bin or /usr/share/radiance/ etc. without patching the sources/cmake files?

Thanks for your help.

Denny

Hi Andy,
I seen the video before. That is a great demo. However, it's also confusing to
have several options to build available not knowing it which state they are.

Why I gave cmake a go is quite simple:
In order to create rpm's automatically on a build system, you need to have an
non-interactive build process.
The interactive makeall script doesn't help here as it requires user
interaction. It would require patching to disable it, what you need to rework
everytime things changed in the script.

Would there be a config file or similar together with a non-interactive mode, I
could use that. As it is now, it's quite hard to work around it. I was hoping
cmake/scons would help here - as it wasn't my first attempt to package
radiance.

Denny

Hi Denny,

I want to know more about why you're using cmake. The cmake build system was
added by NREL as part of their quest to provide windows installers. If you're
using cmake because you want to try it out and work out all the kinks, then
carry on.

If your goal is to install a working HEAD version of Radiance on a linux os,
then you are probably better served using the makeall script. The makeall
script is the most reliable build option for unix type operating systems
(since that is what the Greg uses). Also, makeall.sh is updated by Greg when
he adds new programs - cmake updates take longer because NREL needs to do
them, and pass them back to Greg. Someday cmake might be the preferred build
platform for Radiance, but for now if you're using Linux, you're better off
with makeall.sh. You can follow these instructions (written for compiling on
mac). Ignore the first step - installing xcode.
http://www.radiance-online.org/download-install/installation-information/mac-
osx-1#Compiling

Andy

Dear all,
when compiling with static libraries, I get a dependency error when the
program gets packaged for rpm:

file:
src/util/trad.wsh:
contains
#!/usr/local/bin/wish4.0

and therefor a dependency is automatically generated for it, which is not
allowed/possible.

Solution (if wish is still needed):
Replace the line with
#!/usr/bin/wish

which will create a dependency a tk package meets.

Regards,

Denny

···

Am Donnerstag, 25. Oktober 2012, 10:12:07 schrieb Andrew McNeil:
On Thu, Oct 25, 2012 at 8:44 AM, Denny <[email protected]> wrote:

Am Dienstag, 23. Oktober 2012, 10:36:47 schrieb Guglielmetti, Robert:

Hi Denny,

Yeah there really isn't any documentation on the NREL site on how to
actually use the CMake build system in the Radiance source tree, yet. Pally
at IESve wrote up a great summary of her experience using CMake and posted
it here a couple/few months ago.

Sounds like you have CMake on your system. The quick bullet list of steps I
do is as follows:

1. create build directory in ray/
2. cd ray/build
3. cmake ..
4. ccmake .
4a. In the ccmake "gui", type 'c' to configure, fix any errors found
4b. Type 'g' to generate themakefiles; ccmake will then exit
5. make
if all goes well, then:
6. sudo make install

Lemme know if that helps.

- Rob

________________________________________
From: Denny [[email protected]]
Sent: Tuesday, October 23, 2012 9:10 AM
To: [email protected]
Subject: [Radiance-dev] compile radiance HEAD 3332 with cmake on command
line / linux

Dear all,

I tried to compile radiance HEAD 3332 from source (snapshot) on an openSUSE
12.2 64bit box with cmake 2.8.9; gcc 4.7.1, but don't get a working version
of radiance.

As I couldn't find much documentation on the cmake build for radiance and I
haven't used cmake much, It would be good to get some guidance.

Here is what I did:

1. Untar src

/> tar xvf radiance-HEAD-ecd3332.tar.gz

2. change into directory and call cmake

/>cd radiance-HEAD-ecd3332

/>cmake src/

Everything looks good, except for the following warning:

CMake Warning (dev) in CMakeLists.txt:

No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 2.8)

should be added at the top of the file. The version specified may be lower

if you wish to support older CMake versions for this project. For more

information run "cmake --help-policy CMP0000".

This warning is for project developers. Use -Wno-dev to suppress it.

3. Build binaries from source

/>make -i

4. Install

/>make install -i

Following things I noticed:

1. Build fails when not using -i with make, as there are many issues
regarding a missing Version.c file, like:

[ 37%] Built target genworm

[ 37%] Generating /src/rt/Version.c

CMake Error: Error processing file:/src/rt/create_version.cmake

make[2]: *** [/src/rt/Version.c] Error 1

make[1]: *** [rt/CMakeFiles/radiance.dir/all] Error 2

make: *** [all] Error 2

2. There is no build/ directory created when building that holds the
resulting binaries etc.

Questions:

1. Is there anything obvious, I should do differently?

2. How do I install executables etc. to /usr/ rather than /usr/local/ e.g
/usr/bin or /usr/share/radiance/ etc. without patching the sources/cmake
files?

Thanks for your help.

Denny

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

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

You could just copy the last part of the makeall script and use that to update the binaries once it's been successfully built the first time:

The below assumes a C-Shell. If you use Bourne or some other shell, you'll need to modify it:

set srcdirs=( common rt meta cv gen ot px hd util cal )
cd src
echo "Making programs..."
set errs=0
foreach i ( $srcdirs )
  pushd $i
  echo "In directory $i..."
  $rmake -k
  @ errs += $status
  popd
end
if ( $errs ) then
  echo "There were some errors."
else
  echo "Done."
endif

I could probably add a "-b" option for non-interactive mode if it's really that important.

Cheers,
-Greg

···

From: Denny <[email protected]>
Date: October 25, 2012 1:03:21 PM PDT

Hi Andy,
I seen the video before. That is a great demo. However, it's also confusing to have several options to build available not knowing it which state they are.

Why I gave cmake a go is quite simple:
In order to create rpm's automatically on a build system, you need to have an non-interactive build process.
The interactive makeall script doesn't help here as it requires user interaction. It would require patching to disable it, what you need to rework everytime things changed in the script.

Would there be a config file or similar together with a non-interactive mode, I could use that. As it is now, it's quite hard to work around it. I was hoping cmake/scons would help here - as it wasn't my first attempt to package radiance.

Denny

Greg,

a non interactive mode of the build process is necessary for packaging, as
probably all distributions by now use some sort of automated packaging system,
that has to work without any user interaction.

The install option that is provided at the moment has many disadvantages ()
compared to the package system used by most main distributions, and makes it
hard for the normal computer user to install the software.

regards,
Denny

···

Am Donnerstag, 25. Oktober 2012, 13:16:47 schrieb Gregory J. Ward:

You could just copy the last part of the makeall script and use that to
update the binaries once it's been successfully built the first time:

The below assumes a C-Shell. If you use Bourne or some other shell, you'll
need to modify it:

set srcdirs=( common rt meta cv gen ot px hd util cal )
cd src
echo "Making programs..."
set errs=0
foreach i ( $srcdirs )
  pushd $i
  echo "In directory $i..."
  $rmake -k
  @ errs += $status
  popd
end
if ( $errs ) then
  echo "There were some errors."
else
  echo "Done."
endif

I could probably add a "-b" option for non-interactive mode if it's really
that important.

Cheers,
-Greg

> From: Denny <[email protected]>
> Date: October 25, 2012 1:03:21 PM PDT
>
> Hi Andy,
> I seen the video before. That is a great demo. However, it's also
> confusing to have several options to build available not knowing it which
> state they are.
>
> Why I gave cmake a go is quite simple:
> In order to create rpm's automatically on a build system, you need to have
> an non-interactive build process. The interactive makeall script doesn't
> help here as it requires user interaction. It would require patching to
> disable it, what you need to rework everytime things changed in the
> script.
>
> Would there be a config file or similar together with a non-interactive
> mode, I could use that. As it is now, it's quite hard to work around it.
> I was hoping cmake/scons would help here - as it wasn't my first attempt
> to package radiance.
>
> Denny

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

Yes, well, Radiance was never really intended for "the normal computer user."

Nonetheless, I will see about adding a batch option to makeall when I have some time.

-Greg

···

From: Denny <[email protected]>
Date: October 25, 2012 1:30:35 PM PDT

Greg,

a non interactive mode of the build process is necessary for packaging, as probably all distributions by now use some sort of automated packaging system, that has to work without any user interaction.

The install option that is provided at the moment has many disadvantages () compared to the package system used by most main distributions, and makes it hard for the normal computer user to install the software.

regards,
Denny

Bernd Zeimtz has modifications to makeall that integrate it into the Debian packaging process--you might look at his work. Unless I had a substantial time to put into this, that would be the way I would go. I've looked just enough at the cmake scripts--I started on a MacPorts version--to know that there's a fair bit of work to do to make them reliable in Unix environments.

···

--
Randolph M. Fritz • [email protected]
Environmental Energy Technologies Division • Lawrence Berkeley Labs

On 2012-10-25 20:30:35 +0000, Denny said:

Greg,

a non interactive mode of the build process is necessary for packaging, as probably all distributions by now use some sort of automated packaging system, that has to work without any user interaction.

The install option that is provided at the moment has many disadvantages () compared to the package system used by most main distributions, and makes it hard for the normal computer user to install the software.

regards,
Denny

Am Donnerstag, 25. Oktober 2012, 13:16:47 schrieb Gregory J. Ward:
> You could just copy the last part of the makeall script and use that to
> update the binaries once it's been successfully built the first time:
> > The below assumes a C-Shell. If you use Bourne or some other shell, you'll
> need to modify it:
> > set srcdirs=( common rt meta cv gen ot px hd util cal )
> cd src
> echo "Making programs..."
> set errs=0
> foreach i ( $srcdirs )
> pushd $i
> echo "In directory $i..."
> $rmake -k
> @ errs += $status
> popd
> end
> if ( $errs ) then
> echo "There were some errors."
> else
> echo "Done."
> endif
> > I could probably add a "-b" option for non-interactive mode if it's really
> that important.
> > Cheers,
> -Greg
> > > From: Denny <[email protected]>
> > Date: October 25, 2012 1:03:21 PM PDT
> > > > Hi Andy,
> > I seen the video before. That is a great demo. However, it's also
> > confusing to have several options to build available not knowing it which
> > state they are.
> > > > Why I gave cmake a go is quite simple:
> > In order to create rpm's automatically on a build system, you need to have
> > an non-interactive build process. The interactive makeall script doesn't
> > help here as it requires user interaction. It would require patching to
> > disable it, what you need to rework everytime things changed in the
> > script.
> > > > Would there be a config file or similar together with a non-interactive
> > mode, I could use that. As it is now, it's quite hard to work around it.
> > I was hoping cmake/scons would help here - as it wasn't my first attempt
> > to package radiance.
> > > > Denny
> > _______________________________________________
> Radiance-dev mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/radiance-dev

The current cmake build files don't work on my Mac because I have multiple versions of the X11 include and library files on the system. Cmake unpredictably picks files from different versions and fails to build Radiance. On a machine with a clean install and nothing extra, the cmake build files will probably work. On a machine with the wrong history they produce unpredictable results.

I have no idea what behaviors the cmake build files will produce across a broad range of other Unix systems. :frowning:

I do have an attempt at a solution to the "random X11 pieces on Mac" problem, but it is not complete and not thorougly tested. I never got the libtiff part going on my system. Rob, if you'd like the X11 patches for your distribution, you can have them, but they will have to be tested.

Randolph

Randolph,
thanks for pointing Bernds work out. I've seen the debian/ubuntu packaging and
contacted Bernd before I posted to the dev list.
So far, I didn't get a reply from Bernd. However, Bernd had to do quite a few
workarounds with the makeall install procedure and because that has been quite
some time ago, I thought I give the new cmake a chance, as that looked more
promising.

Regarding the cmake scripts - trying them for some time now, I had the same
impression.

Denny

···

Am Donnerstag, 25. Oktober 2012, 15:07:15 schrieb Randolph M. Fritz:

Bernd Zeimtz has modifications to makeall that integrate it into the
Debian packaging process--you might look at his work. Unless I had a
substantial time to put into this, that would be the way I would go.
I've looked just enough at the cmake scripts--I started on a MacPorts
version--to know that there's a fair bit of work to do to make them
reliable in Unix environments.

>
> Greg,
>
> a non interactive mode of the build process is necessary for packaging,
> as probably all distributions by now use some sort of automated
> packaging system, that has to work without any user interaction.
>
> The install option that is provided at the moment has many
> disadvantages () compared to the package system used by most main
> distributions, and makes it hard for the normal computer user to
> install the software.
>
> regards,
> Denny
>
>
> Am Donnerstag, 25. Oktober 2012, 13:16:47 schrieb Gregory J. Ward:
> > You could just copy the last part of the makeall script and use that to
> > update the binaries once it's been successfully built the first time:
> >
> > The below assumes a C-Shell. If you use Bourne or some other shell,
> > you'll
> > need to modify it:
> >
> > set srcdirs=( common rt meta cv gen ot px hd util cal )
> > cd src
> > echo "Making programs..."
> > set errs=0
> > foreach i ( $srcdirs )
> >
> > pushd $i
> > echo "In directory $i..."
> > $rmake -k
> > @ errs += $status
> > popd
> >
> > end
> > if ( $errs ) then
> >
> > echo "There were some errors."
> >
> > else
> >
> > echo "Done."
> >
> > endif
> >
> > I could probably add a "-b" option for non-interactive mode if it's
> > really
> > that important.
> >
> > Cheers,
> > -Greg
> >
> > > From: Denny <[email protected]>
> > > Date: October 25, 2012 1:03:21 PM PDT
> > >
> > > Hi Andy,
> > > I seen the video before. That is a great demo. However, it's also
> > > confusing to have several options to build available not knowing it
> > > which
> > > state they are.
> > >
> > > Why I gave cmake a go is quite simple:
> > > In order to create rpm's automatically on a build system, you need to
> > > have
> > > an non-interactive build process. The interactive makeall script
> > > doesn't
> > > help here as it requires user interaction. It would require patching
> > > to
> > > disable it, what you need to rework everytime things changed in the
> > > script.
> > >
> > > Would there be a config file or similar together with a
> > > non-interactive
> > > mode, I could use that. As it is now, it's quite hard to work around
> > > it.
> > > I was hoping cmake/scons would help here - as it wasn't my first
> > > attempt
> > > to package radiance.
> > >
> > > Denny
> >
> > _______________________________________________
> > Radiance-dev mailing list
> > [email protected]
> > http://www.radiance-online.org/mailman/listinfo/radiance-dev

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