Skip to content

Commit

Permalink
More build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pbienst committed Jul 18, 2007
1 parent 3319fa0 commit fd24cc7
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 79 deletions.
3 changes: 1 addition & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-cvs new files: examples, figs, python code (double check)

-document photonic wire, plot example of BlochStack, Cavity
-document BlochSection
-document band diagrams
Expand All @@ -9,6 +7,7 @@
-example with scipy.io.write_array(outfile, P_TM)

-testsuite for oleds
-PhC splitter in testsuite
-what to do with code for grating at the substrate side?

-T scheme when S scheme fails due to resonance?
Expand Down
51 changes: 37 additions & 14 deletions machine_cfg.py.gentoo
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# This Python script contains all the machine dependent settings
# needed during the build process.

# Get compiler flags from Gentoo's /etc/make.conf.
import popen2, os

import popen2
# Get compiler flags from Gentoo's /etc/make.conf.

r, w = popen2.popen2("source /etc/make.conf ; echo $CXXFLAGS")
r, w = popen2.popen2("source /etc/make.conf ; echo $CFLAGS")
CXXFLAGS = r.readline().strip()
r.close()
w.close()

# For gcc 4.2.1, filter the flags a bit.

if "pentium-m" in CXXFLAGS or "pentium4" in CXXFLAGS:
CXXFLAGS = CXXFLAGS.replace("-O3", "-O2")

# Compilers to be used.

cc = "gcc"
cxx = "g++"
f77 = "g77"

link = cxx
link_flags = ""
f77 = "gfortran -fPIC" # Workaround for scons bug.

# Compiler flags.
#
Expand All @@ -28,24 +30,45 @@ link_flags = ""
# FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE
# FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES

base_flags = "-ftemplate-depth-60 \
-DFORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE -DNDEBUG"
base_flags = "-DFORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE -DNDEBUG "

flags_noopt = base_flags

flags = base_flags + " " + CXXFLAGS
fflags = flags

fflags = flags + " -fPIC "

# Linker and linker flags to be used.

link = cxx
link_flags = ""

# Include directories.

include_dirs = ["/usr/include/python2.2"]
include_dirs = []

if os.path.isdir("/usr/include/python2.5"):
include_dirs.append("/usr/include/python2.5")
include_dirs.append("/usr/lib/python2.5/site-packages")
elif os.path.isdir("/usr/include/python2.4"):
include_dirs.append("/usr/include/python2.4")
include_dirs.append("/usr/lib/python2.4/site-packages")
elif os.path.isdir("/usr/include/python2.3"):
include_dirs.append("/usr/include/python2.3")
include_dirs.append("/usr/lib/python2.3/site-packages")
else:
print "Python dir not found!"
sys.exit()

# Library directories.

library_dirs = [""]
library_dirs = []
#library_dirs = ["/opt/intel/mkl8/lib/32"]

# Library names.

libs = ["boost_python", "blitz", "lapack", "blas", "g2c"]
libs = ["boost_python", "blitz", "lapack", "blas", "gfortran"]
#libs = ["boost_python", "blitz", "mkl_lapack64", "mkl", "gfortran"]

# Command to strip library of excess symbols:

Expand All @@ -54,4 +77,4 @@ strip_command = "strip --strip-unneeded camfr/_camfr" + dllsuffix

# Extra files to copy into installation directory.

extra_files = []
extra_files = [("doc", ["docs/camfr.pdf"])]
59 changes: 0 additions & 59 deletions machine_cfg.py.gentoo.amd64

This file was deleted.

7 changes: 4 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ install:
python setup.py install

test: FORCE
cd testsuite
make
cd testsuite ; make

distrib:
rm -f *.tgz Exclude
Expand All @@ -16,12 +15,14 @@ distrib:
cp -r * ../camfr_dist
mv ../camfr_dist .
cd camfr_dist ; make clean
rm camfr_dist/machine_cfg.py camfr_dist/TODO
rm -r camfr_dist/visualisation/examples
rm -r camfr_dist/docs/*
cp docs/camfr.pdf camfr_dist/docs
V=`python camfrversion.py` && mv camfr_dist camfr_$${V}
V=`python camfrversion.py` && find camfr_$${V} -type d -print | egrep '/,|%$$|~$$|CVS|build' > Exclude
V=`python camfrversion.py` && find camfr_$${V} ! -type d -print | egrep '/,|%$$|\#|~$$|dblite|pyc|\.old$$|/core$$|\.orig$$' >> Exclude
V=`python camfrversion.py` && tar cvfzX camfr_$${V}.tgz Exclude camfr_$${V}
V=`python camfrversion.py` && tar cvfzX camfr-$${V}.tgz Exclude camfr_$${V}
V=`python camfrversion.py` && rm -r camfr_$${V}
rm -f Exclude

Expand Down
3 changes: 2 additions & 1 deletion testsuite/camfr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

alltests = unittest.TestSuite((blazed_grating.suite, substacks.suite,
planarTE.suite, planarTM.suite, VCSEL.suite, SpE.suite, fw_bw.suite,
PhC_splitter.suite, expressions.suite, coupled.suite, slab.suite,
#PhC_splitter.suite,
expressions.suite, coupled.suite, slab.suite,
cladding.suite, grating.suite, degenerate.suite, stack0.suite,
precision.suite, infstack.suite, taper.suite, rods.suite, wg.suite,
TEM_field.suite, grating2.suite, polariton.suite, gaussian.suite,
Expand Down

0 comments on commit fd24cc7

Please sign in to comment.