Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
beeda3f
Create meta.yaml
wfspotz Jul 25, 2017
684084e
Create build.sh
wfspotz Jul 25, 2017
d26a04e
Create patch.txt
wfspotz Jul 25, 2017
0f8f57b
Update to build and run against numpy x.x
wfspotz Jul 25, 2017
323c187
Rename patch.txt to shebang.patch
wfspotz Jul 26, 2017
d1ccbb1
Make fixes to meta.yaml
wfspotz Jul 26, 2017
e3db820
ctest --output-on-failure
wfspotz Jul 26, 2017
9f7226f
Update meta.yaml
isuruf Jul 27, 2017
91581e9
More verbose ctest output for debugging
wfspotz Jul 27, 2017
150be8c
Added --allow-run-as-root to build.sh
wfspotz Jul 27, 2017
2f78f93
Fixing -D MPI_EXEC_PRE_NUMPROCS_FLAGS=--allow-run-as-root
wfspotz Jul 27, 2017
6182218
Added -D MPI_EXEC_MAX_NUMPROCS=$CPU_COUNT to build.sh
wfspotz Jul 27, 2017
9824a1d
Temporarily remove CPU maximum from build script
wfspotz Aug 1, 2017
d9f7a53
Checking to see if segfault is raised on a single processor
wfspotz Aug 1, 2017
5a1377f
Fix seg fault in Tpetra tests with patch
wfspotz Aug 2, 2017
cd80e0f
Added MPI exec flag for Linux
wfspotz Aug 3, 2017
c6d29f1
quotes
isuruf Aug 9, 2017
bc7dd92
semi-colons to separate args
isuruf Aug 9, 2017
3f85d37
Set OMPI_MCA_pml before importing PyTrilinos
isuruf Aug 9, 2017
767390b
Install ssh on the docker container
isuruf Aug 9, 2017
ee0cdd9
Create patch.txt
wfspotz Jul 25, 2017
33d21ea
Rename patch.txt to shebang.patch
wfspotz Jul 26, 2017
3642de5
More verbose ctest output for debugging
wfspotz Jul 27, 2017
467ab53
Added --allow-run-as-root to build.sh
wfspotz Jul 27, 2017
0601250
Fixing -D MPI_EXEC_PRE_NUMPROCS_FLAGS=--allow-run-as-root
wfspotz Jul 27, 2017
d07a1d6
Checking to see if segfault is raised on a single processor
wfspotz Aug 1, 2017
911d6b7
Fix seg fault in Tpetra tests with patch
wfspotz Aug 2, 2017
f009115
Try setting OpenMPI MCS parameter a different way
wfspotz Aug 8, 2017
b4850ef
Check uname on CircleCI
wfspotz Aug 8, 2017
336b6eb
Add ssh to the run environment
wfspotz Aug 8, 2017
aba2b75
Fix run_test.py to not modify os.environ when sys.platform is darwin
wfspotz Aug 23, 2017
c4c5412
Revert "Set OMPI_MCA_pml before importing PyTrilinos"
isuruf Aug 24, 2017
b6cdaf3
Fix requirements
isuruf Aug 24, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 232 additions & 0 deletions recipes/pytrilinos/12.10-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
diff -Naur 12.10/packages/PyTrilinos/cmake/PyTrilinosMakeTest.cmake 12.12/packages/PyTrilinos/cmake/PyTrilinosMakeTest.cmake
--- 12.10/packages/PyTrilinos/cmake/PyTrilinosMakeTest.cmake 2017-07-24 14:05:04.000000000 -0600
+++ 12.12/packages/PyTrilinos/cmake/PyTrilinosMakeTest.cmake 2017-07-24 14:03:18.000000000 -0600
@@ -44,7 +44,8 @@
MACRO(PyTrilinos_MAKE_TEST TEST_NAME)

