Merge lp:~metacollin/kicad/boosting_boost into lp:kicad/product

Proposed by metacollin
Status: Rejected
Rejected by: Chris Pavlina
Proposed branch: lp:~metacollin/kicad/boosting_boost
Merge into: lp:kicad/product
Diff against target: 250 lines (+125/-85)
1 file modified
CMakeModules/download_boost.cmake (+125/-85)
To merge this branch: bzr merge lp:~metacollin/kicad/boosting_boost
Reviewer Review Type Date Requested Status
Wayne Stambaugh Disapprove
Review via email: mp+248085@code.launchpad.net

Description of the change

It's a known bug that KiCad crashes on newer OS X versions unless -DKICAD_SKIP_BOOST is enabled. Unfortunately, boost 1.57 is still not 'KiCad ready', there is still one tiny but vital patch that must be applied. If virgin boost is used, the push and shove router crashes almost immediately, due to how boost handles pointers to polygon points.

This is a one file merge/patch that will instead download and patch boost 1.57. This change applies only to OS X builds, all other platforms will not be effected.

I am very sorry for the duplicate merge proposal. I will try to be more careful in the future. I left a line of old code I wrote and commented out and, some how, lost the threading argument line for boost. I fixed that and made sure the white spaces were tidy. Sorry.

To post a comment you must log in.
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

After the next stable release, this patch will be lost. I plan on ripping out all of the custom dependency download, patch, and build code from the CMake files after the next stable. If someone needs this to build dependencies on their platform than it will have to be maintained as an external project. The complexity it has added to the project configure and build has been a major source of pain. I recommend creating a kicad-boost project that downloads, patches, and builds boost for the platforms that need it.

review: Disapprove
Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Boost download is gone now, so marking rejected.

Unmerged revisions

5392. By metacollin

Fixed accidental removal of multithreading and cleaned up code white spacing.

5391. By metacollin

Readded non-apple platform code (oops).

5390. By metacollin

Merged.

5389. By metacollin

