Merge pull request #855 from citibeth/efischer/160427-OpenblasFix
openblas: Added +fpic variant to package.
This commit is contained in:
		| @@ -14,6 +14,7 @@ class Openblas(Package): | |||||||
|  |  | ||||||
|     variant('shared', default=True, description="Build shared libraries as well as static libs.") |     variant('shared', default=True, description="Build shared libraries as well as static libs.") | ||||||
|     variant('openmp', default=True, description="Enable OpenMP support.") |     variant('openmp', default=True, description="Enable OpenMP support.") | ||||||
|  |     variant('fpic', default=True, description="Build position independent code") | ||||||
|  |  | ||||||
|     # virtual dependency |     # virtual dependency | ||||||
|     provides('blas') |     provides('blas') | ||||||
| @@ -33,6 +34,8 @@ def install(self, spec, prefix): | |||||||
|         if '+shared' in spec: |         if '+shared' in spec: | ||||||
|             make_targets += ['shared'] |             make_targets += ['shared'] | ||||||
|         else: |         else: | ||||||
|  |             if '+fpic' in spec: | ||||||
|  |                 make_defs.extend(['CFLAGS=-fPIC', 'FFLAGS=-fPIC']) | ||||||
|             make_defs += ['NO_SHARED=1'] |             make_defs += ['NO_SHARED=1'] | ||||||
|  |  | ||||||
|         # fix missing _dggsvd_ and _sggsvd_ |         # fix missing _dggsvd_ and _sggsvd_ | ||||||
| @@ -119,7 +122,7 @@ def check_install(self, spec): | |||||||
|             # TODO: Automate these path and library settings |             # TODO: Automate these path and library settings | ||||||
|             cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c") |             cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c") | ||||||
|             cc('-o', "check", "check.o", |             cc('-o', "check", "check.o", | ||||||
|                "-L%s" % join_path(spec.prefix, "lib"), "-llapack", "-lblas") |                "-L%s" % join_path(spec.prefix, "lib"), "-llapack", "-lblas", "-lpthread") | ||||||
|             try: |             try: | ||||||
|                 check = Executable('./check') |                 check = Executable('./check') | ||||||
|                 output = check(return_output=True) |                 output = check(return_output=True) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Todd Gamblin
					Todd Gamblin