ADD_CUSTOM_COMMAND(OUTPUT ${TEST_NAME}.py
- COMMAND ${CMAKE_BINARY_DIR}/packages/PyTrilinos/util/copyWithCMakeSubstitutions.py
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${CMAKE_BINARY_DIR}/packages/PyTrilinos/util/copyWithCMakeSubstitutions.py
${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.py.in
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}.py.in)
diff -Naur 12.10/packages/PyTrilinos/example/CMakeLists.txt 12.12/packages/PyTrilinos/example/CMakeLists.txt
--- 12.10/packages/PyTrilinos/example/CMakeLists.txt 2017-07-24 14:05:24.000000000 -0600
+++ 12.12/packages/PyTrilinos/example/CMakeLists.txt 2017-07-24 14:03:46.000000000 -0600
@@ -47,7 +47,8 @@
INCLUDE(PyTrilinosMakeTest)

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testutil.py
- COMMAND ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in
${CMAKE_CURRENT_BINARY_DIR}/testutil.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in)
@@ -56,7 +57,8 @@
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/testutil.py)

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gre__115.rua
- COMMAND ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
${CMAKE_CURRENT_SOURCE_DIR}/gre__115.mx
${CMAKE_CURRENT_BINARY_DIR}/gre__115.rua
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gre__115.mx)
diff -Naur 12.10/packages/PyTrilinos/example/exMLAPI_Simple.py.in 12.12/packages/PyTrilinos/example/exMLAPI_Simple.py.in
--- 12.10/packages/PyTrilinos/example/exMLAPI_Simple.py.in 2017-07-21 12:02:10.000000000 -0600
+++ 12.12/packages/PyTrilinos/example/exMLAPI_Simple.py.in 2017-07-21 12:03:45.000000000 -0600
@@ -110,6 +110,8 @@
Solver.SetAztecOption(AztecOO.AZ_output, 16);
err = Solver.Iterate(1550, 1e-5)

+ Prec.DestroyPreconditioner()
+
return err

