-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create a seperate directory for the python interfaces
- Loading branch information
1 parent
1be9cbe
commit 6ec6acd
Showing
11 changed files
with
127 additions
and
30 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
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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# include the paths for header files | ||
include_directories(${SuperLU_DIST_SOURCE_DIR}/SRC) | ||
include_directories(${SuperLU_DIST_BINARY_DIR}/PYTHON) | ||
|
||
set(sources | ||
pdbridge.h | ||
pdbridge.c | ||
) | ||
|
||
# if(enable_complex16) | ||
# list(APPEND sources pzbridge.h pzbridge.c) | ||
# endif() | ||
|
||
add_library(superlu_dist_python ${sources}) | ||
get_target_property(superlu_dist_version superlu_dist VERSION) | ||
get_target_property(superlu_dist_soversion superlu_dist SOVERSION) | ||
set_target_properties(superlu_dist_python PROPERTIES VERSION ${superlu_dist_version}) | ||
set_target_properties(superlu_dist_python PROPERTIES SOVERSION ${superlu_dist_soversion}) | ||
target_link_libraries(superlu_dist_python superlu_dist) | ||
add_dependencies(superlu_dist_python config_f) | ||
|
||
set(PY_SCRIPT_SOURCE ${CMAKE_SOURCE_DIR}/PYTHON/pddrive.py) | ||
set(PY_SCRIPT_DEST ${CMAKE_BINARY_DIR}/PYTHON/pddrive.py) | ||
# Create a custom command to copy the Python script | ||
add_custom_command( | ||
OUTPUT ${PY_SCRIPT_DEST} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${PY_SCRIPT_SOURCE} ${PY_SCRIPT_DEST} | ||
DEPENDS ${PY_SCRIPT_SOURCE} | ||
COMMENT "Copying pddrive.py to ${CMAKE_BINARY_DIR}/PYTHON" | ||
) | ||
|
||
# Create a custom target named 'python' that depends on the output file | ||
add_custom_target(python | ||
DEPENDS ${PY_SCRIPT_DEST} | ||
) | ||
|
||
add_dependencies(python superlu_dist_python) | ||
|
||
install(TARGETS superlu_dist_python | ||
# DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" | ||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" | ||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" | ||
) | ||
install(FILES pddrive.py DESTINATION "${INSTALL_LIB_DIR}/PYTHON") | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/*! \file | ||
Copyright (c) 2003, The Regents of the University of California, through | ||
Lawrence Berkeley National Laboratory (subject to receipt of any required | ||
approvals from U.S. Dept. of Energy) | ||
All rights reserved. | ||
The source code is distributed under BSD license, see the file License.txt | ||
at the top-level directory. | ||
*/ | ||
|
||
/*! @file | ||
* \brief Distributed SuperLU data types and function prototypes | ||
* | ||
* <pre> | ||
* -- Distributed SuperLU routine (version 9.0) -- | ||
* Lawrence Berkeley National Lab, Univ. of California Berkeley, | ||
* Georgia Institute of Technology | ||
* November 1, 2007 | ||
* April 5, 2015 | ||
* September 18, 2018 version 6.0 | ||
* February 8, 2019 version 6.1.1 | ||
* May 10, 2019 version 7.0.0 | ||
* </pre> | ||
*/ | ||
|
||
|
||
#ifndef __SUPERLU_DIST_PDBRIDGE /* allow multiple inclusions */ | ||
#define __SUPERLU_DIST_PDBRIDGE | ||
#include "superlu_ddefs.h" | ||
|
||
typedef struct { | ||
superlu_dist_options_t options; | ||
SuperLUStat_t stat; | ||
SuperMatrix A; | ||
dScalePermstruct_t ScalePermstruct; | ||
dLUstruct_t LUstruct; | ||
dSOLVEstruct_t SOLVEstruct; | ||
gridinfo_t grid; | ||
} slu_handle; | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/*== APIs for python caller =======*/ | ||
extern void pdbridge_init(int_t m, int_t n, int_t nnz, int_t *rowind, int_t *colptr, double *nzval, void ** pyobj, int argc, char *argv[]); | ||
extern void pdbridge_solve(void ** pyobj, int nrhs, double *b_global); | ||
extern void pdbridge_free(void ** pyobj); | ||
extern void pdbridge_factor(void ** pyobj); | ||
extern void pdbridge_logdet(void ** pyobj, int * sign, double * logdet); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif | ||
|
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
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
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
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
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
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