-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is based on cmake as in OpenCMISS-Dependencies/scotch with fixes described in OpenCMISS-Dependencies/scotch#5 Fixes laristra/flecsi#54 and #1
- Loading branch information
Showing
3 changed files
with
13 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,29 @@ | ||
set(SCOTCH_NAME scotch) | ||
set(SCOTCH_URL ${PROJECT_SOURCE_DIR}/files) | ||
set(SCOTCH_GZ scotch_6.0.4.tar.gz) | ||
set(SCOTCH_MD5 "d58b825eb95e1db77efe8c6ff42d329f") | ||
set(SCOTCH_GZ scotch_6.0.3-cmake.tar.gz) | ||
set(SCOTCH_MD5 "90877bc3a6db6010e3587fe23bdac758") | ||
|
||
|
||
find_program(FLEX flex) | ||
if (NOT FLEX) | ||
message( FATAL_ERROR | ||
"'flex' lexical parser not found. Cannot build scotch." ) | ||
endif() | ||
|
||
if (APPLE) | ||
set(SCOTCH_MAKE Makefile.inc.i686_mac_darwin10) | ||
set(SCOTCH_CFLAGS "-Drestrict=__restrict -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_TIMING_OLD -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DCOMMON_PTHREAD_BARRIER -I${ZLIB_INCLUDE_DIR}") | ||
set(SCOTCH_LDFLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib ${ZLIB_LIBRARIES} -lm -lpthread") | ||
else () | ||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") | ||
set(SCOTCH_MAKE Makefile.inc.x86-64_pc_linux2) | ||
set(SCOTCH_CFLAGS "-DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -DIDXSIZE64 -I${ZLIB_INCLUDE_DIR}") | ||
else () | ||
set(SCOTCH_MAKE Makefile.inc.i686_pc_linux2) | ||
set(SCOTCH_CFLAGS "-DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -I${ZLIB_INCLUDE_DIR}") | ||
endif () | ||
set(SCOTCH_LDFLAGS "-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib ${ZLIB_LIBRARIES} -lm -lrt -lpthread") | ||
endif () | ||
|
||
ExternalProject_Add( ${SCOTCH_NAME} | ||
DEPENDS ${ZLIB_PACKAGE_NAME} | ||
|
||
URL ${SCOTCH_URL}/${SCOTCH_GZ} | ||
URL_MD5 ${SCOTCH_MD5} | ||
UPDATE_COMMAND "" | ||
|
||
BUILD_IN_SOURCE 1 | ||
|
||
CONFIGURE_COMMAND rm -f src/Makefile.inc | ||
|
||
COMMAND ln -s Make.inc/${SCOTCH_MAKE} | ||
src/Makefile.inc | ||
|
||
BUILD_COMMAND | ||
$(MAKE) -C src | ||
"CCS=${CMAKE_C_COMPILER}" | ||
"CCD=${CMAKE_C_COMPILER}" | ||
"CFLAGS=${CMAKE_C_FLAGS} ${SCOTCH_CFLAGS}" | ||
"LDFLAGS=${SCOTCH_LDFLAGS}" | ||
"CLIBFLAGS=-fPIC" | ||
scotch | ||
INSTALL_COMMAND | ||
$(MAKE) -C src | ||
"MKDIR=mkdir -p" | ||
prefix=${CMAKE_INSTALL_PREFIX} | ||
install | ||
CMAKE_ARGS | ||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | ||
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} | ||
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} | ||
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} | ||
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} | ||
-DUSE_BZ2:BOOL=OFF | ||
-DBUILD_PTSCOTCH:BOOL=OFF | ||
-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR} | ||
-DZLIB_LIBRARIES:FILEPATH=${ZLIB_LIBRARIES} | ||
) |
Binary file not shown.
Binary file not shown.