Compilation with VS2010

Discussion and help for Compilation problems and platform portability.

Moderator: coordinators

Compilation with VS2010

Postby DrPingy » Fri Jan 27, 2012 3:16 am

I want to compile LuxRender with a clean installation of VS2010.
So I download:
- lux-f3a8aa4fd75a.zip
- luxrays-8d8fa9bb556f.zip
- windows-93929c1cde8b.zip
Import the projects in VS2010 and set all paths. A little bit later I found the VS2010 source, but I tested it with the same problems.
Then I compiled without success and must made a lot of changes.
I think the following problems are source problems and so I ask for help.
Q:\Lux-26-01-2012 is the path of Lux source.
1. Changes in files
Q:\Lux-26-01-2012\luxrays\include\luxrays\utils\core\atomic.h
Q:\Lux-26-01-2012\lux\core\osfunc.h
set ::source in ::ipcsource
Perhaps this is a change in boost. I use boost 1.49.

2. Changes in projectsproject luxmark:
..\..\..\luxrays\samples\samples change in ..\..\..\luxrays\samples\smallluxgpu
new Path $(LUX_QT_ROOT)\include\QtNetwork

project luxmark
This project doesn’t fit with the source. I changed the paths of the files .*, path.*, volume.* pathgpu.*, kdtree.*, hybridhashgrid.*, sppm.*, hashgrid.* and slgscene.*
In addition: in file q:\Lux-26-01-2012\luxrays\samples\luxmark\luxmarkapp.h
#include "rendersession.h" set to #include "slg2/rendersession.h"
in file q:\Lux-26-01-2012\luxrays\samples\luxmark\luxmarkapp.cpp
#include "pathocl/pathocl.h" set to #include "slg2/pathocl/pathocl.h"

project liblux:
error: 1> luxlex.cpp
1>Q:\Lux-26-01-2012\lux\core\luxlex.l(37): fatal error C1083: Cannot open include file: 'luxparse.hpp': No such file or directory
The file luxparse.hpp isn’t in the source!

3. After these changes I’ve got some errors in
Project luxmark

1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(33): error C2061: syntax error : identifier 'RenderConfig'
1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(45): error C2143: syntax error : missing ';' before '*'
1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(45): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(45): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(51): error C2146: syntax error : missing ';' before identifier 'editActions'
1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>q:\lux-26-01-2012\luxrays\samples\luxmark\slg2/rendersession.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
DrPingy
 
Posts: 31
Joined: Mon Dec 27, 2010 4:48 am

Re: Compilation with VS2010

Postby Dade » Fri Jan 27, 2012 3:46 am

DrPingy wrote:3. After these changes I’ve got some errors in
Project luxmark


You don't need to compile LuxRays samples (including LuxMark) at all in order to compile LuxRender, you can simply skip them.
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Compilation with VS2010

Postby DrPingy » Fri Jan 27, 2012 4:37 am

Thank you for the fast reply.
This is a fast solution but not real solution.

But what is with luxparse.hpp?
I read in the forum this is generated by yacc. I found yacc and bison in the source code.
How can I generate this file?
DrPingy
 
Posts: 31
Joined: Mon Dec 27, 2010 4:48 am

Re: Compilation with VS2010

Postby dougal2 » Fri Jan 27, 2012 5:17 am

The solution should already be set up to run yacc and bison on the parser source files. This step works fine for me with vse2010. I've spent some time this week too trying to build with vse2010 and the vs100 tool chain. The two biggest problems I'm currently facing are:
- building FreeImage, seems to build ok, but leads to link errors in lux projects
- building python for pylux; aparrently this needs major tweaking to build and I haven't even tried yet.

I have managed to build luxrays and liblux, but I'm not quite there with a runnable exe yet.
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: Compilation with VS2010

Postby DrPingy » Fri Jan 27, 2012 7:08 am

I think VS2010 will run yacc/bison. The file luxlex.cpp is created.
I delete this file and rebuilt project liblux and got the message:

CustomBuild:
1> Lexing luxlex
1>ClCompile:
1> luxlex.cpp
1>Q:\Lux-26-01-2012\lux\core\luxlex.l(37): fatal error C1083: Cannot open include file: 'luxparse.hpp': No such file or directory
1>
DrPingy
 
Posts: 31
Joined: Mon Dec 27, 2010 4:48 am

Re: Compilation with VS2010

Postby DrPingy » Fri Jan 27, 2012 7:16 am

I found a work around.
I started in VS10 console the command (found in the forum)

bison -d -v -t -o"q:\Lux-26-01-2012\lux\core\luxparse.cpp" "q:\Lux-26-01-2012\lux\core\luxparse.y

and all file generated.

But why do it vs10 not?
DrPingy
 
Posts: 31
Joined: Mon Dec 27, 2010 4:48 am

Re: Compilation with VS2010

Postby DrPingy » Wed Feb 08, 2012 7:35 am

Now I have set all paths and now I know that VS2010 don't use any system environment settings.
liblux and librays compile fine.
smallluxgpu is compiled and linked and runs!!
I use NVIDIA SDK 4.1 and must link glew64.lib without GLEW_STATIC .

The problem now is FreeImage.
Link luxrender gives errors:
1>exrio.obj : error LNK2001: unresolved external symbol "public: __cdecl Imf::Slice::Slice(enum Imf::PixelType,char *,unsigned __int64,unsigned __int64,int,int,double,bool,bool)" (??0Slice@Imf@@QEAA@W4PixelType@1@PEAD_K2HHN_N3@Z)
1>exrio.obj : error LNK2001: unresolved external symbol "public: void __cdecl Imf::FrameBuffer::insert(char const * const,struct Imf::Slice const &)" (?insert@FrameBuffer@Imf@@QEAAXQEBDAEBUSlice@2@@Z)
1>exrio.obj : error LNK2001: unresolved external symbol "int __cdecl Imf::globalThreadCount(void)" (?globalThreadCount@Imf@@YAHXZ)
1>exrio.obj : error LNK2001: unresolved external symbol "public: void __cdecl Imf::ChannelList::insert(char const * const,struct Imf::Channel const &)" (?insert@ChannelList@Imf@@QEAAXQEBDAEBUChannel@2@@Z)
.....
1>x64\Release\luxrender.exe : fatal error LNK1120: 16 unresolved externals

Link pylux gives also errors with FreeImage.lib

I tried link static and DLL compilation of Freeimage without effects.

How can I link luxrender?
DrPingy
 
Posts: 31
Joined: Mon Dec 27, 2010 4:48 am

Re: Compilation with VS2010

Postby Dade » Wed Feb 08, 2012 8:06 am

You seem to have a problem with OpenEXR: viewtopic.php?f=22&t=5069#p52760
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Compilation with VS2010

Postby DrPingy » Mon Feb 13, 2012 6:36 am

The problem was FreeImage.
Default ist /MT and it must be /MD in all projects.
In Lux the libary path must set to /FreeImage/Source/FreeImageLib/Release (not FreeImage/Dist).
Now I have compiled all lux projects (without Luxmark) successfull . Luxrender running fine.

Luxmark source is inconsistent. Some includes are with wrong paths.
DrPingy
 
Posts: 31
Joined: Mon Dec 27, 2010 4:48 am


Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 0 guests