Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
dmorse committed Nov 14, 2017
2 parents 733cb8b + c663608 commit 6d888c5
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 38 deletions.
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
sudo: required
dist: trusty
language: fortran

matrix:
include:
- os: linux
compiler: clang
env: BTYPE=Debug
- os: linux
compiler: gcc
env: BTYPE=Release

before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes update; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install gfortran; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install liblapack-dev; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install fftw3; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install libfftw3-dev; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install python; fi

install:
- mkdir pscf-build && cd pscf-build
# Configure
- cmake $TRAVIS_BUILD_DIR -DCMAKE_Fortran_COMPILER=`which gfortran` -DCMAKE_BUILD_TYPE=$BTYPE -DCMAKE_INSTALL_PREFIX=~/pscf
# Build
- make

script:
## Test the program
#- make test
# Create package
- make package
# Make sure we can install with no issues.
- make install
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
IF (USE_INTEL)
set (CMAKE_C_COMPILER "icc")
set (CMAKE_CXX_COMPILER "icpc")
ENDIF (USE_INTEL)
ENDIF (USE_INTEL)


# CMakeLists files in this project can
# refer to the root source directory of the project as ${PSCF_SOURCE_DIR} and
# to the root binary directory of the project as ${PSCF_BINARY_DIR}.
cmake_minimum_required (VERSION 2.8.11)
project (PSCF)
project (PSCF Fortran)

#### Based on https://cmake.org/Wiki/CMakeForFortranExamplea ####
enable_language (Fortran)
Expand Down Expand Up @@ -75,32 +75,32 @@ set(CPACK_PACKAGE_VERSION_PATCH "0")
# TODO: build out components "applications libraries headers" (where headers are the .mod files)
set(CPACK_COMPONENTS_ALL Unspecified)

