Skip to content

Commit

Permalink
Fix INSTALL instructions for newer versions of pip (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrom99 authored Jan 25, 2025
1 parent 4f03162 commit 1f6e7b3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
19 changes: 10 additions & 9 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

----------------------------------------------------------------------
INSTALLATION VIA COMPILATION
INSTALLATION VIA COMPILATION
----------------------------------------------------------------------

See also: http://pymolwiki.org/index.php/Linux_Install
Expand All @@ -15,19 +15,19 @@ REQUIREMENTS
https://github.com/schrodinger/pmw-patched
- OpenGL
- GLEW
- GLUT (freeglut) (optional, enable with --glut)
- GLUT (freeglut) (optional, enable with --glut=true)
- libpng
- freetype
- libxml2 (optional, for COLLADA export, disable with --no-libxml)
- libxml2 (optional, for COLLADA export, disable with --libxml=no)
- msgpack-c 2.1.5+ (optional, for fast MMTF loading and export,
disable with --use-msgpackc=no)
- mmtf-cpp (for fast MMTF export, disable with --use-msgpackc=no)
- PyQt5, PyQt6, PySide2 or PySide6 (optional, will fall back to Tk
interface if compiled with --glut)
interface if compiled with --glut=true)
- glm
- catch2 (optional, enable with --testing)
- openvr 1.0.x (optional, enable with --openvr)
- libnetcdf (optional, disable with --no-vmd-plugins)
- catch2 (optional, enable with --testing=true)
- openvr 1.0.x (optional, enable with --openvr=true)
- libnetcdf (optional, disable with --vmd-plugins=no)

SETUP OPTIONS

Expand Down Expand Up @@ -57,7 +57,8 @@ INSTALLATION

RUNNING PyMOL

~/someplace/bin/pymol
$PYMOL_PATH/bin/pymol
or
$PYTHONUSERBASE/bin/pymol

Good luck!

44 changes: 23 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def create_buildinfo(outputdir, pymoldir="."):

# handle extra arguments
def str2bool(v: str) -> bool:
if v.lower() == "true":
if v.lower() in ("true", "yes"):
return True
elif v.lower() == "false":
elif v.lower() in ("false", "no"):
return False
else:
raise argparse.ArgumentTypeError("Boolean value expected.")
Expand All @@ -186,8 +186,8 @@ def str2bool(v: str) -> bool:
class options:
osx_frameworks = True
jobs = int(os.getenv("JOBS", 0))
no_libxml = False
no_glut = True
libxml = True
glut = False
use_msgpackc = "guess"
testing = False
openvr = False
Expand All @@ -198,10 +198,10 @@ class options:

parser = argparse.ArgumentParser()
parser.add_argument(
"--glut", dest="no_glut", type=str2bool, help="link with GLUT (legacy GUI)"
"--glut", dest="glut", type=str2bool, help="link with GLUT (legacy GUI)"
)
parser.add_argument(
"--no-osx-frameworks",
"--osx-frameworks",
dest="osx_frameworks",
help="on MacOS use XQuartz instead of native frameworks",
type=str2bool,
Expand All @@ -213,11 +213,11 @@ class options:
help="for parallel builds " "(defaults to number of processors)",
)
parser.add_argument(
"--no-libxml",
"--libxml",
type=str2bool,
help="skip libxml2 dependency, disables COLLADA export",
)
parser.add_argument("--use-openmp", choices=("yes", "no"), help="Use OpenMP")
parser.add_argument("--use-openmp", type=str2bool, help="Use OpenMP")
parser.add_argument(
"--use-vtkm",
choices=("1.5", "1.6", "1.7", "no"),
Expand All @@ -232,7 +232,7 @@ class options:
parser.add_argument("--testing", type=str2bool, help="Build C-level tests")
parser.add_argument("--openvr", dest="openvr", type=str2bool)
parser.add_argument(
"--no-vmd-plugins",
"--vmd-plugins",
dest="vmd_plugins",
type=str2bool,
help="Disable VMD molfile plugins (libnetcdf dependency)",
Expand Down Expand Up @@ -433,7 +433,9 @@ def finalize_options(self):

def run(self):
super().run()
self.install_pymol_path()

assert self.pymol_path is not None
self.install_pymol_path(self.pymol_path)

if not self.no_launcher:
self.make_launch_script()
Expand Down Expand Up @@ -462,19 +464,19 @@ def copy(self, src, dst):
copy = self.copy_tree_nosvn if os.path.isdir(src) else self.copy_file
copy(src, dst)

def install_pymol_path(self):
self.mkpath(self.pymol_path)
def install_pymol_path(self, base_path):
self.mkpath(base_path)
for name in [
"LICENSE",
"data",
"test",
"examples",
]:
self.copy(name, os.path.join(self.pymol_path, name))
self.copy(name, os.path.join(base_path, name))

if options.openvr:
self.copy(
"contrib/vr/README.md", os.path.join(self.pymol_path, "README-VR.txt")
"contrib/vr/README.md", os.path.join(base_path, "README-VR.txt")
)

def make_launch_script(self):
Expand Down Expand Up @@ -606,7 +608,7 @@ def make_launch_script(self):
("_PYMOL_VMD_PLUGINS", None),
]

if not options.no_libxml:
if options.libxml:
# COLLADA support
def_macros += [("_HAVE_LIBXML", None)]
libs += ["xml2"]
Expand All @@ -627,7 +629,7 @@ def make_launch_script(self):

pymol_src_dirs += ["contrib/mmtf-c"]

if options.no_glut:
if not options.glut:
def_macros += [
("_PYMOL_NO_MAIN", None),
]
Expand All @@ -652,7 +654,7 @@ def make_launch_script(self):
if options.osx_frameworks:
ext_link_args += [
"-framework OpenGL",
] + (not options.no_glut) * [
] + (options.glut) * [
"-framework GLUT",
]
def_macros += [
Expand All @@ -661,7 +663,7 @@ def make_launch_script(self):
else:
libs += [
"GL",
] + (not options.no_glut) * [
] + (options.glut) * [
"glut",
]

Expand All @@ -684,11 +686,11 @@ def make_launch_script(self):
"freetype",
"libpng",
]
+ (not options.no_glut)
+ (options.glut)
* [
"freeglut",
]
+ (not options.no_libxml)
+ (options.libxml)
* [
"libxml2",
]
Expand All @@ -708,7 +710,7 @@ def make_launch_script(self):
libs += [
"GL",
"GLEW",
] + (not options.no_glut) * [
] + (options.glut) * [
"glut",
]

Expand Down

0 comments on commit 1f6e7b3

Please sign in to comment.