if __name__ == "__main__":
diff -Naur 12.10/packages/PyTrilinos/src/pyfragments.swg.in 12.12/packages/PyTrilinos/src/pyfragments.swg.in
--- 12.10/packages/PyTrilinos/src/pyfragments.swg.in 2017-08-02 11:47:32.000000000 -0600
+++ 12.12/packages/PyTrilinos/src/pyfragments.swg.in 2017-08-02 11:47:55.000000000 -0600
@@ -127,32 +127,47 @@
SWIG_AsVal_dec(long)(PyObject * obj, long * val)
{
static PyArray_Descr * longDescr = PyArray_DescrNewFromType(NPY_LONG);
- if (PyInt_Check(obj)) {
+%#if PY_VERSION_HEX < 0x03000000
+ if (PyInt_Check(obj))
+ {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
- } else if (PyLong_Check(obj)) {
+ } else
+%#endif
+ if (PyLong_Check(obj))
+ {
long v = PyLong_AsLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- PyErr_Clear();
+ if (!PyErr_Occurred())
+ {
+ if (val) *val = v;
+ return SWIG_OK;
+ }
+ else
+ {
+ PyErr_Clear();
+ return SWIG_OverflowError;
}
}
%#ifdef SWIG_PYTHON_CAST_MODE
{
int dispatch = 0;
long v = PyInt_AsLong(obj);
- if (!PyErr_Occurred()) {
+ if (!PyErr_Occurred())
+ {
if (val) *val = v;
return SWIG_AddCast(SWIG_OK);
- } else {
+ }
+ else
+ {
PyErr_Clear();
}
- if (!dispatch) {
+ if (!dispatch)
+ {
double d;
int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+ if (SWIG_IsOK(res) &&
+ SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX))
+ {
if (val) *val = (long)(d);
return res;
}
@@ -160,7 +175,7 @@
}
%#endif
if (!PyArray_IsScalar(obj,Integer)) return SWIG_TypeError;
- PyArray_CastScalarToCtype(obj, (void*)val, longDescr);
+ if (val) PyArray_CastScalarToCtype(obj, (void*)val, longDescr);
return SWIG_OK;
}
}
@@ -179,37 +194,54 @@
SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val)
{
static PyArray_Descr * ulongDescr = PyArray_DescrNewFromType(NPY_ULONG);
- if (PyInt_Check(obj)) {
+%#if PY_VERSION_HEX < 0x03000000
+ if (PyInt_Check(obj))
+ {
long v = PyInt_AsLong(obj);
- if (v >= 0) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- return SWIG_OverflowError;
+ if (v >= 0)
+ {
+ if (val) *val = v;
+ return SWIG_OK;
+ }
+ else
+ {
+ return SWIG_OverflowError;
}
- } else if (PyLong_Check(obj)) {
+ } else
+%#endif
+ if (PyLong_Check(obj))
+ {
unsigned long v = PyLong_AsUnsignedLong(obj);
- if (!PyErr_Occurred()) {
+ if (!PyErr_Occurred())
+ {
if (val) *val = v;
return SWIG_OK;
- } else {
+ }
+ else
+ {
PyErr_Clear();
+ return SWIG_OverflowError;
}
}
%#ifdef SWIG_PYTHON_CAST_MODE
{
int dispatch = 0;
unsigned long v = PyLong_AsUnsignedLong(obj);
- if (!PyErr_Occurred()) {
+ if (!PyErr_Occurred())
+ {
if (val) *val = v;
return SWIG_AddCast(SWIG_OK);
- } else {
+ }
+ else
+ {
PyErr_Clear();
}
- if (!dispatch) {
+ if (!dispatch)
+ {
double d;
int res = SWIG_AddCast(SWIG_AsVal(double)(obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX))
+ {
if (val) *val = (unsigned long)(d);
return res;
}
@@ -217,7 +249,7 @@
}
%#endif
if (!PyArray_IsScalar(obj,Integer)) return SWIG_TypeError;
- PyArray_CastScalarToCtype(obj, (void*)val, ulongDescr);
+ if (val) PyArray_CastScalarToCtype(obj, (void*)val, ulongDescr);
return SWIG_OK;
}
}
diff -Naur 12.10/packages/PyTrilinos/src/scripts/CMakeLists.txt 12.12/packages/PyTrilinos/src/scripts/CMakeLists.txt
--- 12.10/packages/PyTrilinos/src/scripts/CMakeLists.txt 2017-07-24 14:06:07.000000000 -0600
+++ 12.12/packages/PyTrilinos/src/scripts/CMakeLists.txt 2017-07-24 14:04:12.000000000 -0600
@@ -43,7 +43,8 @@
# @HEADER

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testutil.py
- COMMAND ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in
${CMAKE_CURRENT_BINARY_DIR}/testutil.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in)
@@ -54,7 +55,8 @@
MACRO(PyTrilinos_MAKE_SCRIPT SCRIPT_NAME)

ADD_CUSTOM_COMMAND(OUTPUT ${SCRIPT_NAME}.py
- COMMAND ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_NAME}.py.in
${CMAKE_CURRENT_BINARY_DIR}/${SCRIPT_NAME}.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_NAME}.py.in)
diff -Naur 12.10/packages/PyTrilinos/test/CMakeLists.txt 12.12/packages/PyTrilinos/test/CMakeLists.txt
--- 12.10/packages/PyTrilinos/test/CMakeLists.txt 2017-07-24 14:05:41.000000000 -0600
+++ 12.12/packages/PyTrilinos/test/CMakeLists.txt 2017-07-24 14:04:31.000000000 -0600
@@ -46,7 +46,8 @@
INCLUDE(PyTrilinosMakeTest)

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testutil.py
- COMMAND ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${PyTrilinos_BINARY_DIR}/util/copyWithCMakeSubstitutions.py
${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in
${CMAKE_CURRENT_BINARY_DIR}/testutil.py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/testutil.py.in)
56 changes: 56 additions & 0 deletions recipes/pytrilinos/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
mkdir -p build
cd build

if [ $(uname) == Darwin ]; then
export CXXFLAGS="-stdlib=libc++"
fi

export MPI_FLAGS=--allow-run-as-root

if [ $(uname) == Linux ]; then
export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated"
fi

cmake \
-D CMAKE_BUILD_TYPE:STRING=RELEASE \
-D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \
-D BUILD_SHARED_LIBS:BOOL=ON \
-D TPL_ENABLE_MPI:BOOL=ON \
-D MPI_BASE_DIR:PATH=$PREFIX \
-D MPI_EXEC:FILEPATH=$PREFIX/bin/mpiexec \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try adding, -D MPI_EXEC_PRE_NUMPROCS_FLAGS=--allow-run-as-root

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So how will this help?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests fail with the message below because we are running as root in the docker container,

--------------------------------------------------------------------------
mpiexec has detected an attempt to run as root.
Running at root is *strongly* discouraged as any mistake (e.g., in
defining TMPDIR) or bug can result in catastrophic damage to the OS
file system, leaving your system in an unusable state.

You can override this protection by adding the --allow-run-as-root
option to your cmd line. However, we reiterate our strong advice
against doing so - please do so at your own risk.
--------------------------------------------------------------------------

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add -D MPI_EXEC_MAX_NUMPROCS=$CPU_COUNT to limit the number of processes that are used in travis-ci.

-D MPI_EXEC_PRE_NUMPROCS_FLAGS:STRING="$MPI_FLAGS" \
-D PYTHON_EXECUTABLE:FILEPATH=$PYTHON \
-D SWIG_EXECUTABLE:FILEPATH=$PREFIX/bin/swig \
-D DOXYGEN_EXECUTABLE:FILEPATH=$PREFIX/bin/doxygen \
-D Trilinos_ENABLE_Fortran:BOOL=OFF \
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_TESTS:BOOL=OFF \
-D Trilinos_ENABLE_EXAMPLES:BOOL=OFF \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_Triutils:BOOL=ON \
-D Trilinos_ENABLE_Tpetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_Domi:BOOL=ON \
-D Trilinos_ENABLE_Isorropia:BOOL=OFF \
-D Trilinos_ENABLE_Pliris:BOOL=OFF \
-D Trilinos_ENABLE_AztecOO:BOOL=ON \
-D Trilinos_ENABLE_Galeri:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_Komplex:BOOL=ON \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_NOX:BOOL=OFF \
-D NOX_ENABLE_LOCA:BOOL=OFF \
-D Trilinos_ENABLE_PyTrilinos:BOOL=ON \
-D PyTrilinos_ENABLE_TESTS:BOOL=ON \
-D PyTrilinos_ENABLE_EXAMPLES:BOOL=ON \
-D PyTrilinos_INSTALL_PREFIX:PATH=$PREFIX \
$SRC_DIR

make -j $CPU_COUNT

ctest --output-on-failure

make install
66 changes: 66 additions & 0 deletions recipes/pytrilinos/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% set name = "PyTrilinos" %}
{% set version = "12.10.1" %}
{% set sha256 = "ea8ff573bb1f452f2585950cdabe7e2c84cb35013844c58dc878c66bd4245e06" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
fn: trilinos-{{ version }}-Source.tar.gz
url: http://trilinos.csbsju.edu/download/files/trilinos-{{ version }}-Source.tar.gz
sha256: {{ sha256 }}
patches:
- 12.10-fixes.patch

build:
number: 0
skip: true # [win or py3k]

requirements:
build:
- cmake >=2.8.11
- toolchain
- openmpi
- python
- swig 3.0.10
- doxygen
- numpy 1.7.*

run:
- openmpi
- python
- numpy >=1.7

test:
imports:
- PyTrilinos.Teuchos
- PyTrilinos.Epetra
- PyTrilinos.TriUtils
- PyTrilinos.Tpetra
- PyTrilinos.EpetraExt
- PyTrilinos.Domi
- PyTrilinos.AztecOO
- PyTrilinos.Galeri
- PyTrilinos.Amesos
- PyTrilinos.IFPACK
- PyTrilinos.Komplex
- PyTrilinos.ML
- PyTrilinos.Anasazi

about:
home: https://trilinos.org
license: BSD-3-Clause
license_family: BSD
license_file: LICENSE
summary:
Python interfaces to Sandia's suite of HPC solvers and enabling technologies
description:
Python interfaces to fast, compiled object-oriented algorithms and
enabling technologies for the solution of large-scale, complex
multi-physics engineering and scientific problems.
dev_url: https://github.com/trilinos/Trilinos

extra:
recipe-maintainers:
- wfspotz
1 change: 1 addition & 0 deletions recipes/pytrilinos/yum_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openssh-clients