# DONE: finish Bundle
# DONE: finish Bundle
# DONE: finish DEB and RPM generators (http:https://www.vtk.org/Wiki/CMake:Component_Install_With_CPack)
# TODO: finish NSIS generator (http:https://www.vtk.org/Wiki/CMake:Component_Install_With_CPack)
# DONE: test compile and package on Unix and Windows
if (APPLE)
if (BUILD_DMG)
set(CPACK_GENERATOR
Bundle
set(CPACK_GENERATOR
Bundle
)
else (BUILD_DMG)
set(CPACK_GENERATOR
set(CPACK_GENERATOR
TGZ
ZIP
)
endif (BUILD_DMG)
else (APPLE)
if (UNIX)
if (EXISTS /etc/redhat-release)
set(CPACK_GENERATOR
set(CPACK_GENERATOR
RPM
TGZ
ZIP
)
set(CPACK_RPM_PACKAGE_REQUIRES "lapack >= 3.0.0, libfft3 >= 3.2.0")
else()
set(CPACK_GENERATOR
set(CPACK_GENERATOR
DEB
TGZ
ZIP
Expand All @@ -111,8 +111,8 @@ else (APPLE)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
endif()
else (UNIX)
set(CPACK_GENERATOR
NSIS
set(CPACK_GENERATOR
NSIS
ZIP
)
endif(UNIX)
Expand All @@ -128,7 +128,7 @@ set(CPACK_BUNDLE_STARTUP_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/bundle/pscf.s
#set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/tools/bundle/Icon.png)

set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Evan Bollig") #required for DEB

set(BU_CHMOD_BUNDLE_ITEMS ON)
set(CPACK_BINARY_DRAGNDROP ON)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
Expand All @@ -142,7 +142,7 @@ set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README)
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README)

if (APPLE AND BUILD_DMG)
# Force the README up to the DMG root
# Force the README up to the DMG root
INSTALL(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ../../../Extra RENAME README.txt)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ../../../Extra RENAME LICENSE.txt)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/tools/bundle/HOWTO_INSTALL_OSX.txt DESTINATION ../../../. RENAME HOWTO_INSTALL_OSX.txt)
Expand All @@ -151,7 +151,7 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION share/pscf RENAME README.tx
INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION share/pscf RENAME LICENSE.txt)
endif (APPLE AND BUILD_DMG)

install(PROGRAMS
install(PROGRAMS
tools/bin/pscf-read-sweep tools/bin/pscf-env
DESTINATION bin)

Expand Down
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is the Dockerfile for PSCF.
#
# To build the container, you need docker to be installed on
# your machine (https://www.docker.com) and run the following command
#
# docker build -t pscf .
#
# It will create a Debian-based container that contains everything
# needed to compile pscf
#
# Everything will be installed in /pscf
#
# To run the container interactively
#
# docker run -it pcsf /bin/bash

FROM debian

RUN apt-get update && \
apt-get install -y \
cmake \
gfortran \
liblapack3 \
libfftw3-dev \
python

WORKDIR .
ADD . /pcsf
RUN cd /pcsf_SRC && \
mkdir -p build && \
cd build && \
export FC=`which gfortran` && \
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/pcsf && \
make && \
make install
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# PSCF - Polymer Self-Consistent Field Theory

[![Travis][buildstatus_image_travis]][travisci]

Copyright (2002-2016) Regents of the University of Minnesota

PSCF is a Fortran 90 program for numerically solving the polymer
self-consistent field theory for periodic microstructures formed
by incompressible melts or mixtures of linear block copolymers,
linear homopolymers, and small molecule solvents.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation. A copy of this license is included in
the LICENSE file in the top-level PSCF directory.

# Contributors

- David Morse
- Chris Tyler
- Jian Qin
- Amit Ranjan
- Raghuram Thiagarajan
- Akash Arora

# Dependencies

PSCF depends upon the FFTW fast Fourier transform library and the
LAPACK linear algebra library. These packages must be installed
before attempting to compile the program from source.

# User Documentation

A web user manual is avalaible at:

https://pscf.readthedocs.io

Instructions for compiling the program from source, as well as various
ways to install precompiled executables, are given in the user manual.

The source files for the user manual are text files that are stored in
the doc/user-man directory. The relevant files have file extension .rst.

# Developer Documentation

A local copy of the developer API documentation, which includes
documentation for all modules, subroutines and public variables, may
be regenerated by following instructions given in the file doc/README.
The resulting .html page are installed in doc/devel-man.

# Directory Structure

src/ - Fortran 90 source files
doc/ - documentation files
doc/user-man - - user manual source files
tools/ - Tools for processing output and source
tools/matlab - - matlab scripts for visualization
tools/python - - python modules
make/ - build directory for make

An annotated list of source files is given in the file src/SRC_FILES.
Before modifying any fortran files, see the note at the end of that
file regarding the use of preprocessor to generate some files.

# Examples

A library of examples is provided in a separate github repository,
located at https://github.com/dmorse/pscf-examples


[buildstatus_image_travis]: https://travis-ci.org/Gjacquenot/pscf.svg?branch=master
[travisci]: https://travis-ci.org/Gjacquenot/pscf
57 changes: 32 additions & 25 deletions doc/user-man/compile-make.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
Compiling from source, using make
=================================

It is also possible to compile using the unix make utility using a simple
Makefile that is provided in the make/ directory of the git repository. The
instructions for using make to compile from source are same on any unix-like
operating system, including Max OS X. The main difference among different
unix environments is the locations of the required libraries.
It is also possible to compile using the unix make utility alone, using
a simple Makefile that is provided in the make/ directory of the git
repository. The instructions for using make to compile from source are
the same on any unix-like operating system, including Max OS X. The main
difference among different unix environments is the locations of the
required libraries.

To compile the code in this way, proceed as follows:

Expand All @@ -17,33 +18,39 @@ To compile the code in this way, proceed as follows:
page. You will need to install all dependencies listed there
except cmake.

* Follow the directions given in the preceding discussion of
:ref:`install-compile-cmake-getsource-sub` to obtain the source
code and create an appropriate directory structure.
* Follow the directions given in the discussion of
:ref:`install-compile-cmake-getsource-sub` on the previous page
to create an appropriate directory structure and obtain the
source code. After this step, you should have a directory named
pscf/ with a directory named git/ that contains the contents of
the git repository. You do not need to create a subdirectory
of pscf/ named cmake/ if you are not using cmake.

* Change the working directory (cd) to the directory pscf/git/make in
the directory structure described in the instructions for compiling
with cmake. Note that this is an existing subdirectory of the
pscf/git directory, and is different from the initially empty
pscf/cmake directory from which we recommended that invoke cmake
when using cmake to generate makefiles.
* Change the working directory (cd) to the directory pscf/git/make .
Note that this is an existing subdirectory of the pscf/git
directory, and is different from the initially empty directory
pscf/cmake from which we recommended that invoke cmake when using
cmake to compile.

* The pscf/git/make directory will contain files named config.mk_r
and Makefile. Make a copy of the file config.mk_r, by entering::

cd config.mk_r config.mk

* Examine and edit the new config.mk file to reflect your environment,
and to specify an installation directory. The need to manually edit
this configuration file is the main difference between using cmake
to generate makefiles and using the simple makefile distributed with
the source code. See below for further instructions about this step.
and to specify an installation directory. See below for further
instructions about this step. The need to manually edit this
configuration file is the main difference between using cmake to
generate makefiles and using the simple makefile distributed with
the source code.

* To compile, enter::

> make -j4 all

from within pscf/git/make. The "-j4" option is not necessary.
from within pscf/git/make. The "-j4" option is not necessary, and
simply installs make to try to use up to 4 CPU cores during
compilation, if available.

* To install in the directory specified by the $(INSTALL) makefile
variable (as defined in config.mk), enter::
Expand All @@ -58,10 +65,10 @@ Several of these steps are discussed in more detail below.

**Editing the config.mk configfuration file**

In the config.mk file in the src/make directory (which you must create
by copying config.mk_r), you will need to set values for a set of macro
variables to values appropriate to your system. Makefile variables you
may need to reset are:
In the config.mk file in the src/make directory (which you should have
created by copying config.mk_r), you will need to set values for several
macro variables to values appropriate to your system. Makefile variables
you may need to reset are:

========= ========================================================
F90 path to executable for Fortran 90 compiler
Expand All @@ -74,8 +81,8 @@ may need to reset are:
========= ========================================================

The INSTALL makefile variable in this makefile is equivalent to the
MAKE_INSTALL_PREFIX variable that can be passed to cmake when compiling
using cmake.
MAKE_INSTALL_PREFIX variable that can be passed to cmake when using
cmake to create a makefile.

The file config.mk_r is a default makefile that is stored in the
repository. We require you to make an operational copy of this, named
Expand Down

0 comments on commit 6d888c5

Please sign in to comment.