Skip to content

Commit 3b8ed6f

Browse files
committed
EIGEN_DENSE_DOUBLE now available when LAPACK functions for dense matrices not available.
Do not search for lapack functions when only blas functions are available. work on clang build create build self contained build without materialdb or sql. math lib still required symdiff library hides symbols in linkable archive Fixup import header add guards for features update symdiff reset_devsim command add superlu back change automated submodule update fix symbol visibility problem work on bundle work on cross compile
1 parent f1755df commit 3b8ed6f

51 files changed

Lines changed: 1527 additions & 53 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
[submodule "external/boostorg/config"]
1717
path = external/boostorg/config
1818
url = https://github.com/boostorg/config
19+
[submodule "external/superlu"]
20+
path = external/superlu
21+
url = https://github.com/xiaoyeli/superlu

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,21 @@ git:
4040

4141
before_script:
4242
- export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
43-
- git submodule update --init --depth 1
4443
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
4544
if [ "$COMPILER" == "gcc" ]; then
4645
brew install gcc@9 cmake;
4746
elif [ "$COMPILER" == "clang" ]; then
4847
brew install cmake;
48+
git submodule update --init --depth 1 external/eigen;
4949
fi
5050
fi
5151
# specifically for pypi deployment
5252
- export README_BASE_URL="https://github.com/devsim/devsim/blob/${TRAVIS_TAG}"
53+
- git submodule update --init --depth 1 external/symdiff
54+
- git submodule update --init --depth 1 external/boostorg/multiprecision
55+
- git submodule update --init --depth 1 external/boostorg/math
56+
- git submodule update --init --depth 1 external/umfpack_lgpl
57+
5358

5459
script:
5560
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then

CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ solve(symbolic_iteration_limit = -1)
1717
```
1818
where setting the value to ``-1`` will create a new symbolic factorization for all nonlinear iterations. Setting the value to a number greater than ``0`` will mark all iterations afterwards for reusing the previous symbolic factorization.
1919

20+
### LAPACK is optional
21+
22+
When LAPACK functions are not available, it is now possible to use Eigen instead. BLAS is still required. It is up to the direct solver being used to determine necessary LAPACK functions.
23+
24+
### Self contained build
25+
26+
### Reset simulator
27+
28+
### SuperLU Preconditioner
29+
30+
This is now used for self contained builds.
31+
2032
### Citing DEVSIM
2133

2234
[CITATION.md](CITATION.md) has been updated with recent articles written about the simulator.

CMakeLists.txt

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@ OPTION(PYTHON3 "Build Python 3 Interpreter" ON)
77
OPTION(DEVSIM_EXTENDED_PRECISION "Build with extended precision" OFF)
88
OPTION(DEVSIM_CPP_BIN_FLOAT "Build with boost quadmath emulation" OFF)
99
OPTION(MKL_PARDISO "Build with MKL Pardiso" ON)
10-
OPTION(EIGEN_DENSE "Use eigen for the dense matrix in extended precision" OFF)
10+
OPTION(EIGEN_DENSE_EXTENDED "Use eigen for the dense matrix in extended precision" OFF)
11+
OPTION(EIGEN_DENSE_DOUBLE "Use eigen for the dense matrix in double precision" OFF)
12+
OPTION(SUPERLU_PRECONDITIONER "Use superlu for the preconditioner" OFF)
13+
OPTION(DEVSIM_LOAD_MATHLIBS "Load BLAS/LAPACK libraries at startup" ON)
14+
OPTION(DEVSIM_MATERIALDB "Use Material DB (requires sqlite)" ON)
1115

1216

1317
set (CMAKE_CXX_STANDARD 17)
1418

15-
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/${DEVSIM_CONFIG}.cmake)
19+
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/${DEVSIM_CONFIG}.cmake OPTIONAL)
1620
INCLUDE(${PROJECT_SOURCE_DIR}/local.cmake OPTIONAL)
1721

1822
#also change this in setup.cfg
1923
ADD_DEFINITIONS(-DDEVSIM_VERSION_STRING=\"2.6.0\")
2024
ADD_DEFINITIONS(-DDEVSIM_COPYRIGHT_YEAR=\"2009-2023\")
2125
26+
IF (DEVSIM_MATERIALDB)
27+
ADD_DEFINITIONS(-DUSE_MATERIALDB)
28+
ENDIF()
29+
2230
IF (MKL_PARDISO)
2331
ADD_DEFINITIONS(-DUSE_MKL_PARDISO)
2432
ENDIF (MKL_PARDISO)
@@ -27,16 +35,34 @@ IF (VTKWRITER)
2735
ADD_DEFINITIONS(-DVTKWRITER)
2836
ENDIF (VTKWRITER)
2937
30-
IF (EIGEN_DENSE)
31-
ADD_DEFINITIONS(-DUSE_EIGEN -DEIGEN_MPL2_ONLY)
38+
IF (EIGEN_DENSE_EXTENDED)
39+
ADD_DEFINITIONS(-DUSE_EIGEN_EXTENDED)
40+
ENDIF()
41+
IF (EIGEN_DENSE_DOUBLE)
42+
ADD_DEFINITIONS(-DUSE_EIGEN_DOUBLE)
43+
ENDIF()
44+
45+
IF (SUPERLU_PRECONDITIONER)
46+
ADD_DEFINITIONS(-DUSE_SUPERLU_PRECONDITIONER)
47+
ENDIF()
48+
49+
IF (EIGEN_DENSE_EXTENDED OR EIGEN_DENSE_DOUBLE)
50+
ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
51+
ENDIF()
52+
53+
IF (DEVSIM_LOAD_MATHLIBS)
54+
ADD_DEFINITIONS(-DLOAD_MATHLIBS -DUSE_BLAS -DUSE_LAPACK -DUSE_ITERATIVE_SOLVER)
55+
ENDIF()
56+
IF ((NOT DEVSIM_LOAD_MATHLIBS) AND MKL_PARDISO)
57+
MESSAGE(FATAL_ERROR "MKL_PARDISO requires DEVSIM_LOAD_MATHLIBS")
3258
ENDIF()
3359
3460
IF (DEVSIM_CPP_BIN_FLOAT)
3561
ADD_DEFINITIONS(-DUSE_CPP_BIN_FLOAT)
3662
ENDIF()
3763
38-
IF (DEVSIM_CPP_BIN_FLOAT AND NOT EIGEN_DENSE)
39-
MESSAGE(FATAL_ERROR "CANNOT HAVE DEVSIM_CPP_BIN_FLOAT without EIGEN_DENSE")
64+
IF (DEVSIM_CPP_BIN_FLOAT AND NOT EIGEN_DENSE_EXTENDED)
65+
MESSAGE(FATAL_ERROR "CANNOT HAVE DEVSIM_CPP_BIN_FLOAT without EIGEN_DENSE_EXTENDED")
4066
ENDIF()
4167
4268

NOTICE

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,33 @@ Boost
5555

5656
Boost Software License - Version 1.0 - August 17th, 2003
5757

58+
COLAMD (Used by SuperLU 5.3)
59+
---------------------------------
60+
61+
Copyright and License:
62+
63+
Copyright (c) 1998-2003 by the University of Florida.
64+
All Rights Reserved.
65+
66+
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
67+
EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
68+
69+
Permission is hereby granted to use, copy, modify, and/or distribute
70+
this program, provided that the Copyright, this License, and the
71+
Availability of the original version is retained on all copies and made
72+
accessible to the end-user of any code or package that includes COLAMD
73+
or any modified version of COLAMD.
74+
75+
Availability:
76+
77+
The colamd/symamd library is available at
78+
79+
https://web.archive.org/web/20141010162709/http://www.cise.ufl.edu/research/sparse/colamd/
80+
81+
This is the https://web.archive.org/web/20040113022019/http://www.cise.ufl.edu/research/sparse/colamd/colamd.c
82+
file. It requires the colamd.h file. It is required by the colamdmex.c
83+
and symamdmex.c files, for the MATLAB interface to colamd and symamd.
84+
5885
Eigen
5986
-----
6087

@@ -123,6 +150,39 @@ Python
123150

124151
Python Software Foundation License (PSFL)
125152

153+
SuperLU
154+
-------
155+
156+
Copyright (c) 2003, The Regents of the University of California, through
157+
Lawrence Berkeley National Laboratory (subject to receipt of any required
158+
approvals from U.S. Dept. of Energy)
159+
160+
All rights reserved.
161+
162+
Redistribution and use in source and binary forms, with or without
163+
modification, are permitted provided that the following conditions are met:
164+
165+
(1) Redistributions of source code must retain the above copyright notice,
166+
this list of conditions and the following disclaimer.
167+
(2) Redistributions in binary form must reproduce the above copyright notice,
168+
this list of conditions and the following disclaimer in the documentation
169+
and/or other materials provided with the distribution.
170+
(3) Neither the name of Lawrence Berkeley National Laboratory, U.S. Dept. of
171+
Energy nor the names of its contributors may be used to endorse or promote
172+
products derived from this software without specific prior written permission.
173+
174+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
175+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
176+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
177+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
178+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
179+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
180+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
181+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
182+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
183+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
184+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
185+
126186
Symdiff
127187
-------
128188

appveyor.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ matrix:
8787
install:
8888
- SET README_BASE_URL=https://github.com/devsim/devsim/blob/%TRAVIS_TAG%
8989
- cd %APPVEYOR_BUILD_FOLDER%
90-
- git submodule update --init --depth 1
90+
- git submodule update --init --depth 1 external/eigen;
91+
- git submodule update --init --depth 1 external/symdiff
92+
- git submodule update --init --depth 1 external/boostorg/config
93+
- git submodule update --init --depth 1 external/boostorg/multiprecision
94+
- git submodule update --init --depth 1 external/boostorg/math
95+
- git submodule update --init --depth 1 external/umfpack_lgpl
9196
- IF "%PLATFORM%"=="msys" SET CONDA_BIN=c:\Miniconda37-x64\condabin\conda.bat
9297
- IF "%PLATFORM%"=="x64" SET CONDA_BIN=c:\Miniconda37-x64\condabin\conda.bat
9398
- IF "%PLATFORM%"=="x86" SET CONDA_BIN=c:\Miniconda37\condabin\conda.bat

cmake/appveyor.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ SET (ZLIB_INCLUDE ${CONDA_PREFIX}/Library/include)
4646
SET (ZLIB_ARCHIVE ${CONDA_PREFIX}/Library/lib/zlib.lib)
4747

4848
SET (SYMDIFF_INCLUDE ${CMAKE_SOURCE_DIR}/external/symdiff/include)
49-
SET (SYMDIFF_ARCHIVE ${CMAKE_SOURCE_DIR}/external/symdiff/${BUILDDIR}/src/engine/Release/symdiff_static.lib)
49+
SET (SYMDIFF_ARCHIVE ${CMAKE_SOURCE_DIR}/external/symdiff/${BUILDDIR}/src/engine/Release/symdiff_dynamic.lib)
5050

cmake/msys.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ SET (ZLIB_INCLUDE ${CONDA_PREFIX}/Library/include)
2929
SET (ZLIB_ARCHIVE ${CONDA_PREFIX}/Library/lib/zlib.lib)
3030

3131
SET (SYMDIFF_INCLUDE ${CMAKE_SOURCE_DIR}/external/symdiff/include)
32-
SET (SYMDIFF_ARCHIVE ${CMAKE_SOURCE_DIR}/external/symdiff/msys_x86_64_release/src/engine/libsymdiff_static.a)
32+
SET (SYMDIFF_ARCHIVE ${CMAKE_SOURCE_DIR}/external/symdiff/msys_x86_64_release/src/engine/libsymdiff_dynamic.a)
3333

3434
SET (QUADMATH_ARCHIVE "-lquadmath")
3535

cmake/osx_10.10.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SET (SQLITE3_ARCHIVE "-lsqlite3")
1616
SET (SQLITE3_INCLUDE "/usr/include")
1717
SET (ZLIB_INCLUDE "/usr/include")
1818
SET (ZLIB_ARCHIVE "-lz")
19-
SET (SYMDIFF_ARCHIVE ${EXTERNAL_LIB}/symdiff/lib/libsymdiff_static.a)
19+
SET (SYMDIFF_ARCHIVE ${EXTERNAL_LIB}/symdiff/lib/libsymdiff_dynamic.a)
2020
SET (SYMDIFF_INCLUDE ${EXTERNAL_LIB}/symdiff/include)
2121
SET (ADD_LINKER_FLAGS " -flat_namespace")
2222

cmake/osx_gcc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ SET (ZLIB_ARCHIVE -lz)
2424

2525

2626
SET (SYMDIFF_INCLUDE ${EXTERNAL_LIB}/symdiff/include)
27-
SET (SYMDIFF_ARCHIVE ${EXTERNAL_LIB}/symdiff/lib/libsymdiff_static.a)
27+
SET (SYMDIFF_ARCHIVE ${EXTERNAL_LIB}/symdiff/lib/libsymdiff_dynamic.a)
2828

2929

0 commit comments

Comments
 (0)