[xcrysden] XCrySDen now available in MacPorts
Hanspeter Niederstrasser
fink at snaggledworks.com
Wed Oct 28 03:06:16 CET 2015
> # Use of the MacPorts package manager (www.macports.org) and 'port install
> xcrysden' is recommended
> # as an easier approach than using this file to build from source.
Please do not introduce MacPortisms into the main source. It's like
making the default Linux Makefile force specific DistroXYZ conventions
on all Linux users that then have to be patched out.
> FC = gfortran-mp-5
> TK_LIB = /opt/local/lib/libtk.dylib
> TCL_LIB = /opt/local/lib/libtcl.dylib
> FFTW3_LIB = /opt/local/lib/libfftw3.dylib
> FFTW3_INCDIR = -I/opt/local/include
Those are all MacPorts paths that will only exist on a limited number of
OS X systems (and in fact are not guaranteed to exist on all MacPorts
locations if the user installed in a separate path). Maybe call the
file Make.macosx-macports instead if those paths are kept.
The following changes to David's Make.macosx-x11 makes it more portable.
The only option that really needs to be provied by the user is
LIBPREFIX, which sets the root location of 3rd party libraries (TclTk,
fftw3) (and should not be confused with $prefix which sets the xcrysden
install location).
The file doesn't even need to be modified. LIBPREFIX can be passed
directly to the make command:
make xcrysden LIBPREFIX=/my/libpath
and any other VAR changes can similarly be passed on the 'make' command
(like FC=gfortran-identifier-5) if really needed.
---- 8< ---- 8< ---- 8< ---- 8< ----
--- Make.macosx-x11-orig 2015-10-26 05:52:29.000000000 -0500
+++ Make.macosx-x11 2015-10-27 20:52:57.000000000 -0500
@@ -7,19 +7,15 @@
#
# !!! EDIT ACCORDING TO YOUR OWN NEEDS !!!
# In particular, you must specify:
+# LIBPREFIX (root directory for third party [Tcl/Tk & FFTW3] libraries)
+
+# The following can also be modified as needed:
# FC (Fortran compiler)
# TK_LIB and TCL_LIB (location of Tcl and Tk)
# FFTW3_LIB and FFTW3_INCDIR (location of FFTW3 library and header)
-# Use of the MacPorts package manager (www.macports.org) and 'port install
-xcrysden' is recommended
-# as an easier approach than using this file to build from source.
-# MacPorts can be used to obtain the dependencies: port install gcc5 tcl tk
-+x11 fftw-3
-# tk must have +x11 variant; a different version of gcc can be used instead
-if desired.
-
# X11 and OpenGL from system are being used.
+# Change GLU_LIB, GL_LIB and GL_INCDIR if not using the system GL
#------------------------------------------------------------------------
# compilers & flags
@@ -27,7 +23,7 @@
CFLAGS = -O3 -DUSE_INTERP_RESULT
CC = cc
FFLAGS = -O3
-FC = gfortran-mp-5
+FC = gfortran
#------------------------------------------------------------------------
# X-libraries & include files
@@ -45,12 +41,15 @@
# Libraries and include files
#------------------------------------------------------------------------
-TK_LIB = /opt/local/lib/libtk.dylib
-TCL_LIB = /opt/local/lib/libtcl.dylib
+LIBPREFIX =
+LIBDIR = $(LIBPREFIX)/lib
+INCDIR = $(LIBPREFIX)/include
+
+TK_LIB = $(LIBDIR)/libtk.dylib
+TCL_LIB = $(LIBDIR)/libtcl.dylib
GLU_LIB = /opt/X11/lib/libGLU.dylib
GL_LIB = /opt/X11/lib/libGL.dylib
-FFTW3_LIB = /opt/local/lib/libfftw3.dylib
+FFTW3_LIB = $(LIBDIR)/libfftw3.dylib
GL_INCDIR = -I/opt/X11/include
-FFTW3_INCDIR = -I/opt/local/include
-
+FFTW3_INCDIR = -I$(INCDIR)
---- 8< ---- 8< ---- 8< ---- 8< ----
Thanks,
Hanspeter
More information about the XCrySDen
mailing list