Skip to content

Commit

Permalink
Merge branch 'python3'
Browse files Browse the repository at this point in the history
  • Loading branch information
agrossfield committed Feb 27, 2019
2 parents 8592db5 + 8ae57af commit 31a6138
Show file tree
Hide file tree
Showing 57 changed files with 836 additions and 1,086 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ loos.py
loos/__init__.py
setup.sh
setup.csh
custom.py

# Library files
*.so
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = LOOS
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v2.3.3-beta
PROJECT_NUMBER = v3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
133 changes: 79 additions & 54 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,52 @@
| LOOS | PyLOOS |
Operating System | Support | Support | Notes
---------------- | ------- | ------- | -----
Fedora 17 | yes | yes | Unsupported
Fedora 18 | yes | yes | Deprecated
Fedora 19 | yes | yes |
Fedora 20 | yes | yes |
Fedora 21 | yes | yes |
Fedora 22 | yes | yes |
Fedora 23 | yes | yes |
Fedora 24 | yes | yes |
Fedora 25 | yes | yes |
Ubuntu 12.04 LTS | yes | yes |
Ubuntu 14.04 LTS | yes | yes |
Ubuntu 15.04 | yes | yes |
Ubuntu 15.10 | yes | yes |
Ubuntu 16.04 LTS | yes | yes |
Debian 7.8 | yes | yes |
Debian 8.1 | yes | yes |
Centos 6.7 | yes | yes | See OS notes
Centos 7 | yes | yes | See OS notes
OpenSUSE 12 | yes | yes | See OS notes
OpenSUSE 13 | yes | yes |
Manjaro 0.8 | yes | yes | Unsupported
Mint 17 | yes | yes | Unsupported
Mint 18 | yes | yes |
Slackware 14.1 | yes | yes | Unsupported
Windows 7 (Cygwin) | yes | no | Unsupported
MacOS 10.11 | yes | yes | See OS notes


* Deprecated: We used to support thsi configuration, but no longer test it. It may still work.
Fedora 19 | yes | yes | Deprecated
Fedora 20 | yes | yes | Deprecated
Fedora 21 | yes | yes | Deprecated
Fedora 22 | yes | yes | Deprecated
Fedora 23 | yes | yes | Deprecated
Fedora 24 | yes | yes | Deprecated
Fedora 25 | yes | yes | Deprecated
Fedora 26 | yes | yes | Deprecated
Fedora 27 | yes | yes | Deprecated
Fedora 28 | yes | yes |
Fedora 29 | yes | yes |
Ubuntu 12.04 LTS | yes | yes | Deprecated
Ubuntu 14.04 LTS | yes | yes | Deprecated
Ubuntu 15.04 | yes | yes | Deprecated
Ubuntu 15.10 | yes | yes | Deprecated
Ubuntu 16.04 LTS | yes | yes | Deprecated
Ubuntu 18.04 | yes | yes |
Debian 7.8 | yes | yes | Deprecated
Debian 8.1 | yes | yes | Deprecated
Debian 9.8 | yes | yes |
Centos 7 | yes | no | No python 3
OpenSUSE 12 | yes | yes | Deprecated
OpenSUSE 13 | yes | yes | Deprecated
OpenSUSE 15 | yes | yes |
MacOS X | yes | yes | See OS notes


* Deprecated: We used to support this configuration, but no longer test it. It may still work.
* Unsupported: We have built LOOS in the past using this configuration, but do not
regularly test it and provide no direct support for using it.


As of LOOS 3.0, we also support building inside a Conda environment. This is the preferred way to build on MacOS, and on any Linux environment that is not supported.

# Building and Installing LOOS

## For the Impatient




LOOST requires BOOST 1.36 or higher, SCons, and Atlas/LAPACK. Please
refer to the OS-specific instructions below for more details. For general
advice about configuring LOOS and building in unusual environments, see
LOOST requires BOOST 1.36 or higher, SCons, and Atlas/LAPACK or other BLAS.
Please refer to the OS-specific instructions below for more details. For
general advice about configuring LOOS and building in unusual environments, see
the "General Notes" section at the end of this file.

If you are building on a system where the default python is 2.7, you will need to copy custom.py-proto to custom.py, and uncomment the line setting PYTHON_INC (verifying that it's the correct location for your system).

LOOS can then be built using the following command:

scons
Expand All @@ -71,7 +71,6 @@ To use LOOS, your environment must be first setup:
Target | Description
------ | -----------
core | LOOS Library and PyLOOS
docs | Rebuild only documentation
tools | LOOS Library, Tools, and PyLOOS
all | LOOS Library, Tools, PyLOOS, and documentation (if necessary), and all Packages (default)
install| Install library, tools, PyLOOS, documentation, and all Packages
Expand Down Expand Up @@ -157,44 +156,61 @@ already multithreaded.

### Documentation

If you download a LOOS release from SourceForge, then you will already
have pre-built documentation. If you download a release from GitHub,
then you can also download the prebuilt documentation that corresponds
to the release (e.g. loos-2.3.2-docs.tar.gz). Simply place the
compressed tar-file in your LOOS source directory and scons will
unpack it for you and move it into place.

However, if you clone LOOS from GitHub, you will need to either:

1. consult the online documentation at http://grossfieldlab.github.io/loos/

2. build a new copy of the documentation. To do so, you will need to
install doxygen and graphviz (available in most package managers).
SCons will now generate new documentation in the docs/ directory
for the docs, all, and install targets.

doxygen


======

# OS Specific Notes

## Conda

Assuming you already have a working install of Anaconda or miniconda, you'll
need to say

conda create loos
conda activate loos
conda install swig scons numpy scipy boost blas libnetcdf

Then, run the newly installed scons to build LOOS

$CONDA_PREFIX/bin/scons

### Documentation

To build the documentation, you will also require doxygen and graphviz,

conda install doxygen graphviz
doxygen


## Fedora

LOOS has been tested on Fedora (64-bit). We assume you already have
the basic compiler tools installed (i.e. g++). You will need to
install scons, boost, and atlas:

sudo dnf install gcc-c++ scons boost-devel atlas-devel netcdf-devel python-devel swig python2-numpy python2-scipy

LOOS/PyLOOS only supports Python 2, so you must specify which version of numpy and scipy to use for
Fedora 24. For Fedora 23 and older, use the following:
sudo dnf install gcc-c++ scons boost-devel atlas-devel netcdf-devel python3-devel swig python3-numpy python3-scipy

sudo dnf install gcc-c++ scons boost-devel atlas-devel netcdf-devel python-devel swig numpy scipy
Copy custom.py-proto to custom.py, and uncomment the line setting PYTHON_INC (verifying that it's the correct location for your system).

LOOS/PyLOOS only supports Python 3, so you must specify which version of numpy
and scipy to use for Fedora 24 and later. For earlier Fedoras, which don't have
python3 packages for numpy and scipy, you can either install them manually or
use conda.
### Documentation

To build the documentation, you will also require doxygen and graphviz,

sudo dnf install doxygen graphviz
sudo dnf install doxygen graphviz
doxygen

---

Expand All @@ -213,6 +229,7 @@ Then install the packages,

To build the documentation, also install:
sudo yum install doxygen graphviz
doxygen


### PyLOOS
Expand All @@ -226,12 +243,15 @@ CentOS 6: Yum install python-devel and pcre-devel, then download

## Ubuntu, Debian, Mint

sudo apt-get install g++ scons libboost-all-dev libatlas-base-dev libatlas-dev libnetcdf-dev swig python-dev python-numpy python-scipy
sudo apt-get install g++ scons libboost-all-dev libatlas-base-dev libnetcdf-dev swig python3-dev python3-numpy python3-scipy

Copy custom.py-proto to custom.py, and uncomment the line setting PYTHON_INC (verifying that it's the correct location for your system).

### Documentation

To build the documentation:
sudo apt-get install doxygen graphviz
doxygen

---

Expand All @@ -244,7 +264,8 @@ be ignored by the LOOS build.

Using zypper (or your favorite package manager), install the following:

sudo zypper install gcc-c++ scons boost-devel lapack-devel blas-devel swig netcdf-devel python-numpy python-numpy-devel python-scipy
sudo zypper install gcc-c++ scons boost-devel lapack-devel blas-devel swig netcdf-devel python-numpy python3-numpy-devel python3-scipy libboost_filesystem1_66_0-devel libboost_program_options1_66_0 libboost_program_options1_66_0-devel libboost_regex1_66_0 libboost_regex1_66_0-dev libboost_system1_66_0-devel libboost_thread1_66_0-devel


You should get the blas as a dependency for lapack. You may also have lapack3
installed by default, however we've found that lapack must also be installed
Expand All @@ -254,6 +275,7 @@ in order to build LOOS.

To build the documentation:
sudo zypper install doxygen graphviz
doxygen

### OpenSUSE 12

Expand All @@ -269,11 +291,14 @@ The package-manager installed scons is too old. Download and install SCons
There is a problem with using PyLOOS with the new System Integrity
Protection (SIP) enabled (see https://support.apple.com/en-us/HT204899
for more information about SIP). We are aware of this and working on
a decent solution. Until then, there are three options for building and
a decent solution. Until then, there are four options for building and
using PyLOOS under El Capitan.

#### Use conda (recommended)

See the conda install instructions above.

#### Build your own Python (Recommended)
#### Build your own Python

The first way is to download and install your own local Python and use
this to run SCons and PyLOOS. Here again, you have two options: build
Expand Down
2 changes: 1 addition & 1 deletion Packages/Convergence/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ for file in Split(scripts):
Command(PREFIX_BIN + file, file,
[
Copy("$TARGET", "$SOURCE"),
Chmod("$TARGET", 0755)
Chmod("$TARGET", 0o755)
])

env.Alias('convergence_package', conv_tools)
Expand Down
2 changes: 1 addition & 1 deletion Packages/HydrogenBonds/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for file in Split(scripts):
Command(PREFIX_BIN + file, file,
[
Copy("$TARGET", "$SOURCE"),
Chmod("$TARGET", 0755)
Chmod("$TARGET", 0o755)
])


Expand Down
8 changes: 4 additions & 4 deletions Packages/OptimalMembraneGenerator/LipidLibrary.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import glob
Expand All @@ -16,7 +16,7 @@ class LipidLibrary:
def __init__(self, path):
self.path = path
if not os.path.exists(path):
print self.error_message()
print(self.error_message())
sys.exit()

all_files = os.listdir(self.path)
Expand All @@ -28,14 +28,14 @@ def __init__(self, path):
self.structures.append(file)

if self.size() == 0:
print self.error_message()
print(self.error_message())
sys.exit()

def size(self):
return len(self.structures)

def pick_structure(self):
# pick a structure file at random, and build up the filename
# pick a structure file at random, and build up the filename
filename = os.path.join(self.path, random.choice(self.structures))

# read the file
Expand Down
24 changes: 12 additions & 12 deletions Packages/OptimalMembraneGenerator/NAMD.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import subprocess
import sys
Expand All @@ -7,7 +7,7 @@

# @cond TOOLS_INTERNAL
class NAMD:

def __init__(self, psf_file, start_pdb, end_pdb, param_file, box,
command):
self.psf_file = psf_file
Expand All @@ -21,7 +21,7 @@ def __init__(self, psf_file, start_pdb, end_pdb, param_file, box,
self.command = command

# in case we're going to do constraints, construct this filename
self.cons_k_filename = self.start_pdb[:-4] + ".cons.pdb"
self.cons_k_filename = self.start_pdb[:-4] + ".cons.pdb"

self.x_box = box.x()
self.y_box = box.y()
Expand Down Expand Up @@ -87,7 +87,7 @@ def write_restraintfile(self, directory, atomicgroup, spring=10.0):
pdb_file = open(os.path.join(directory,self.cons_k_filename), "w")
pdb_file.write(str(pdb))
pdb_file.close()


def construct_constraints(self):
lines = [ "constraints on",
Expand All @@ -111,10 +111,10 @@ def run_namd(self, inputfilename, outfilename):
"""
outfile = open(outfilename, "w")
try:
subprocess.check_call([self.command, "+p4", inputfilename],
subprocess.check_call([self.command, "+p4", inputfilename],
stdout=outfile)
except subprocess.CalledProcessError:
sys.stderr.write("NAMD call failed, inp = %s, out = %s\n" %
sys.stderr.write("NAMD call failed, inp = %s, out = %s\n" %
(inputfilename, outfilename))
sys.exit(-1)

Expand Down Expand Up @@ -155,20 +155,20 @@ def template(self):

box = loos.GCoord(377, 377, 1000)
n = NAMD("generated.psf", "t.pdb", "end", "toppar/par_build.inp", box)
print n.construct_header()
print(n.construct_header())

print n.construct_box()
print(n.construct_box())

box[0] = 60
n.update_box(box)
print n.construct_box()
print(n.construct_box())
box[0] = 377
n.update_box(box)

print n.construct_mini()
print(n.construct_mini())
#print n.construct_mini(1000)

n.write_inputfile("n.inp", 50)
print "launching NAMD"
print("launching NAMD")
n.run_namd("n.inp", "n.out")
print "finished NAMD"
print("finished NAMD")
Loading

0 comments on commit 31a6138

Please sign in to comment.