Request to Merge: LuxRays cmake cleanup

Discussion and help for Compilation problems and platform portability.

Moderator: coordinators

Request to Merge: LuxRays cmake cleanup

Postby foobarbarian » Sun Apr 03, 2011 3:31 pm

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
(96.96 KiB) Downloaded 81 times
foobarbarian
Developer
 
Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

Re: Request to Merge: LuxRays cmake cleanup

Postby Lord Crc » Wed Apr 06, 2011 3:10 pm

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.
User avatar
Lord Crc
Developer
 
Posts: 4883
Joined: Sat Nov 17, 2007 2:10 pm

Re: Request to Merge: LuxRays cmake cleanup

Postby Dade » Mon Apr 11, 2011 11:04 am

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.
User avatar
Dade
Developer
 
Posts: 5636
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Request to Merge: LuxRays cmake cleanup

Postby foobarbarian » Sat Apr 23, 2011 3:42 am

Hi dade,

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

I've added the version check for 1.43.0 OR newer.


cheers
amir
Attachments
luxrays_800.patch
(1.31 KiB) Downloaded 57 times
foobarbarian
Developer
 
Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

Re: Request to Merge: LuxRays cmake cleanup

Postby Dade » Sat Apr 23, 2011 4:43 am

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

I've added the version check for 1.43.0 OR newer.


Thanks Amir.

Jens, could you check if the new Cmake files work with MacOS ?
User avatar
Dade
Developer
 
Posts: 5636
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Request to Merge: LuxRays cmake cleanup

Postby foobarbarian » Sat Apr 23, 2011 4:44 am

Thanks to Lord Crc for merging the patch together with tip into the cmake_restructure branch.
foobarbarian
Developer
 
Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

Re: Request to Merge: LuxRays cmake cleanup

Postby jensverwiebe » Sat Apr 23, 2011 9:00 am

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

I've added the version check for 1.43.0 OR newer.


Thanks Amir.

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

Code: Select all
CMAKE VERSION DETECTED 2.8.4

Result:

################ GENERATED XCODE PROJECT INFORMATION ################

OSX_DEPLOYMENT_TARGET : 10.6
CMAKE_XCODE_ATTRIBUTE_ARCHS ( cmake 2.8 or higher method ): i386 x86_64
OSX SDK SETTING : /Developer/SDKs/MacOSX10.6.sdk
BUILD_CONFIGURATION_TYPE : Release

#####################################################################
Building mode: Release
Looking for FreeImage...
FreeImage_INCLUDE_DIR NAMES FreeImage_INCLUDE_DIR-NOTFOUND
FreeImage_LIBRARY_DBG NAMES FreeImagefreeimageFreeImageLibfreeimageLib
Could not locate FreeImage
Could NOT find Boost
Could NOT find Boost
Could 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 QT4
CMake 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/luxmark
FreeImage_LIBRARY_DBG (ADVANCED)
    linked by target "LuxRays" in directory /Volumes/Daten1TB/LuxRender_devel/luxrays_cmake_restructure/src
FreeImage_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/src
GLEW_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/luxmark

Configuring 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
User avatar
jensverwiebe
Developer
 
Posts: 2285
Joined: Wed Apr 02, 2008 4:34 pm

Re: Request to Merge: LuxRays cmake cleanup

Postby foobarbarian » Sat Apr 23, 2011 9:26 am

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
Developer
 
Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

Re: Request to Merge: LuxRays cmake cleanup

Postby foobarbarian » Sat Apr 23, 2011 9:28 am

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
Developer
 
Posts: 36
Joined: Sat Mar 19, 2011 10:21 am

Re: Request to Merge: LuxRays cmake cleanup

Postby jensverwiebe » Sat Apr 23, 2011 1:22 pm

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
User avatar
jensverwiebe
Developer
 
Posts: 2285
Joined: Wed Apr 02, 2008 4:34 pm

Next

Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 1 guest