Changeset 315


Ignore:
Timestamp:
Jun 28, 2011 12:21:46 PM (10 years ago)
Author:
toby
Message:

new scons file for compiling (needs linux & win work); update macbin's; changes to texture to work on Mac; minor cleanup to GSASIIpwd

Location:
trunk
Files:
10 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r311 r315  
    876876       
    877877#testing data
    878 import GSASIItestplot as plot
    879878NeedTestData = True
    880879def TestData():
     
    925924
    926925if __name__ == '__main__':
     926    import GSASIItestplot as plot
    927927    global plotter
    928928    plotter = plot.PlotNotebook()
  • trunk/fsource/Makefile

    r253 r315  
     1# this file is present for historical reasons. The build is now done with scons, which does not need to
     2# be configured as source code files are added or removed
     3#
     4scons:
     5        scons -Q
     6        @echo "************************************"
     7        @echo " Note: build is now done with scons"
     8        @echo "************************************"
     9
    110# build the compiled fortran codes needed by GSAS-II with f2py
    211# This is a work in progress. The idea is that files built here are placed in
    312# the bin directory, which is empty in the svn distribution. If these files will
    413# be distributed, they should be moved to a directory named bin<os><ver> where
    5 # <os> is linux, mac or win and
     14# <os> is linux, mac or win and <ver> is the python version
     15
     16# Note that on the Mac, by default the .so files are not portable because they
     17# require libgcc_s.1.dylib and libgfortran.2.dylib to be installed at locations
     18# defined by the compiler install. Three solutions are to patch
     19# /Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/numpy/distutils/fcompiler/gnu.py
     20#bht3:fcompiler bishop$ diff gnu.py gnu.py.original
     21#128,129c128
     22#<             opt.extend(['-undefined', 'dynamic_lookup', '-bundle',
     23#<                         '-static-libgfortran','-static-libgcc'])
     24#---
     25#>             opt.extend(['-undefined', 'dynamic_lookup', '-bundle'])
     26
     27# or (better) to define the env var
     28#  export LDFLAGS "-undefined dynamic_lookup -bundle -static-libgfortran -static-libgcc"
     29
     30# or to edit path in the .so using:
     31# install_name_tool -change  <path>/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib <file>.so
     32# where is <path> is /usr/local/lib
     33# On Mac, use otool -L <file.so> to see what libraries are required
    634
    735BIN = ../bin
    8 LIBS = $(BIN)/pack_f.$(SUFFIX) $(BIN)/pyspg.$(SUFFIX) $(BIN)/polymask.$(SUFFIX) $(BIN)/histogram2d.$(SUFFIX) $(BIN)/pypowder.$(SUFFIX)
     36LIBS = $(BIN)/pack_f.$(SUFFIX) $(BIN)/fellipse.$(SUFFIX) $(BIN)/pyspg.$(SUFFIX) $(BIN)/polymask.$(SUFFIX) $(BIN)/histogram2d.$(SUFFIX) $(BIN)/pytexture.$(SUFFIX)
    937SYMLIB := $(wildcard spsubs/*.for)
    10 POWLIB := $(wildcard powsubs/*.for)
    11 MACFIX = #
    12 MACCOPY = #
     38TXTLIB := $(wildcard texturesubs/*.for)
    1339#----------------------------------------------------------------------
    1440# linux (gfortran)
     
    2854DEL=\#
    2955RM=rm -f
    30 #MACFIX = install_name_tool -change
    31 #MACCOPY = cp
    3256#----------------------------------------------------------------------
    3357# windows g77
     
    6084# libgcc_s.1 at runtime. Based on advice from Ilan at EPD, the .so files are
    6185# modified so that the libraries are placed in the same location as the .so files
    62 # Use otool -L <file.so> to see what is required
    6386#
    6487$(BIN)::
    6588        -mkdir $(BIN)
    6689
    67 $(BIN)/pack_f.$(SUFFIX): pack_f.for $(BIN)
     90$(BIN)/pack_f.$(SUFFIX): pack_f.for
    6891        $(F2PY) -c pack_f.for -m pack_f $(COMPILER) $(PACKCOPTS)
    69 #       $(MACFIX) /usr/local/lib/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib pack_f.$(SUFFIX)
    70 #       $(MACCOPY) /usr/local/lib/libgcc_s.1.dylib $(BIN)
    71 #       $(MACFIX) /usr/local/lib/libgfortran.2.dylib @loader_path/libgfortran.2.dylib pack_f.$(SUFFIX)
    72 #       $(MACCOPY) /usr/local/lib/libgfortran.2.dylib $(BIN)
    7392        $(MOVE) pack_f.$(SUFFIX) $(BIN)
    7493        $(DEL) pack_f.$(SUFFIX)
    7594
    76 $(BIN)/pypowder.$(SUFFIX): pypowder.for $(POWLIB) $(BIN)
    77         $(F2PY) -c pypowder.for -m pypowder $(COMPILER) $(POWLIB)
    78 #       $(MACFIX) /usr/local/lib/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib pypowder.$(SUFFIX)
    79 #       $(MACCOPY) /usr/local/lib/libgcc_s.1.dylib $(BIN)
    80 #       $(MACFIX) /usr/local/lib/libgfortran.2.dylib @loader_path/libgfortran.2.dylib pypowder.$(SUFFIX)
    81 #       $(MACCOPY) /usr/local/lib/libgfortran.2.dylib $(BIN)
    82         $(MOVE) pypowder.$(SUFFIX) $(BIN)
    83         $(DEL) pypowder.$(SUFFIX)
     95$(BIN)/fellipse.$(SUFFIX): fellipse.for
     96        $(F2PY) -c fellipse.for -m fellipse $(COMPILER) $(PACKCOPTS)
     97        $(MOVE) fellipse.$(SUFFIX) $(BIN)
     98        $(DEL) fellipse.$(SUFFIX)
    8499
    85 $(BIN)/pyspg.$(SUFFIX): pyspg.for $(SYMLIB) $(BIN)
     100$(BIN)/polymask.$(SUFFIX): polymask.for
     101        $(F2PY) -c polymask.for -m polymask $(COMPILER)
     102        $(MOVE) polymask.$(SUFFIX) $(BIN)
     103        $(DEL) polymask.$(SUFFIX)
     104
     105$(BIN)/histogram2d.$(SUFFIX): histogram2d.for
     106        $(F2PY) -c histogram2d.for -m histogram2d $(COMPILER)
     107        $(MOVE) histogram2d.$(SUFFIX) $(BIN)
     108        $(DEL) histogram2d.$(SUFFIX)
     109
     110$(BIN)/pyspg.$(SUFFIX): pyspg.for $(SYMLIB)
    86111        $(F2PY) -c pyspg.for $(SYMLIB) -m pyspg $(COMPILER)
    87 #       $(MACFIX) /usr/local/lib/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib pyspg.$(SUFFIX)
    88 #       $(MACCOPY) /usr/local/lib/libgcc_s.1.dylib $(BIN)
    89 #       $(MACFIX) /usr/local/lib/libgfortran.2.dylib @loader_path/libgfortran.2.dylib pyspg.$(SUFFIX)
    90 #       $(MACCOPY) /usr/local/lib/libgfortran.2.dylib $(BIN)
    91112        $(MOVE) pyspg.$(SUFFIX) $(BIN)
    92113        $(DEL) pyspg.$(SUFFIX)
    93114
    94 $(BIN)/polymask.$(SUFFIX): polymask.for $(SYMLIB) $(BIN)
    95         $(F2PY) -c polymask.for -m polymask $(COMPILER)
    96 #       $(MACFIX) /usr/local/lib/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib polymask.$(SUFFIX)
    97 #       $(MACCOPY) /usr/local/lib/libgcc_s.1.dylib $(BIN)
    98 #       $(MACFIX) /usr/local/lib/libgfortran.2.dylib @loader_path/libgfortran.2.dylib polymask.$(SUFFIX)
    99 #       $(MACCOPY) /usr/local/lib/libgfortran.2.dylib $(BIN)
    100         $(MOVE) polymask.$(SUFFIX) $(BIN)
    101         $(DEL) polymask.$(SUFFIX)
    102 
    103 $(BIN)/histogram2d.$(SUFFIX): histogram2d.for $(SYMLIB) $(BIN)
    104         $(F2PY) -c histogram2d.for -m histogram2d $(COMPILER)
    105 #       $(MACFIX) /usr/local/lib/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib histogram2d.$(SUFFIX)
    106 #       $(MACCOPY) /usr/local/lib/libgcc_s.1.dylib $(BIN)
    107 #       $(MACFIX) /usr/local/lib/libgfortran.2.dylib @loader_path/libgfortran.2.dylib histogram2d.$(SUFFIX)
    108 #       $(MACCOPY) /usr/local/lib/libgfortran.2.dylib $(BIN)
    109         $(MOVE) histogram2d.$(SUFFIX) $(BIN)
    110         $(DEL) histogram2d.$(SUFFIX)
     115$(BIN)/pytexture.$(SUFFIX): $(TXTLIB)
     116        $(F2PY) -c $(TXTLIB) -m pytexture $(COMPILER)
     117        $(MOVE) pytexture.$(SUFFIX) $(BIN)
     118        $(DEL) pytexture.$(SUFFIX)
    111119
    112120
     
    114122# $(BIN)/?????.$(SUFFIX): ?????.for $(SYMLIB) $(BIN)
    115123#       $(F2PY) -c ?????.for -m ????? $(COMPILER)
    116 #       $(MACFIX) /usr/local/lib/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib ?????.$(SUFFIX)
    117 #       $(MACCOPY) /usr/local/lib/libgcc_s.1.dylib $(BIN)
    118 #       $(MACFIX) /usr/local/lib/libgfortran.2.dylib @loader_path/libgfortran.2.dylib ?????.$(SUFFIX)
    119 #       $(MACCOPY) /usr/local/lib/libgfortran.2.dylib $(BIN)
    120124#       $(MOVE) ?????.$(SUFFIX) $(BIN)
    121125#       $(DEL) ?????.$(SUFFIX)
     
    123127clean:
    124128        $(RM) $(LIBS)
    125 
    126 # no longer in use
    127 #$(BIN)/fitellipse.$(SUFFIX): fitellipse.for
    128 #       cd $(BIN); $(F2PY) -c ../fitellipse.for -m fitellipse --fcompiler=gfortran --f90exec=/usr/local/bin/gfortran --f77flags="-fno-range-check"
    129 
    130 
  • trunk/fsource/texturesubs/qlmn.for

    r305 r315  
    6262          END IF
    6363        END DO
    64         Q = SUM/2.0**L
     64        Q = SUM/2.**(1.*L)
    6565        IF ( MOD(LMN,2).NE.0 ) Q = -Q
    6666!       PRINT '(A,3I4,F12.8)',' l,m,n,Q(lmn)',L,M,N,Q     
  • trunk/fsource/texturesubs/qlmninit.for

    r313 r315  
    4545              END IF
    4646            END DO
    47             QT(J) = SUM/2.0**L
     47            QT(J) = SUM/2.**(1.*L)
    4848            IF ( MOD(LMN,2).NE.0 ) QT(J) = -QT(J)
    4949!            PRINT '(A,3I4,F12.8)',' l,m,n,Q(lmn)',L,M,N,QT(J)
Note: See TracChangeset for help on using the changeset viewer.