Skip to content

Commit

Permalink
Refactor recipe and build scripts
Browse files Browse the repository at this point in the history
* `meta.yaml` can build scotch or ptscotch by just setting `name`.
* `build.sh` installs either scotch or ptscotch headers and libraries.
* ptscotch now (runtime) depends on scotch.
  • Loading branch information
dalcinl committed Oct 9, 2017
1 parent 5752f22 commit 449c4c9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
4 changes: 3 additions & 1 deletion recipe/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ LDFLAGS += -L${PREFIX}/lib -lz -lm
ifeq (${pthread},1)
CFLAGS += -pthread
CFLAGS += -DCOMMON_PTHREAD
#CFLAGS += -DSCOTCH_PTHREAD
ifeq (${PKG_NAME},scotch)
CFLAGS += -DSCOTCH_PTHREAD
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -DCOMMON_PTHREAD_BARRIER
endif
Expand Down
18 changes: 12 additions & 6 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

cp $RECIPE_DIR/Makefile.inc src/Makefile.inc

if [ "$PKG_NAME" == "scotch" ]
then

# build
cd src/
make esmumps 2>&1 | tee -a make.log
make check
make esmumps 2>&1 | tee make.log
make check 2>&1 | tee check.log
cd ..
# install
mkdir -p $PREFIX/lib/
Expand All @@ -15,6 +18,9 @@ cp bin/* $PREFIX/bin/
mkdir -p $PREFIX/include/
cp include/* $PREFIX/include/

fi # scotch


if [ "$PKG_NAME" == "ptscotch" ]
then

Expand All @@ -34,10 +40,10 @@ fi

# build
cd src/
make ptesmumps 2>&1 | tee -a make.log
make ptcheck EXECP="$MPIEXEC -n 4"
make ptesmumps 2>&1 | tee make.log
make ptcheck EXECP="$MPIEXEC -n 4" 2>&1 | tee check.log
cd ..
# install.
# install
mkdir -p $PREFIX/lib/
cp lib/libpt* $PREFIX/lib/
mkdir -p $PREFIX/bin/
Expand All @@ -46,4 +52,4 @@ mkdir -p $PREFIX/include/
cp include/ptscotch*.h $PREFIX/include/
cp include/parmetis.h $PREFIX/include/

fi
fi # ptscotch
23 changes: 18 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% set name = "ptscotch" %}
{% set build = 3 %}
{% set version = "6.0.4" %}
{% set name = "scotch" %}
{% set md5 = "d58b825eb95e1db77efe8c6ff42d329f" %}

package:
Expand All @@ -16,21 +17,27 @@ source:

build:
skip: true # [win]
number: 3
number: {{ build }}

requirements:
build:
- toolchain
- zlib 1.2.*
- bison
- flex 2.6.0
- zlib 1.2.*
{% if name == 'ptscotch' %}
- mpich 3.2.*
{% endif %}
run:
- zlib 1.2.*
{% if name == 'ptscotch' %}
- scotch
- mpich 3.2.*
{% endif %}

test:
commands:
{% if name == 'scotch' %}
- test -f "${PREFIX}/lib/libscotch.a"
- test -f "${PREFIX}/lib/libscotcherr.a"
- test -f "${PREFIX}/lib/libscotcherrexit.a"
Expand All @@ -46,6 +53,7 @@ test:
- gotst -V
- gpart -V
- gscat -V
{% else %}
- test -f "${PREFIX}/lib/libptscotch.a"
- test -f "${PREFIX}/lib/libptscotcherr.a"
- test -f "${PREFIX}/lib/libptscotcherrexit.a"
Expand All @@ -61,18 +69,23 @@ test:
- dgpart -V
- dgscat -V
- dgtst -V
{% endif %}

about:
home: https://www.labri.fr/perso/pelegrin/scotch/
license: CeCILL-C
license_file: LICENSE_en.txt
license_file: doc/CeCILL-C_V1-en.txt
{% if name == 'scotch' %}
summary: 'SCOTCH: Static Mapping, Graph, Mesh and Hypergraph Partitioning, and Parallel and Sequential Sparse Matrix Ordering Package'
{% else %}
summary: 'PT-SCOTCH: (Parallel) Static Mapping, Graph, Mesh and Hypergraph Partitioning, and Parallel and Sequential Sparse Matrix Ordering Package'
{% endif %}
description: |
Software package and libraries for sequential and parallel
graph partitioning, static mapping and clustering, sequential
mesh and hypergraph partitioning, and sequential and parallel
sparse matrix block ordering.
doc_url: http://gforge.inria.fr/docman/?group_id=248
doc_url: http://gforge.inria.fr/docman/?group_id=248&dirid=326

extra:
recipe-maintainers:
Expand Down

0 comments on commit 449c4c9

Please sign in to comment.