Skip to content

Commit

Permalink
scalapack use archive instead of git
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Aug 26, 2024
1 parent ad62417 commit 8c2115e
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 14 deletions.
22 changes: 21 additions & 1 deletion Readme_ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,35 @@ cmake -Dparmetis=yes

The path to METIS and Scotch can be specified via variables METIS_ROOT and Scotch_ROOT, respectively.

## Build METIS

Optionally, METIS can be built from source via CMake before MUMPS.
NOTE: the "-Dintsize64" must be the same for METIS and MUMPS -- default is "off" for METIS and MUMPS.

```sh
cmake -Dprefix=~/mumps -P scripts/build_metis.cmake
```

Build MUMPS

```sh
cmake -Bbuild -DMETIS_ROOT=~/mumps -Dmetis=on

cmake --build build
```

## Build Scotch

Optionally, Scotch can be built from source via CMake before MUMPS.
NOTE: the "-Dintsize64" must be the same for Scotch and MUMPS -- default is "off" for Scotch and MUMPS.

```sh
cmake -Dprefix=~/mumps -P scripts/build_scotch.cmake
```

Build MUMPS

# build MUMPS itself.
```sh
cmake -Bbuild -DMETIS_ROOT=~/mumps -DScotch_ROOT=~/mumps -Dscotch=on

cmake --build build
Expand Down
5 changes: 2 additions & 3 deletions cmake/libraries.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"lapack": {
"git": "https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.12.0.tar.gz"
"url": "https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.12.0.tar.gz"
},
"scalapack": {
"git": "https://github.com/scivision/scalapack.git",
"tag": "e5b11f8ac7b5c6e0bab6fabe7e5ac8602ecab425"
"url": "https://github.com/scivision/scalapack/archive/refs/tags/v2.2.1.9.tar.gz"
},
"metis": {
"git": "https://github.com/scivision/METIS.git",
Expand Down
6 changes: 1 addition & 5 deletions cmake/scalapack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ set(scalapack_cmake_args

file(READ ${CMAKE_CURRENT_LIST_DIR}/libraries.json json)

string(JSON scalapack_url GET ${json} scalapack git)
string(JSON scalapack_tag GET ${json} scalapack tag)
string(JSON scalapack_url GET ${json} scalapack url)

set(SCALAPACK_INCLUDE_DIRS ${CMAKE_INSTALL_FULL_INCLUDEDIR})
file(MAKE_DIRECTORY ${SCALAPACK_INCLUDE_DIRS})
Expand All @@ -67,8 +66,6 @@ endif()

ExternalProject_Add(scalapack
GIT_REPOSITORY ${scalapack_url}
GIT_TAG ${scalapack_tag}
GIT_SHALLOW true
CMAKE_ARGS ${scalapack_cmake_args}
TEST_COMMAND ""
BUILD_BYPRODUCTS ${SCALAPACK_LIBRARIES}
Expand All @@ -79,7 +76,6 @@ USES_TERMINAL_PATCH true
USES_TERMINAL_CONFIGURE true
USES_TERMINAL_BUILD true
USES_TERMINAL_INSTALL true
USES_TERMINAL_TEST true
)

add_library(SCALAPACK::SCALAPACK INTERFACE IMPORTED GLOBAL)
Expand Down
3 changes: 2 additions & 1 deletion scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
cmake -Bbuild")
endif()


project(MumpsPrereqs LANGUAGES C Fortran)

include(ExternalProject)

get_filename_component(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE)

file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
message(STATUS "Installing MUMPS prerequisites to ${CMAKE_INSTALL_PREFIX}")

Expand Down
2 changes: 0 additions & 2 deletions scripts/build_metis.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.20)

option(intsize64 "use 64-bit integers in C and Fortran--METIS must be consistent with MUMPS")

# -Dprefix is where to install
Expand Down
13 changes: 13 additions & 0 deletions scripts/build_scalapack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
option(intsize64 "use 64-bit integers in C and Fortran--Scalapack must be consistent with MUMPS")

# -Dprefix is where to install
# -Dbindir is where to build

set(target "scalapack")

set(args -Dintsize64:BOOL=${intsize64})
if(prefix)
list(APPEND args -DCMAKE_INSTALL_PREFIX:PATH=${prefix})
endif()

include(${CMAKE_CURRENT_LIST_DIR}/run_cmake.cmake)
2 changes: 0 additions & 2 deletions scripts/build_scotch.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.20)

option(intsize64 "use 64-bit integers in C and Fortran--Scotch must be consistent with MUMPS")

# -Dprefix is where to install
Expand Down

0 comments on commit 8c2115e

Please sign in to comment.