## Request to Merge: LuxRays cmake cleanup

Discussion and help for Compilation problems and platform portability.

### Request to Merge: LuxRays cmake cleanup

Hi guys

This is a complete rewrite and cleanup of the CMAKE build files for LuxRays

The previous version implemented many commands for one platform
only but failed to specify those commands as such.
Sadly there is no awk or cat on windows thats why I've split
up those build commands into win32 and *nix sections.

Win32 uses a small c# program that I've supplied as source and
binary that will take care of copying the kernel .cl files into the cpp files.

Please see the Configuration.cmake file for instructions on supplying
your own / private build variables. This is done by appending
"-DLUXRAY_CUSTOM_CONFIG=YouFileCName" to the cmake call.

I've gone to great lengths ensuring the I've done nothing that
breaks builds on other platforms but as Murphy has it I'm sure
there are a couple of rough edges.

Notably missing at the moment are compiler flags for MSVC 9, but a brave soul
could use the ones from MSVC 10. If the patch gets merged in I'll see to
have that filled in as well.

The .hqignore file will now includes the automatically generated build
directories for MSVC.

Some of the new cmake files are taken / based on the OGRE cmake build files
where they are available as public domain.

cheers
amir aka foobarbarian
Attachments
foobarbarian_luxrays_cmake_cleanup.patch
foobarbarian

Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

### Re: Request to Merge: LuxRays cmake cleanup

Thanks! This layout looks much clearer to me.

I've committed this change to its own branch, there are still a few things that needs to be done (which requires a bit of coordination). Also it's currently only been tested on windows, if someone could test it on linux and osx it would be very nice

Hopefully we can merge this with the main branch.
May contain traces of nuts.

Lord Crc

Posts: 5026
Joined: Sat Nov 17, 2007 2:10 pm

### Re: Request to Merge: LuxRays cmake cleanup

I have tried the new building system under Linux. After a couple of fix, it works fine:

- fixed a problem with case-sensitive filesystems;
- fixed OpenCL lookup code for linux;
- fixed kernel .cpp generation.

The only open issue seems the check of boost version: it accepts the default Boost 1.40 installed with Ubuntu even if it should ask for something newer than 1.43.

Posts: 6836
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: Request to Merge: LuxRays cmake cleanup

thank you for taking the time to test the patch and for fixing those issues.

cheers
amir
Attachments
luxrays_800.patch
foobarbarian

Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

### Re: Request to Merge: LuxRays cmake cleanup

foobarbarian wrote:thank you for taking the time to test the patch and for fixing those issues.

Thanks Amir.

Jens, could you check if the new Cmake files work with MacOS ?

Posts: 6836
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: Request to Merge: LuxRays cmake cleanup

Thanks to Lord Crc for merging the patch together with tip into the cmake_restructure branch.
foobarbarian

Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

### Re: Request to Merge: LuxRays cmake cleanup

foobarbarian wrote:thank you for taking the time to test the patch and for fixing those issues.

Thanks Amir.

Jens, could you check if the new Cmake files work with MacOS ?

Code: Select all
CMAKE VERSION DETECTED 2.8.4Result:################ GENERATED XCODE PROJECT INFORMATION ################OSX_DEPLOYMENT_TARGET : 10.6CMAKE_XCODE_ATTRIBUTE_ARCHS ( cmake 2.8 or higher method ): i386 x86_64OSX SDK SETTING : /Developer/SDKs/MacOSX10.6.sdkBUILD_CONFIGURATION_TYPE : Release#####################################################################Building mode: ReleaseLooking for FreeImage...FreeImage_INCLUDE_DIR NAMES FreeImage_INCLUDE_DIR-NOTFOUNDFreeImage_LIBRARY_DBG NAMES FreeImagefreeimageFreeImageLibfreeimageLibCould not locate FreeImageCould NOT find BoostCould NOT find BoostCould NOT find Boost--> Could not locate required Boost files - Please check --> Could not locate required FreeImage files - Please check --> Could not locate required GLEW files - Please check --> Could not locate required OpenCL files - Please check Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) Building LuxMark too - this will require QT4CMake Error: The following variables are used in this project, but they are set to NOTFOUND.Please set them or make sure they are set and tested correctly in the CMake files:FREEIMAGE_LIBRARY (ADVANCED)    linked by target "LuxMark" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/samples/luxmarkFreeImage_LIBRARY_DBG (ADVANCED)    linked by target "LuxRays" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/srcFreeImage_LIBRARY_REL (ADVANCED)    linked by target "LuxRays" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/src    linked by target "LuxRays" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/srcGLEW_LIBRARY    linked by target "slg" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/samples/smallluxgpu    linked by target "LuxMark" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/samples/luxmarkConfiguring incomplete, errors occurred!

Some remarks:

- LUXRAY_CUSTOM_CONFIG should be: LUXRAYS_CUSTOM_CONFIG , we always use LUXRAYS keyword
- i made some of my changes for a good reason, should be taken over
- i tried to set pathes in an Config_OSX.cmake, but still CL and GLEW will not be found.

Summary: must be fixed

Jens

jensverwiebe

Posts: 2591
Joined: Wed Apr 02, 2008 4:34 pm

### Re: Request to Merge: LuxRays cmake cleanup

Hi Jens,

thanks for trying out the changes and making me aware of the luxrayS naming issue.

As for the Boost and FreeImage errors as discussed on IRC two hours ago - my fault
for not making sure that info is posted here as well.

Boost is not "installed" and as such cmake needs a hint where it is installed. In the files
there is one place to add default paths if - and only if - the path will work on most
of OS installations. We can add default locations for specific OS there
but a default location of a specific build guide should be in an extra configuration file.

The Find_Package for Boost comes with cmake and I've added default search paths there.
The FreeImage one comes from the Ogre3D cmake system where the cmake files are
published as public domain. This one also takes hints as where to find FreeImage.

There is a place to add developer / guide specific build configurations via
-DLUXRAY_CUSTOM_CONFIG.

This is the reason I do not agree that your specific search paths and NO_DEFAULT_PATH
do belong to the default configuration. They are specific to a build guide and are not generic.

We could make NO_DEFAULT_PATH configurable but I do see no reason to force all
Apple users to have their dependencies in a specific library which is not specified
transparently.

Let me know if you want to work together on the remaining issues. Without
a Mac I can't test the check ins ahead of time.

I know you are a busy man and I highly appreciate the time you invest in testing
this.

cheers
amir
foobarbarian

Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

### Re: Request to Merge: LuxRays cmake cleanup

jensverwiebe wrote:- i tried to set pathes in an Config_OSX.cmake, but still CL and GLEW will not be found.

Please post the Config_OSX.cmake and "ls -lh" of the directories it is looking in for those files.
foobarbarian

Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

### Re: Request to Merge: LuxRays cmake cleanup

luxrays_cmake_restructure branch now fixed for OSX.

Foo, you did not documented now including more dependencies in the LuxRays target, this gave me the doubled stuff.
You must take care of upper/lowercase more, luxrays !=LuxRays, guess you made some dll/static differences here ?
Also you used ${LUXRAYS_BIN_DIR} in the samples, but i nowhere found it set ! As relative reference for OSX i used${CMAKE_BINARY_DIR} as substitute for now.

Jens

jensverwiebe

Posts: 2591
Joined: Wed Apr 02, 2008 4:34 pm

Next