Skip to content

Commit

Permalink
Merge pull request #12 from Gjacquenot/master
Browse files Browse the repository at this point in the history
Improve PSCF development
  • Loading branch information
dmorse committed Nov 14, 2017
2 parents e99ef53 + a3d14f5 commit c663608
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 13 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

0 comments on commit c663608

Please sign in to comment.