Skip to content
Browse files

COMP: Fix NUMPY config so it works with clang

Problem is bogus inclusion of '-faltivec' on OS X Intel
problem was bad platform test.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21445 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
1 parent c79a796 commit 08d21e39ed9311e1e6be58470c8847489083e7b1 hjohnson committed Nov 19, 2012
Showing with 18 additions and 0 deletions.
  1. +3 −0 SuperBuild/External_NUMPY.cmake
  2. +15 −0 SuperBuild/NUMPY_patch.cmake
View
3 SuperBuild/External_NUMPY.cmake
@@ -53,6 +53,9 @@ ExternalProject_Add(${proj}
-P ${CMAKE_CURRENT_BINARY_DIR}/${proj}_make_step.cmake
INSTALL_COMMAND ${CMAKE_COMMAND}
-P ${CMAKE_CURRENT_BINARY_DIR}/${proj}_install_step.cmake
+ PATCH_COMMAND ${CMAKE_COMMAND}
+ -DNUMPY_SRC_DIR=${Slicer_BINARY_DIR}/NUMPY
+ -P ${CMAKE_CURRENT_LIST_DIR}/${proj}_patch.cmake
DEPENDS
${NUMPY_DEPENDENCIES}
)
View
15 SuperBuild/NUMPY_patch.cmake
@@ -0,0 +1,15 @@
+message("Fixing source in ${NUMPY_SRC_DIR}")
+set(sysinfo ${NUMPY_SRC_DIR}/numpy/distutils/system_info.py)
+
+file(READ ${sysinfo} sysinfo_src)
+# string(REPLACE "if get_platform()[-4:] == 'i386':"
+# "if 'intel' in get_platform():" sysinfo_src "${sysinfo_src}")
+string(REPLACE " if intel:
+ args.extend(['-msse3'])
+ else:
+ args.extend(['-faltivec'])
+" ""
+sysinfo_src "${sysinfo_src}")
+
+file(WRITE ${sysinfo} "${sysinfo_src}")
+

0 comments on commit 08d21e3

Please sign in to comment.
Something went wrong with that request. Please try again.