xTuple.com xTupleU Blog & News Customer Support

Help with compiling Xtuple application

I've made some simple changes to the c++ in the main xtuple application to enable more felxible UOM support in conjunction with some changes made to the functions in the database.   So I have my fingers crossed and am attempting as a total newbie to xTuple development to compile the application(s).

I'm running in to the same problem I see often throught the forums -- no PostgreSQL support.    The step by step directions on setting up a development environment at http://www.xtuple.org/sites/default/files/dev/370/devGuide370/index.html give clear general guidance.   But the following paragraph from the documentation: "When the build is complete, verify that OpenRPT works. Go to your OpenRPT-checkout-dir/bin and run OpenRPT.exe (or openrpt on Linux or openrpt.app on Mac). Select DATABASE - CONNECT TO DATABASE from the program's menu. Click the OPTIONS button and enter your database information. If the PostgreSQL driver does not appear in the list, then it has failed to load probably because of some missing dependencies. See the troubleshooting section below for help resolving these dependency problems. Make sure that you can connect to your database before continuing."  alludes to the issue and I can't find a "troubleshooting" section or something that gives me a comprehensive list of the dependancies.

I've double and tripple checked the environment variables and everythign that the documentation references is there.   My comiple is creating binaries but just as the document suggests might be a problem, I only have the two SQL drivers for ODBC and for sqlLite available.

I have so far been unable to find this "troubleshooting" section and most forum posts that reference the problem give links to a solution and the links are no longer valid.  (Error 404 must somehow be the solution to all problems mankind has ever encountered.  smile)

I believe if I can get the compile working I can demonstrate how some key features could be rolled into the core with only a few lines of code.   (At least they are key for me.)

Just as the documentation suggests might happen, building the OpenRPT application generates functioning binaries that only allow selection of ODBC and sqlLite -- No PostgreSQL in the combo box for database type.

 

Wes

You need to download the PostgreSQL libraries and include them in the compile.

ShaneS. I saw your posts and knew you went down the identical path with the same problem. But the link you posted to a solution was a dead link by the time I got to the posting and read it.

My PostgreSQL is currently a binary install. I downloaded the source but couldn’t get it compiled due to my lack of experience and the documentation’s focus on unix operation. I’ve had a little brush with that world and see the CONFIGURE bash script file there but don’t know how to perform the windows equivalent to get a PostgreSQL install from source completed. I suspected that possibly the install from binaries was missing needed files.

I included the following directories in the lib and include environment variables
c:\pSQL\include
c:\pSQL\include\libpq
c:\pSQL\lib
I added this to the path:
c:\pSQL\bin

The pSQL directory is the place that I put all the files from the PostgreSQL binary install. Again, I haven’t been able to do a PostgreSQL install from Source Code.

Per the instructions, I qmake and then make the OpenRPT application. It generates binaries and puts them in the bin directory. I execute from there and only have two choices of database drivers – no choice for Postgres.

What specifically did you mean by “include them in the compile”?
Are the files in the above directories not the ones that the compile process needs access to?

I think your issue is that you have to build your PostgreSQL libraries first, and then path to the ones you built. I never had any success using someone else’s libraries. I haven’t built it under Windows, but I detailed the Mac version here:

The process under Windows should be nearly identical, but with your PATH commands pointed to the libraries you built.

As I recall, getting through the PostgreSQL build was a real headache. You kind of have to feel your way along, and keep reading the log outputs to figure out where it failed, fix whatever it needs, and then try again. The documentation is cryptic everywhere for doing it. You have to really want it and just keep at it until it finally builds.

Well, I hate to say “why can’t I do it with the binary files from Postgres” so I won’t. It would be nice to have a list of the files that are required and know what had to be available in the path, what had to be available through lib and what had to be available through include.

I started to try to build PostgreSQL from source and see if that would complete the environment enough to get a compile with postgres support. Unfortunately I ran into the issue you mention above about the lack of documentation for building under windows. Things as simple as executing the CONFIGURE script. That’s a BASH looking script and not going to execute on my windows box if I just do something silly like add a “BAT” extension on it.

I don’t understand conceptually what the CONFIGURE step is accomplishing so without some documentation it is going to take some time to figure out how to compile postgres under windows. But if that is really the nut that has to be cracked first, there should be a broad base of information just about setting up an environment and getting postgre to compile. I’ll shift focus there under the assumption that it is required to properly build openrpt. But the documentation from xtuple would suggest otherwise and that at one point there was a “troubleshooting” section that gave the requisite info on getting the postgres support compiled into the xtuple applications.

I was able to get postgre to compile. Worked through all the details there. Set up my environment variables to point to the /lib /libpq and /include directories under the new /bin directory when postgre compiled.

Recompiled openrpt
Same results – still only has support for the odbc and the other qsqlite.

I’ve gone back to the detailed directions. The only thing I have left to try is to build up a linux environment on a machine and start there – I’m not really much of a linux/unix guy so I’m hoping someone could post SPECIFICALLY WHAT FILES the compile has to have access to and SPECIFICALLY WHICH ENVIRONMENT VARIABLE is used for which file to get postgreSQL support.

Can’t get xtuple to compile with database support:

This might help someone – the only error or warning I get when looking at the output from the make process is this:

g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o …\bin\exportrpt.exe tmp/main.o tmp/builtinSqlFunctions.o -L"c:\Qt\4.6.4\lib" -L…/…/lib -lcommon -lQtSql4 -lQtXml4 -lQtGui4 -lQtCore4
c:/mingw/bin/…/lib/gcc/mingw32/4.6.2/…/…/…/…/mingw32/bin/ld.exe: warning: cannot find entry symbol nable-stdcall-fixup; defaulting to 00401000

Getting closer an inch at a time. Thanks to Larry Cartee for pointing out that if you follow the directions exactly, you will get exactly the problem I have – OpenRPT will not show postgresql as an available database option. But if you take that same exact .exe file from the bin directory where the compile puts it and move it over to the same location that a binary xtuple client application puts the file and execute your newly compiled file from there it works fine.

So following the instructions it gets me past the point of “if you don’t see postgre database support after compiling your new openrpt.exe then stop here until you fix it”.

I’m executing my newly compiled openrpt with postgre support.

But now I have a fatal error attempting to compile the main application. Error is as follows:

gunzip.cpp:13:18: fatal error: zlib.h: No such file or directory
compilation terminated.

Anybody care to chime in?