Builds a patched version of Boost 1.57.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeModules/download_boost.cmake'
--- CMakeModules/download_boost.cmake 2014-11-28 17:34:00 +0000
+++ CMakeModules/download_boost.cmake 2015-01-30 07:49:21 +0000
@@ -32,6 +32,11 @@
32set( BOOST_RELEASE 1.54.0 )32set( BOOST_RELEASE 1.54.0 )
33set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change33set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
3434
35if( APPLE )
36 set( BOOST_RELEASE 1.57.0 )
37 set( BOOST_MD5 1be49befbdd9a5ce9def2983ba3e7b76 )
38endif()
39
35# The boost headers [and static libs if built] go here, at the top of KiCad40# The boost headers [and static libs if built] go here, at the top of KiCad
36# source tree in boost_root.41# source tree in boost_root.
37set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )42set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
@@ -144,33 +149,18 @@
144 set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )149 set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
145 set( BOOST_TOOLSET "toolset=darwin" )150 set( BOOST_TOOLSET "toolset=darwin" )
146151
147 if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
148 set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
149 set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
150 endif()
151
152 if( CMAKE_OSX_ARCHITECTURES )152 if( CMAKE_OSX_ARCHITECTURES )
153153
154 if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND154 if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" AND CMAKE_OSX_ARCHITECTURES MATCHES "64") )
155 (CMAKE_OSX_ARCHITECTURES MATCHES "64"))
156 message( "-- BOOST found 32/64 Address Model" )155 message( "-- BOOST found 32/64 Address Model" )
157156
158 set( BOOST_ADDRESSMODEL "address-model=32_64" )157 set( BOOST_ADDRESSMODEL "address-model=32_64" )
159 endif()158 endif()
160159
161 if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND160 if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
162 (CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
163 message("-- BOOST found ppc/x86 Architecture")
164
165 set(BOOST_ARCHITECTURE "architecture=combined")
166 elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
167 message("-- BOOST found x86 Architecture")161 message("-- BOOST found x86 Architecture")
168162
169 set(BOOST_ARCHITECTURE "architecture=x86")163 set(BOOST_ARCHITECTURE "architecture=x86")
170 elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
171 message("-- BOOST found ppc Architecture")
172
173 set(BOOST_ARCHITECTURE "architecture=ppc")
174 endif()164 endif()
175165
176 set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )166 set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
@@ -179,71 +169,41 @@
179 endif()169 endif()
180endif()170endif()
181171
182ExternalProject_Add( boost172if( APPLE )
183 PREFIX "${PREFIX}"173 ExternalProject_Add( boost
184174 PREFIX "${PREFIX}"
185 URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2175
186 DOWNLOAD_DIR "${DOWNLOAD_DIR}"176 URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
187 TIMEOUT 1200 # 20 minutes177 DOWNLOAD_DIR "${DOWNLOAD_DIR}"
188 URL_MD5 ${BOOST_MD5}178 TIMEOUT 1200 # 20 minutes
189 # If download fails, then enable "LOG_DOWNLOAD ON" and try again.179 URL_MD5 ${BOOST_MD5}
190 # Upon a second failure with logging enabled, then look at these logs:180 # If download fails, then enable "LOG_DOWNLOAD ON" and try again.
191 # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log181 # Upon a second failure with logging enabled, then look at these logs:
192 # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log182 # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
193 # If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it183 # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
194 # into <src>/.downloads-by-cmake/ dir.184 # If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
195 # LOG_DOWNLOAD ON185 # into <src>/.downloads-by-cmake/ dir.
196186 # LOG_DOWNLOAD ON
197 INSTALL_DIR "${BOOST_ROOT}"187
198188 INSTALL_DIR "${BOOST_ROOT}"
199 # The patch command executes with the working directory set to <SOURCE_DIR>189
200 # Revert the branch to pristine before applying patch sets as bzr patch190 # The patch command executes with the working directory set to <SOURCE_DIR>
201 # fails when applying a patch to the branch twice and doesn't have a switch191 # Revert the branch to pristine before applying patch sets as bzr patch
202 # to ignore previously applied patches192 # fails when applying a patch to the branch twice and doesn't have a switch
203 PATCH_COMMAND bzr revert193 # to ignore previously applied patches
204 # bzr revert is insufficient to remove "added" files:194 PATCH_COMMAND bzr revert
205 COMMAND bzr clean-tree -q --force195 COMMAND bzr clean-tree -q --force
206196
207 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"197 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
208 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"198
209199 UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
210 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266200
211 # tell bzr about "added" files by last patch:201 BINARY_DIR "${PREFIX}/src/boost/"
212 COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S202 CONFIGURE_COMMAND ${bootstrap} ${b2_libs}
213 COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S203
214204 BUILD_COMMAND ./b2
215 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
216 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
217
218 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
219 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
220
221 # tell bzr about "added" files by last patch:
222 COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
223 COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
224 COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
225 COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
226
227 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
228 COMMAND bzr add libs/context/build/Jamfile.v2
229 COMMAND bzr add libs/context/build/architecture.jam
230 COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
231 COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
232 COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
233 COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
234 COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
235 COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
236
237 # [Mis-]use this step to erase all the boost headers and libraries before
238 # replacing them below.
239 UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
240
241 BINARY_DIR "${PREFIX}/src/boost/"
242 CONFIGURE_COMMAND ${bootstrap}
243
244 BUILD_COMMAND ./b2
245 variant=release205 variant=release
246 threading=multi206 threading=multi
247 ${BOOST_CFLAGS}207 ${BOOST_CFLAGS}
248 ${BOOST_TOOLSET}208 ${BOOST_TOOLSET}
249 ${BOOST_CXXFLAGS}209 ${BOOST_CXXFLAGS}
@@ -255,8 +215,88 @@
255 --prefix=<INSTALL_DIR>215 --prefix=<INSTALL_DIR>
256 install216 install
257217
258 INSTALL_COMMAND ""218 INSTALL_COMMAND ""
259 )219 )
220else()
221 ExternalProject_Add( boost
222 PREFIX "${PREFIX}"
223
224 URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
225 DOWNLOAD_DIR "${DOWNLOAD_DIR}"
226 TIMEOUT 1200 # 20 minutes
227 URL_MD5 ${BOOST_MD5}
228 # If download fails, then enable "LOG_DOWNLOAD ON" and try again.
229 # Upon a second failure with logging enabled, then look at these logs:
230 # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
231 # <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
232 # If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
233 # into <src>/.downloads-by-cmake/ dir.
234 # LOG_DOWNLOAD ON
235
236 INSTALL_DIR "${BOOST_ROOT}"
237
238 # The patch command executes with the working directory set to <SOURCE_DIR>
239 # Revert the branch to pristine before applying patch sets as bzr patch
240 # fails when applying a patch to the branch twice and doesn't have a switch
241 # to ignore previously applied patches
242 PATCH_COMMAND bzr revert
243 # bzr revert is insufficient to remove "added" files:
244 COMMAND bzr clean-tree -q --force
245
246 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
247 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
248
249 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
250 # tell bzr about "added" files by last patch:
251 COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
252 COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
253
254 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
255 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
256
257 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
258 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
259
260 # tell bzr about "added" files by last patch:
261 COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
262 COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
263 COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
264 COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
265
266 COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
267 COMMAND bzr add libs/context/build/Jamfile.v2
268 COMMAND bzr add libs/context/build/architecture.jam
269 COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
270 COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
271 COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
272 COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
273 COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
274 COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
275
276 # [Mis-]use this step to erase all the boost headers and libraries before
277 # replacing them below.
278 UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
279
280 BINARY_DIR "${PREFIX}/src/boost/"
281 CONFIGURE_COMMAND ${bootstrap}
282
283 BUILD_COMMAND ./b2
284 variant=release
285 threading=multi
286 ${BOOST_CFLAGS}
287 ${BOOST_TOOLSET}
288 ${BOOST_CXXFLAGS}
289 ${BOOST_LINKFLAGS}
290 ${BOOST_ADDRESSMODEL}
291 ${BOOST_ARCHITECTURE}
292 ${b2_libs}
293 ${BOOST_LINKTYPE}
294 --prefix=<INSTALL_DIR>
295 install
296
297 INSTALL_COMMAND ""
298 )
299endif()
260300
261if( MINGW )301if( MINGW )
262 execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion302 execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion