diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4585c6d --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index e6a7c6c..f3207a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -75,17 +75,17 @@ 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://www.vtk.org/Wiki/CMake:Component_Install_With_CPack) # TODO: finish NSIS generator (http://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 ) @@ -93,14 +93,14 @@ if (APPLE) 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 @@ -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) @@ -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}) @@ -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) @@ -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) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a0f33d8 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..d19e04a --- /dev/null +++ b/README.md @@ -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