aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-08-31 00:10:30 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-08-30 09:10:30 -0700
commit49313b8bbab7baa12ffa1f2cbd6e95cef2c6c910 (patch)
treee29ef4d098c9926444a99f06fa61af2019ab2e55
parentfdbd3b5ee89c06b47d33e30a3bd31f55e8fb1a39 (diff)
downloadvcpkg-49313b8bbab7baa12ffa1f2cbd6e95cef2c6c910.tar.gz
vcpkg-49313b8bbab7baa12ffa1f2cbd6e95cef2c6c910.zip
[openblas]Enable x86 build and fix usage errors. (#7888)
* [openblas]Enable x86 build. * [openblas]Fix include openblas_config.h path. * [openblas] * [openblas]fix typo error.
-rw-r--r--ports/openblas/CONTROL2
-rw-r--r--ports/openblas/fix-redefinition-function.patch28
-rw-r--r--ports/openblas/openblas_common.h4
-rw-r--r--ports/openblas/portfile.cmake5
4 files changed, 33 insertions, 6 deletions
diff --git a/ports/openblas/CONTROL b/ports/openblas/CONTROL
index 47b9430a9..14efa12f9 100644
--- a/ports/openblas/CONTROL
+++ b/ports/openblas/CONTROL
@@ -1,5 +1,5 @@
Source: openblas
-Version: 0.3.6-5
+Version: 0.3.6-6
Homepage: https://github.com/xianyi/OpenBLAS
Build-Depends: pthread (linux)
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
diff --git a/ports/openblas/fix-redefinition-function.patch b/ports/openblas/fix-redefinition-function.patch
new file mode 100644
index 000000000..176a29ff3
--- /dev/null
+++ b/ports/openblas/fix-redefinition-function.patch
@@ -0,0 +1,28 @@
+diff --git a/openblas_config_template.h b/openblas_config_template.h
+index 52dd49d..239219d 100644
+--- a/openblas_config_template.h
++++ b/openblas_config_template.h
+@@ -64,6 +64,7 @@ typedef int blasint;
+ #ifndef __cplusplus
+ #include <complex.h>
+ #endif
++ #ifndef OPENBLAS_COMPLEX_STRUCT
+ typedef float _Complex openblas_complex_float;
+ typedef double _Complex openblas_complex_double;
+ typedef xdouble _Complex openblas_complex_xdouble;
+@@ -76,7 +77,9 @@ typedef int blasint;
+ #define openblas_complex_double_imag(z) (cimag(z))
+ #define openblas_complex_xdouble_real(z) (creal(z))
+ #define openblas_complex_xdouble_imag(z) (cimag(z))
++ #endif
+ #else
++ #ifndef OPENBLAS_COMPLEX_STRUCT
+ #define OPENBLAS_COMPLEX_STRUCT
+ typedef struct { float real, imag; } openblas_complex_float;
+ typedef struct { double real, imag; } openblas_complex_double;
+@@ -90,4 +93,5 @@ typedef int blasint;
+ #define openblas_complex_double_imag(z) ((z).imag)
+ #define openblas_complex_xdouble_real(z) ((z).real)
+ #define openblas_complex_xdouble_imag(z) ((z).imag)
++ #endif
+ #endif
diff --git a/ports/openblas/openblas_common.h b/ports/openblas/openblas_common.h
index 10b25d4c7..6652a17e9 100644
--- a/ports/openblas/openblas_common.h
+++ b/ports/openblas/openblas_common.h
@@ -1,5 +1,5 @@
#pragma once
-#include "openblas_config.h"
+#include "openblas/openblas_config.h"
#if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX)
#define OPENBLAS_WINDOWS_ABI
@@ -57,6 +57,7 @@ typedef int blasint;
predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs
as a side effect of including either <features.h> or <stdc-predef.h>. */
#include <stdio.h>
+#ifndef OPENBLAS_COMPLEX_STRUCT
#define OPENBLAS_COMPLEX_STRUCT
typedef struct { float real, imag; } openblas_complex_float;
typedef struct { double real, imag; } openblas_complex_double;
@@ -70,3 +71,4 @@ typedef struct { xdouble real, imag; } openblas_complex_xdouble;
#define openblas_complex_double_imag(z) ((z).imag)
#define openblas_complex_xdouble_real(z) ((z).real)
#define openblas_complex_xdouble_imag(z) ((z).imag)
+#endif \ No newline at end of file
diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake
index 179491cc4..907ec751a 100644
--- a/ports/openblas/portfile.cmake
+++ b/ports/openblas/portfile.cmake
@@ -1,9 +1,5 @@
include(vcpkg_common_functions)
-if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
- message(FATAL_ERROR "openblas can only be built for x64 currently")
-endif()
-
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xianyi/OpenBLAS
@@ -13,6 +9,7 @@ vcpkg_from_github(
PATCHES
uwp.patch
fix-space-path.patch
+ fix-redefinition-function.patch
)
find_program(GIT NAMES git git.cmd)