Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTSCOTCH: Large refactor #16

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2

jobs:
build:
working_directory: ~/test
machine: true
steps:
- checkout
- run:
name: Fast finish outdated PRs and merge PRs
command: |
./ci_support/fast_finish_ci_pr_build.sh
./ci_support/checkout_merge_commit.sh
- run:
command: docker pull condaforge/linux-anvil
- run:
# Run, test and (if we have a BINSTAR_TOKEN) upload the distributions.
command: ./ci_support/run_docker_build.sh

workflows:
version: 2
build_and_test:
jobs:
- build
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
* text=auto

*.patch binary
*.diff binary
meta.yaml text eol=lf
build.sh text eol=lf
bld.bat text eol=crlf
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ To manage the continuous integration and simplify feedstock maintenance
Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``.

For more information please check the [conda-forge documentation](https://conda-forge.org/docs/).

Terminology
===========
Expand Down Expand Up @@ -104,4 +105,4 @@ In order to produce a uniquely identifiable distribution:
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string).
* If the version of a package **is** being increased, please remember to return
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string)
back to 0.
back to 0.
20 changes: 17 additions & 3 deletions ci_support/run_docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,30 @@ show_channel_urls: true
CONDARC
)

# In order for the conda-build process in the container to write to the mounted
# volumes, we need to run with the same id as the host machine, which is
# normally the owner of the mounted volumes, or at least has write permission
HOST_USER_ID=$(id -u)
# Check if docker-machine is being used (normally on OSX) and get the uid from
# the VM
if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then
HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u)
fi

rm -f "$FEEDSTOCK_ROOT/build_artefacts/conda-forge-build-done"

cat << EOF | docker run -i \
-v "${RECIPE_ROOT}":/recipe_root \
-v "${FEEDSTOCK_ROOT}":/feedstock_root \
-e HOST_USER_ID="${HOST_USER_ID}" \
-a stdin -a stdout -a stderr \
condaforge/linux-anvil \
bash || exit 1

set -e
set +x
export BINSTAR_TOKEN=${BINSTAR_TOKEN}
set -x
export PYTHONUNBUFFERED=1

echo "$config" > ~/.condarc
Expand All @@ -43,9 +57,9 @@ conda clean --lock
conda install --yes --quiet conda-forge-build-setup
source run_conda_forge_build_setup

# Embarking on 1 case(s).
conda build /recipe_root --quiet || exit 1
upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1
conda build /recipe_root --quiet || exit 1
upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1

touch /feedstock_root/build_artefacts/conda-forge-build-done
EOF

Expand Down
19 changes: 0 additions & 19 deletions circle.yml

This file was deleted.

65 changes: 65 additions & 0 deletions recipe/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# -*- mode: makefile-gmake -*-

EXE =
LIB = .a
OBJ = .o

AR = ar
ARFLAGS = -ruv
CAT = cat
CCS = ${CC}
CCP = ${CCS}
CCD = ${CCP}
CFLAGS := ${CFLAGS}
CLIBFLAGS = -fPIC
LDFLAGS := $(filter-out -lc++,${LDFLAGS})
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = ranlib
YACC = bison -pscotchyy -y -b y

ifeq (${PKG_NAME},ptscotch)
CCP = mpicc
endif

ifeq (${MAKELEVEL},0)

pthread ?= 1
UNAME_S ?= $(shell uname -s)

CFLAGS += -O3
CFLAGS += -I${PREFIX}/include
CFLAGS += -DIDXSIZE64
CFLAGS += -DSCOTCH_RENAME
CFLAGS += -Drestrict=__restrict
CFLAGS += -DCOMMON_FILE_COMPRESS_GZ
CFLAGS += -DCOMMON_RANDOM_FIXED_SEED
LDFLAGS += -L${PREFIX}/lib -lz -lm

ifeq (${pthread},1)
CFLAGS += -pthread
CFLAGS += -DCOMMON_PTHREAD
ifeq (${PKG_NAME},scotch)
CFLAGS += -DSCOTCH_PTHREAD
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -DCOMMON_PTHREAD_BARRIER
endif
LDFLAGS += -pthread
endif

ifeq ($(UNAME_S),Darwin)
CFLAGS += -DCOMMON_TIMING_OLD
endif

ifeq ($(UNAME_S),Linux)
LDFLAGS += -lrt
endif

export CFLAGS
export LDFLAGS

endif #(${MAKELEVEL},0)
21 changes: 0 additions & 21 deletions recipe/Makefile.inc.i686_mac_darwin10

This file was deleted.

21 changes: 0 additions & 21 deletions recipe/Makefile.inc.x86-64_pc_linux2

This file was deleted.

55 changes: 44 additions & 11 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,55 @@
#!/bin/sh

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

if [ `uname` == "Darwin" ]; then
cp $RECIPE_DIR/Makefile.inc.i686_mac_darwin10 Makefile.inc
else
cp $RECIPE_DIR/Makefile.inc.x86-64_pc_linux2 Makefile.inc
sed -i 's#-l$(SCOTCHLIB)errexit#-l$(SCOTCHLIB)errexit -lm#g' esmumps/Makefile
fi
if [ "$PKG_NAME" == "scotch" ]
then

make ptesmumps | tee make.log 2>&1
make check
# build
cd src/
make esmumps 2>&1 | tee make.log
make check 2>&1 | tee check.log
cd ..

# install.
# install
mkdir -p $PREFIX/lib/
cp lib/* $PREFIX/lib/
mkdir -p $PREFIX/bin/
cp bin/* $PREFIX/bin/
mkdir -p $PREFIX/include/
cp include/* $PREFIX/include/

fi # scotch


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

export HYDRA_LAUNCHER=fork
export MPIEXEC=mpiexec
if [[ "$(uname)" == "Linux" ]]; then
# skip mpiexec tests on Linux due to conda-forge bug:
# https://github.com/conda-forge/conda-smithy/pull/337
export MPIEXEC="echo SKIPPING $MPIEXEC"
fi
if [[ "$(uname)" == "Darwin" ]]; then
# the following test fails with "write error"
# on Travis-CI during 'make ptcheck'
# $ mpiexec -n 4 ./test_scotch_dgraph_redist data/bump.grf
export MPIEXEC="echo SKIPPING $MPIEXEC"
fi

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

fi # ptscotch
60 changes: 42 additions & 18 deletions recipe/meta.yaml
100755 → 100644
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 = "ptscotch" %}
{% set md5 = "d58b825eb95e1db77efe8c6ff42d329f" %}

package:
Expand All @@ -10,61 +11,84 @@ source:
fn: {{ name }}-{{ version }}.tar.gz
md5: {{ md5 }}
url: https://gforge.inria.fr/frs/download.php/latestfile/298/scotch_{{ version }}.tar.gz
patches:
- patch1.diff
- patch2.diff

build:
skip: true # [win]
number: 2
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:
requires:
- toolchain
commands:
{% if name == 'scotch' %}
- test -f "${PREFIX}/lib/libscotch.a"
- test -f "${PREFIX}/lib/libscotcherr.a"
- test -f "${PREFIX}/lib/libscotcherrexit.a"
- test -f "${PREFIX}/lib/libscotchmetis.a"
- test -f "${PREFIX}/lib/libptesmumps.a"
- test -f "${PREFIX}/lib/libesmumps.a"
- test -f "${PREFIX}/include/scotch.h"
- test -f "${PREFIX}/include/scotchf.h"
- test -f "${PREFIX}/include/metis.h"
- test -f "${PREFIX}/include/esmumps.h"
- mord -V
- gmap -V
- gord -V
- 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"
- test -f "${PREFIX}/lib/libptscotchparmetis.a"
- test -f "${PREFIX}/include/esmumps.h"
- test -f "${PREFIX}/include/metis.h"
- test -f "${PREFIX}/include/scotch.h"
- test -f "${PREFIX}/include/scotchf.h"
- test -f "${PREFIX}/include/parmetis.h"
- test -f "${PREFIX}/lib/libptesmumps.a"
- test -f "${PREFIX}/include/ptscotch.h"
- test -f "${PREFIX}/include/ptscotchf.h"
- mord -V
- gotst -V
- gord -V
- gpart -V
- gmap -V
- test -f "${PREFIX}/include/parmetis.h"
- test -f "${PREFIX}/include/esmumps.h"
- dggath -V
- dgmap -V
- dgord -V
- 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:
- basnijholt
- dalcinl
- minrk