Skip to content

Commit

Permalink
[openblas]Enable x86 build and fix usage errors. (#7888)
Browse files Browse the repository at this point in the history
* [openblas]Enable x86 build.

* [openblas]Fix include openblas_config.h path.

* [openblas]

* [openblas]fix typo error.
  • Loading branch information
JackBoosY authored and cbezault committed Aug 30, 2019
1 parent fdbd3b5 commit 49313b8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ports/openblas/CONTROL
Original file line number Diff line number Diff line change
@@ -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.
28 changes: 28 additions & 0 deletions ports/openblas/fix-redefinition-function.patch
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion ports/openblas/openblas_common.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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
5 changes: 1 addition & 4 deletions ports/openblas/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 49313b8

Please sign in to comment.