[Qgis-developer] Fwd: [QGIS Desktop - Bug #8085] (New) A 64 bits build on Windows crash on exit

Joaquim Luis jluis at ualg.pt
Mon Jun 17 09:47:34 PDT 2013


Hi Paulo,

Sure I'm interested to help in what I can but let me explain first how I did
my build and the troubles that I crossed.

1. The most troublesome task is to build all the dependencies. It happens
that I have most of them because they are common to GDAL. I can share them
but because the DLL hell bit me so many times, I now build all my dll with a
non-standard name.  Basically I prefix them either _w32 or _64

2. Instead of using the cmake gui, I have a ConfigUser.cmake that is
included in the main CMakeLists.txt. I include the contents of that script
at the end of this message because on the nabble interface I don't find an
"attach" button.

3. In my case and exactly to be able to build 32 and 64 bits versions of
other programs, I use a portable version of python but that should not be a
major issue ... as long as users don't try to build 64 bits versions and
have a 32 bits python in their path.

4. With all the dependencies and the ConfigUser.cmake things do NOT yet run
out of the box. There are currently two problems that I addressed first in
#7523 and repeated on #8084
The first one deals with fact that SQLITE3_INCLUDE_DIR is ignored (not sure
anymore about the SPATIALITE_INCLUDE_DIR) causing errors of heders not
found. The second one is more annoying as sip is not detected (I insist it's
not my fault, it's what python replies to in the 'questions' asked in
FindSIP.py) and I had to manually fix the makefiles by inserting the correct
paths.

5. As also mentioned in #7523 there will be the error
   NMAKE : fatal error U1077: '..\..\output\bin\crssync.EXE' : return code
'0xc0000139'
this is tricky and is caused by the fact that PyQt ships with old versions
of  QtCore4 and QtGui4.dll that are caught first in the path than those in
the Qt(64) directory. The only way out I found was to temporarily move those
DLLs out of the way (just renamed them).

OK, at this point I was able to build but than came the issue raised in
#8085 It turns out that what was causing the crash was the fact that since I
use a portable version of python and don't have in the path by default
(that's the whole idea of using portable versions) there was no python
visible when I executed the qgis.exe. However, if I do not apply the patch
indicated  by Jurgen (the if ( myPythonUtils) ) and call the qgis.exe from
the shell window used to make the build (and that therefore knows where
python is) than qgis dies immediately after the splash screen shows up. So
there is another problem here that can be circumvented by the conditional
patch but that still exists.

So, let me know what I can do more to help

Joaquim

and now the script (note that I use a naming convention for directories and
dlls that allows me to easily build 32 or 64 bits with the same script)

´#
# $Id:  $
#
# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
basis.
# 'ConfigUser.cmake' is not version controlled.
#

# Set build type can be: empty, Debug, Release, relwithdebinfo or minsizerel
(default is Release)
set(CMAKE_BUILD_TYPE relwithdebinfo)

set (SUPPORT_EXEC_IN_BINARY_DIR ON)

	# The compiler. Either 10 or 11 for VS2010 or VS2012
	set (VC VC10)

	#add_definitions(/D_ALLOW_KEYWORD_MACROS) 

	set (BITAGE 64)
	# Detect if we are building a 32 or 64 bits version
	if (CMAKE_SIZEOF_VOID_P EQUAL 8)
		#set(BITAGE 64)
	endif ()

	# Installation path
	set(CMAKE_INSTALL_PREFIX "C:/programs/QGisGIT/WIN${BITAGE}")

	# set location of EXPAT
	set(EXPAT_INCLUDE_DIR
"C:/programs/compa_libs/expat-2.0.1/compileds/${VC}_${BITAGE}/include")
	set(EXPAT_LIBRARY
"C:/programs/compa_libs/expat-2.0.1/compileds/${VC}_${BITAGE}/lib/libexpat.lib")

	# set location of GDAL
	set(GDAL_INCLUDE_DIR
"C:/programs/GDALtrunk/gdal/compileds/${VC}_${BITAGE}/include")
	set(GDAL_LIBRARY
"C:/programs/GDALtrunk/gdal/compileds/${VC}_${BITAGE}/lib/gdal_i.lib")

	# set location of GEOS
	set(GEOS_INCLUDE_DIR
"C:/programs/compa_libs/geos_SVN/compileds/${VC}_${BITAGE}/include")
	set(GEOS_LIBRARY    
"C:/programs/compa_libs/geos_SVN/compileds/${VC}_${BITAGE}/lib/geos_c.lib")

	# set location of SPATIALINDEX
	set(SPATIALINDEX_INCLUDE_DIR
"C:/programs/compa_libs/libspatialindex-1.8.0/compileds/${VC}_${BITAGE}/include")
	set(SPATIALINDEX_LIBRARY    
"C:/programs/compa_libs/libspatialindex-1.8.0/compileds/${VC}_${BITAGE}/lib/spatialindex.lib")

	# set location of GEOS
	set(GSL_INCLUDE_DIR
"C:/programs/compa_libs/gsl-1.15/compileds/${VC}_${BITAGE}/include")
	set(GSL_LIB        
"C:/programs/compa_libs/gsl-1.15/compileds/${VC}_${BITAGE}/lib/gsl.lib")
	set(GSLCBLAS_LIB   
"C:/programs/compa_libs/gsl-1.15/compileds/${VC}_${BITAGE}/lib/cblas.lib")

	# set location of ICONV
	set(ICONV_INCLUDE_DIR
"C:/programs/compa_libs/libiconv-1.14/compileds/${VC}_${BITAGE}/include")
	set(ICONV_LIBRARY    
"C:/programs/compa_libs/libiconv-1.14/compileds/${VC}_${BITAGE}/lib/libiconv.lib")

	# set location of PROJ
	set(PROJ_INCLUDE_DIR
"C:/programs/compa_libs/proj4/compileds/${VC}_${BITAGE}/include")
	set(PROJ_LIBRARY    
"C:/programs/compa_libs/proj4/compileds/${VC}_${BITAGE}/lib/proj_i.lib")

	# set location of QWT
	set(QWT_INCLUDE_DIR
"C:/programs/compa_libs/qwt/compileds/${VC}_${BITAGE}/include")
	set(QWT_LIBRARY    
"C:/programs/compa_libs/qwt/compileds/${VC}_${BITAGE}/lib/qwt.lib")

	# set location of SPATIALITE
	set(SPATIALITE_INCLUDE_DIR
"C:/programs/compa_libs/libspatialite-4.0.0/compileds/${VC}_${BITAGE}/include")
	set(SPATIALITE_LIBRARY    
"C:/programs/compa_libs/libspatialite-4.0.0/compileds/${VC}_${BITAGE}/lib/spatialite_i.lib")

	# set location of SQLITE3
	set(SQLITE3_INCLUDE_DIR
"C:/programs/compa_libs/sqlite3.7.16/compileds/${VC}_${BITAGE}/include")
	set(SQLITE3_LIBRARY    
"C:/programs/compa_libs/sqlite3.7.16/compileds/${VC}_${BITAGE}/lib/sqlite3.lib")

	# Extra debugging for developers:
	#add_definitions(/D_ALLOW_KEYWORD_MACROS)
	set (CMAKE_C_FLAGS "/D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE
${CMAKE_C_FLAGS}")  # extra no warnings
	set (CMAKE_C_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE
${CMAKE_C_FLAGS}")

set(CMAKE_INCLUDE_CURRENT_DIR TRUE)




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Fwd-QGIS-Desktop-Bug-8085-New-A-64-bits-build-on-Windows-crash-on-exit-tp5060493p5060654.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list