Skip to content
Snippets Groups Projects
Commit a160402d authored by Maxime Graulich's avatar Maxime Graulich
Browse files

iOS: add BLAS/LAPACK makefile and PETSc configure script

parent fa52693e
No related branches found
No related tags found
No related merge requests found
########################################################################################
# f2cblaslapack: BLAS/LAPACK in C
########################################################################################
ALL: blas_lib lapack_lib
########################################################################################
# Specify options to compile and create libraries
########################################################################################
ARCH = "armv7"
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
COPTFLAGS = -O -arch $(ARCH) -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -miphoneos-version-min=7.0
CNOOPT = -O0 -arch $(ARCH) -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -miphoneos-version-min=7.0
RM = /bin/rm
AR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
AR_FLAGS = cr
LIB_SUFFIX = a
RANLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
########################################################################################
# compile the source files and create the blas and lapack libs
########################################################################################
BLAS_LIB_NAME = libf2cblas.$(LIB_SUFFIX)
LAPACK_LIB_NAME = libf2clapack.$(LIB_SUFFIX)
MAKE_OPTIONS = CC="$(CC)" COPTFLAGS="$(COPTFLAGS)" CNOOPT="$(CNOOPT)" AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" RM="$(RM)"
MAKE_OPTIONS_BLAS = $(MAKE_OPTIONS) LIBNAME="$(BLAS_LIB_NAME)"
MAKE_OPTIONS_LAPACK = $(MAKE_OPTIONS) LIBNAME="$(LAPACK_LIB_NAME)"
blas_lib:
-@cd blas; $(MAKE) lib $(MAKE_OPTIONS_BLAS)
-@$(RANLIB) $(BLAS_LIB_NAME)
-@mv $(BLAS_LIB_NAME) $(ARCH)-unknown-darwin/
lapack_lib:
-@cd lapack; $(MAKE) lib $(MAKE_OPTIONS_LAPACK)
-@$(RANLIB) $(LAPACK_LIB_NAME)
-@mv $(LAPACK_LIB_NAME) $(ARCH)-unknown-darwin/
clean: cleanblaslapck cleanlib
cleanblaslapck:
$(RM) */*.o
cleanlib:
$(RM) ./*.a ./*.lib
#!/opt/local/bin/python
if __name__ == '__main__':
import sys
import os
sys.path.insert(0, os.path.abspath('config'))
import configure
configure_options = [
'--CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang',
'--CFLAGS=-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -miphoneos-version-min=7.0',
'--CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++',
'--CXXFLAGS=-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -miphoneos-version-min=7.0',
'--known-bits-per-byte=8',
'--known-endian=little',
'--known-level1-dcache-assoc=1',
'--known-level1-dcache-linesize=16',
'--known-level1-dcache-size=4000',
'--known-memcmp-ok=1',
'--known-sizeof-char=1',
'--known-sizeof-double=8',
'--known-sizeof-float=4',
'--known-sizeof-int=4',
'--known-sizeof-long-long=8',
'--known-sizeof-long=8',
'--known-sizeof-short=2',
'--known-sizeof-size_t=8',
'--known-sizeof-void-p=8',
'--with-batch=1',
'--with-blas-lib=/path/to/libf2cblas.a',
'--with-clanguage=cxx',
'--with-cmake=1',
'--with-debugging=0',
'--with-fc=0',
'--with-lapack-lib=/path/to/libf2clapack.a',
'--with-mpi=0',
'--with-parmetis=0',
'--with-scalapack=0',
'--with-shared-libraries=0',
'--with-x=0',
'PETSC_ARCH=arm64-unknown-darwin',
]
configure.petsc_configure(configure_options)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment