Skip to content

Commit

Permalink
use setup (#17)
Browse files Browse the repository at this point in the history
* use setup

* added files back

* bump version numbers

* Update install.rst

* Update setup.py

* Update .travis.yml

Co-authored-by: Neil Wu <[email protected]>
  • Loading branch information
Josh Anibal and ewu63 authored Jun 16, 2020
1 parent 65988cc commit dd101d8
Show file tree
Hide file tree
Showing 33 changed files with 1,610 additions and 87 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ install:
fi
fi
# Compile
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && make"
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && make && pip install ."

# the version of testflo is too new, we downgrade to the last version that supports py2
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && pip install testflo==1.3.5 "

script:
# We need to source the mdolab bashrc before running anything
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && testflo . -v -n 1"
# check that new CGNS files have been generated
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/python/examples && ls -l */*.cgns"
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/examples && ls -l */*.cgns"

after_script:
- docker rm -f app
1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

93 changes: 11 additions & 82 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,99 +10,28 @@ Prerequisites
"heavy lifting". The following external components are required for
pyHyp:

- CGNS Libarary
- PETSc

1. `CGNS Library <http://cgns.sourceforge.net>`_

The CGNS library is used to provide output CGNS functionality for
pyHyp. The latest CGNS version 3.1 is recommended, but the older
version 2.5.x may also be used. The After downloading, untar::

$ tar -xzf cgnslib_3.1.4-2.tar.gz

.. NOTE:: cmake and ccmake are required for building the CGNS
library.

Enter cgnslib_3.1.4 and type::

$ cmake .

By default, the CGNS library does not include the Fortran bindings
that are required for `pyHyp`. This needs to be enabled using the
cmake configure utility, `ccmake`.::

$ ccamke .

A "GUI" appears and toggle ENABLE_FORTRAN by pressing [enter]. Type
'c' to reconfigure and 'g' to generate and exit. Then build the
library using::

$ make

If you are compiling on machine without root access, you're done.
If you are on a local machine with root access, it is usually
easiest to 'install' into the default directory using::

$ sudo make install

.. NOTE:: It is also suggested that the BUILD_CGNSTOOLS option be
used in the configuration, but this is optional.

2. `PETSc <http://www.mcs.anl.gov/petsc/index.html>`_

Download the latest tarball and extract::

$ tar -xzf petsc-3.4.1.tar.gz

PETSc must be first configured. There are a wide variety of
options. The only ones that is strictly necessary are
--with-shared-libraries and --with-fortran-interfaces. However, it is
recommend the following options are used since some are required for
pyWarp. To compile without debugging use: --with-debugging=no. It is
HIGHLY recommended to use debugging until ready to perform production
runs. In that case, you should compile with a separate architecture
for the optimized build. In this case use '--PETSC_ARCH=real-opt' for
example::

$ ./configure --with-shared-libraries --download-superlu_dist=yes --download-parmetis=yes --download-metis=yes --with-fortran-interfaces=1 --with-debuggig=yes --with-scalar-type=real --PETSC_ARCH=real-debug

After the configuration step, PETSc must be built. This is
accomplished with the command provided at the end of the configure
script. It will look something like below::

$ make PETSC_DIR=/home/gaetan/Downloads/petsc-3.4.1 PETSC_ARCH=real-debug all

The last step is to add PETSC_DIR and PETSC_ARCH entries to your
.bashrc file. This is essential. It should look something like
this: (Make sure the CORRECT directory is used!)::

export PETSC_ARCH=real-debug
export PETSC_DIR=/home/user/packages/petsc-3.4.1
Make sure the .bashrc file is sourced before pyHyp is compiled using::

$ source ~/.bashrc

Or simply open a new terminal before compiling pyHyp.

See the documentation of each of these packages for further
information.
See the MDO Lab installation guide `here <http://mdolab.engin.umich.edu/docs/installInstructions/install3rdPartyPackages.html>`_ for the supported versions and installation instructions.

.. NOTE:: A working MPI is not strictly required. However, in most
cases PETSc should be configured with MPI.

Compilation
------------
``pyHyp`` follows the standard MDO Lab build procedure.
To start, first clone the repo. For stability we recommend checking out a tagged release.

`pyHyp` follows the standard MDO Lab build procedure.
To start, find a configuration file close to your current setup in::
Next, find a configuration file close to your current setup in::

$ config/defaults

and copy it to ''config/config.mk''. For example::

$ cp config/defaults/config.LINUX_GFORTRAN.mk config/config.mk

If you are a beginner user installing the packages on a linux desktop,
If you are a beginner user installing the packages on a Linux desktop,
you should use the ``config.LINUX_GFORTRAN.mk`` versions of the configuration
files. The ``config.LINUX_INTEL.mk`` versions are usually used on clusters.

Expand All @@ -116,10 +45,10 @@ the screen (near the end)::
Testing if module hyp can be imported...
Module hyp was successfully imported.

Finally, add the directory containing the pyhyp folder to the
$PYTHONPATH variable in your bashrc file::
Finally, install the Python interface with::

pip install .

export $PYTHONPATH:/path/to/folder/containing/pyhyp/

.. _pyhyp_theory:

Expand All @@ -136,4 +65,4 @@ After you run some of the files, you will get a message like this::
*** Your MPI job will now abort.
[MDO-John:7977] Local abort after MPI_FINALIZE completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!
Despite its scary look, this is a non-issue and means that the script successfully finished.
Despite its scary look, this is a non-issue and means that the script successfully finished.
Loading

0 comments on commit dd101d8

Please sign in to comment.