Giter Club home page Giter Club logo

s4's Introduction

S4: Stanford Stratified Structure Solver (http://fan.group.stanford.edu/S4/)

A program for computing electromagnetic fields in periodic, layered
structures, developed by Victor Liu ([email protected]) of the
Fan group in the Stanford Electrical Engineering Department.

See the S4 manual, in doc/index.html, for a complete
description of the package and its user interface, as well as
installation instructions, the license and copyright, contact
addresses, and other important information.

s4's People

Contributors

gevero avatar jrpiper avatar sbyrnes321 avatar selvanair avatar victorliu avatar wgtdkp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s4's Issues

a lot of unused

if i compile the program with "make" on a linux mint machine. i get a lot of warnings

S4/S4.cpp: In function ‘int Simulation_GetFieldPlane(S4_Simulation*, int*, double, double*, double*)’:
S4/S4.cpp:2824:24: warning: unused variable ‘work’ [-Wunused-variable]
  std::complex<double> *work = ab + n4;

also some functionality appears to be not included, or outdated.

i own a multi-core processor, but i cannot compile support for that.
any suggestions?

Visual Studio Code support

Hi,
could you help to configure current Lua debugger to work with S4 in Visual Studio Code?

thank you,
Igor.

Effective Refractive Index

Hi Guys,

Apologies if this is a silly question. I am looking to calculate the effective refractive index of a given layer in my structure. Before writing the code to use normalised fields and the refractive index at each point in the lattice I was wondering if there is a command within S4 which I can use to make this calculation for me.

Any help would be appreciated.
Brian

Band structure calculation

Any example on this topic? Actually, I am confused about omega in eq.(28), does the band structure depend on incident frequency?

python API installation

I get the following error while trying to import the library

/usr/local/lib/python2.7/dist-packages/S4.so: undefined symbol: zgelss_

how to install?!?!

since the configure file is missing, as a full beginner I even cannt install S4 in my mac osx. Is there a detailed guide? or someone help me?

How to run "function" examples?

I can run some examples by s4 fig1.lua. But for many examples like 1d\Bi_OE_18_11969_2010, I get error get poyntingflux: numg was not set

Executions on Linux and Windows/Mac yield different results

When running the same script on different platforms, I get different results. These are the results I get:
Mac OS (source): result A (fast)
Mac OS (binary from web): result A (fast)
Windows (binary from web): result A (slow)
Linux (source): result B (reasonably fast)

Result A:

jan-macbook:S4 janlugt$ ./S4 S4-1.1.1-doc/examples/Suh_APL_82_1999_2003/fig2a.lua 
0.49    0.92800488145426    -0.07199511854574
0.493   0.94669225987763    -0.053307740122362
0.496   0.96897862176784    -0.031021378232163
0.499   0.98968013741848    -0.010319862581519
0.502   0.99996935332514    -3.0646674865573e-05
[...]

Result B:

solar@solarvm:~/S4$ build/S4 examples/Suh_APL_82_1999_2003/fig2a.lua
0.49       0.98907646230904           -0.010923537690945
0.493     0.98137361761409           -0.018626382385923
0.496     0.98593625883527           -0.014063741164738
0.499     0.99539469060946           -0.0046053093905425
0.502     0.99982408408896           -0.00017591591103507
[...]

On Linux, I have used both OpenBLAS and regular Netlib BLAS/Lapack, with the same results. Other dependencies used were FFTW 3 and libsuitesparse.

Thanks in advance for looking into this, we're now limited to running simulations on laptops, while we have a very fast server that we'd like to utilize for these simulations, but this issue is blocking us from using it.

Multi-threaded execution

I am running S4 with python interface on an 64 cores opteron box. Independently of the compilation flags I use to build the software (I tried many) S4 always runs on all the available cores, while I would like the option of a serial run. I should I proceed?

Best

Giovanni

Python 3 extension segmentation fault

After installing the module using 'python3 setup.py build', attempts to import the module cause the python3 interpreter to crash with a segmentation fault. The python2 module works fine.

[Problems with installation] c99

I had some problems with installation. When I compiled python module there were some errors with gcc:
use option -std=c99 or -std=gnu99 to compile your code
I add in the python install scrypt these lines:

S4module = Extension('S4',
..............................................
library_dirs = ['$OBJDIR'],
extra_compile_args = ['-std=c99']
)

This work for me. I think it will be useful for someone.

Thx for watching.

Any compiled binary edition of S4 (S4.exe)?

Hi all,

Can someone send me a latest compile binary edition of S4 (S4.exe) with FFTW3 and other features? Well, I am totally freshman with Lua and don't know how to configure and compile the exe files by my myself.

My email address is [email protected].

Thank you very much

Samson

pthread flags in the Makefile are not really correct

The Makefile recommends the following pthread flags

#  PTHREAD_INC = -DHAVE_UNISTD_H -lpthread
#  PTHREAD_LIB = -lpthread

Some problems with this:

  • -lpthread is a linker flag, not a compilation or preprocessor flag, so it doesn't make sense to include it in PTHREAD_INC.
  • With gcc, my understanding is that the correct flag is -pthread, for both compiling and linking (i.e. it should be in both PTHREAD_INC and PTHREAD_LIB). It causes -lpthread to be linked, but also defines -D_REENTRANT in order that you use re-entrant versions of libc functions. (There used to be a much wider variety of options, but nowadays the other platforms have mostly died off.)
  • -DHAVE_UNISTD_H doesn't really have anything to do with pthreads; unistd.h is available on any POSIX system (nowadays, any non-Windows system) these days, and HAVE_UNISTD_H is a carryover from your conversion from autoconf. (If you were going to switch to anything, I would have recommended cmake, but that's a different story.) Since you only check for this on non-Windows machines anyway, you should be able to just omit the check.

Problem with Python shared object

Hi!
I am running Arch linux, and am following the instructions to compile and install the python extension of S4. I clone the git repository, and run make, make S4_pyext, and python setup.py install. This gives me a .so file.
When I try to include it in a python script and then running it I get the following message:

ImportError: /usr/lib/python3.6/site-packages/S4.cpython-36m-x86_64-linux-gnu.so: undefined symbol: Layer_Init

The python script just tries to import S4:

import S4

That is the entirety of the script. Any suggestions are welcome!

lua.h file missing

I'm trying to install S4 on Ubuntu (15.10) and after ./configure went well, I get the following error when using make:

main.c:31:17: fatal error: lua.h: No such file or directory
#include <lua.h>
^
compilation terminated.
Makefile:674: recipe for target 'S4-main.o' failed
make[1]: *** [S4-main.o] Error 1
make[1]: Leaving directory '/home/giampaolo/Desktop/S4-1.0.0/src'
Makefile:212: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1

am I missing a lua.h file in the src folder? I have install lua and I think I have all the needed libraries.

Variable S4_LIBNAME not set in Makefile.common

When attempting to compile the Python extensions on Ubuntu 16.04 using the following command:

make S4_pyext

The following error occurs:

x86_64-linux-gnu-gcc: error: No such file or directory

Thiserror message is misleading. x86_64-linux-gnu-gcc exists and is upset because its being supplied the variable $S4_LIBNAME, which is empty. Not sure what this variable is supposed to be set to, but setting it to the proper value should fix things.

configure: error: Couldn't find the required liblua5.1 library.

When running './configure' I get the following error:

checking for luaL_newstate in -llua5.1... no
configure: error: Couldn't find the required liblua5.1 library.

while my distro (gentoo linux) has lua5.1.5 installed
A workaround is to replace '-llua5.1' with '-llua' in the 'configure' file
It seem that the version number is causing the problem, use 'pkg-config' ?

Could not Make lib

I have lua 5.2.3 and and s4 documents and want to run s4 on linux. But when I use make lib I get the common error " no rule ...". should I do anything else before making lib?
tnx

Segmentation fault when using patterns

Hi,

I am using the code to model some silica nanopillars. The code works fine if I am not using any pattern but it returns segmentation fault when I use any pattern. I am using python extension. This is the code:
import S4
import numpy as np

S = S4.New(Lattice = ((.24,0),(0,.24)), NumBasis=100)

S.AddMaterial(Name='silicon',Epsilon = 12+0.01j)
S.AddMaterial(Name='vacuum',Epsilon = 1+0.00j)

S.AddLayer(Name = 'incidentMedium', Thickness = 0, Material = 'vacuum');
S.AddLayer(Name = 'pillar', Thickness = 0.120, Material = 'vacuum')

S.SetRegionRectangle('pillar', 'silicon', (0,0), 0, (0.021, 0.021))

S.AddLayer(Name = 'base', Thickness = 10e-3, Material = 'silicon')
S.AddLayer(Name = 'airBellow', Thickness = 0, Material = 'vacuum')

S.SetExcitationPlanewave(
IncidenceAngles = (0, 0),
pAmplitude = 1 + 0j,
sAmplitude = 0 + 0j
)

freq = np.linspace(2.5, 1.11111, 10);
for freqI in freq:
S.SetFrequency(freqI);
[tmp,reflection] = S.GetPowerFlux('incidentMedium', 0);
transmission = S.GetPoyntingFlux('airBellow',0);
print(abs(reflection)**2)

Am I doing something wrong?

Many thanks,
Dylan Marques

c++11 compatibility issues on MAC OSX

I experienced some compatibility issues with c++11 standard.

For successfull compilation the makefile make.custom needs to be adapted:

  • add compiler flag -Wno-c++11-narrowing
  • in all CC compiler statements remove the $(CFLAGS) variable

Change the angle of incidence

Hi everyone,

I am trying to use S4 to generate some reflection/transmission curves changing the angle of incidence. The code that I am using is the following one:
`
S = S4.NewSimulation()
S:SetLattice({0.24,0}, {0,0.24})
S:SetNumG(100)
S:AddMaterial("silicon", {30.847, 4.2994})
S:AddMaterial("vacuum", {1,0})
S:AddLayer('incidentMedium', 0 , 'vacuum')
S:AddLayer('base', 10e3, 'silicon')
S:AddLayer('bottom',0,'vacuum')

S:SetFrequency(1/0.4)

for thetaI=0,70,10 do
S:SetExcitationPlanewave({thetaI, 0 },{1,0}, {0,0})
incident, reflect = S:GetPowerFlux('incidentMedium',0)
print(thetaI .. '\t' .. -reflect/incident .. '\t' .. incident)
end
`

I have the respective output:
0 0.34997080849269 1
10 0.34997080849269 0.96984631039295
20 0.34997080849269 0.88302222155949
30 0.34997080849269 0.75
40 0.34997080849269 0.58682408883347
50 0.34997080849269 0.41317591116653
60 0.34997080849269 0.25
70 0.34997080849269 0.11697777844051

Which does not makes sense to me. Am I doing something wrong in my code?

I tried to find any example changing the angle of incidence but all examples are for normal incidence.

Many thanks,
Dylan Marques

Error Message: SetLayerPatternRectangle: There was a problem allocating the pattern

I installed it on my iMac 10.11.1. I got the following error when I run examples that include the code "S:SetLayerPatternRectangle(....)".

"SetLayerPatternRectangle: There was a problem allocating the pattern".

For instance, /examples/1d/Pietarinen_OE_14_2583_2006/fig2a.lua.

Looks like examples that don't include the code "S:SetLayerPatternRectangle(....)" run fine. For example, ../examples/simple/simple.lua and ../examples/2d/Fan_PRB_65_2002/fig12.lua.

Any help regarding how to solve this issue is appreciated!

Python API - function GetBasisSet() segmentation fault

The function GetBasisSet() dumps to a segmentation fault. Apparently is because the
function expect arguments. Modifying S4/main_python.c works.

In file S4/main_python.c:724

static PyObject *S4Sim_GetBasisSet(S4Sim *self){

and better if commented S4/main_python.c:728

//  if(!PyArg_ParseTuple(args, ":GetBasisSet")){ return NULL; }

S4 Python API not ported to python3 properly

Seems like there are a few issues with using the S4 library in python3 (specifically 3.4, but likely all python3.x). Seems like the compilation issues come mostly from the PyString and PyInt calls. Seems like it might be a quick fix to main_python.c if someone really wants to use python3 (i think just change PyString_* to PyUnicode_* or PyBytes_* and PyInt_* to PyLong_*, i forked to give this a try one day, but really py3c should be used for bidirectional compatibility between python2<->python3.3+), but i'll stick with 2.7 for now probably
Error Below:
>>> import S4 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /usr/lib64/python3.4/site-packages/S4.cpython-34m.so: undefined symbol: PyString_AsStringAndSize

Extra output in GetEpsilon

Apparently there is a line (S4.cpp:2403) in Simulation_GetEpsilon which generates a huge output without a clear purpose:

printf("g = %d, ft = %g, %g\n", g, ft[0], ft[1]);

Better if commented.

Dipole Excitation

Looking at the code I saw that there is a command.
SetExcitationDipole
Which is undocumented.
I would like to ask if this is a fully implemented function and whether it is tested.

I am working on this problem, so I will make my own tests. But I would like to know for convenience

Python Extension ImportError on latest commit

Everything compiles fine on the latest commit. However, when attempting to import the installed python module from a python 2.7 interpreter yields:

ImportError: /usr/local/lib/python2.7/dist-packages/S4.so: undefined symbol: Simulation_MakeExcitationExterior

This seems to be defined in S4_internal.h, and looks like a new C API feature in the latest commit. So perhaps this has not yet been added to the python extension?

Interpolator example is not working with lua5.2 nor lua5.3

Similar to issue 49 whith lua5.2:

On Ubuntu14.04, with liblua5.2-dev installed,

~/dev/S4/examples/interpolator$ ../../build/S4 interpolator.lua 
interpolator.lua:9: attempt to index global 'interpolator' (a userdata value)
stack traceback:
        interpolator.lua:9: in main chunk
~/dev/S4/examples/interpolator$ ldd ../../build/S4
        linux-vdso.so.1 =>  (0x00007ffe5a7fa000)
        liblua5.2.so.0 => /usr/lib/x86_64-linux-gnu/liblua5.2.so.0 (0x00007f46f4d72000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f46f4a5f000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f46f4758000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f46f4390000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f46f418c000)
        /lib64/ld-linux-x86-64.so.2 (0x000055eb0fbf6000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f46f3f74000)

with exactly the same error on ubuntu 17.04 and lua5.3.

Segmentation fault due to material misspelling

I have noticed that using the python interface, the script crashes returning a segmentation fault if the materials defining the layers do not have correspondence with any defined material.

It would be nice to introduce a checking at some point, because it is quite puzzling.

Python module build directory

There is a very small problem in the Makefile if someone changes the OBJDIR from its default value. At the point of compiling the python module, setup.py will look for the default directory and not to the OBJDIR. To fix it just replace python setup.py build by python setup.py build --build-base $(OBJDIR)

Makefile calls for Makefile.common

Makefile calls for Makefile.common which does not exist in the repo. What was intended to be in there? The parts of Makefile.old below the "do not change line" I will guess and report back with results.

Latest commit breaks Python extension

It seems that some of the new implementations of the C functions break the python extension in python 2.7. I am getting these errors, which seem critical, and will try to track them down:

S4/main_python.c: In function ‘S4Sim_new’:
    S4/main_python.c:620:3: error: too few arguments to function ‘Simulation_Init’
       Simulation_Init(&(self->S));
       ^
    In file included from S4/main_python.c:37:0:
    S4/S4.h:239:6: note: declared here
     void Simulation_Init(Simulation *S, const double *Lr, unsigned int nG, int *G);
          ^
    S4/main_python.c: In function ‘S4SpectrumSampler_GetFrequencies’:
    S4/main_python.c:1700:51: warning: passing argument 2 of ‘SpectrumSampler_GetFrequencies’ from incompatible pointer type [-Wincompatible-pointer-types]
      nf = SpectrumSampler_GetFrequencies(self->SpecS, &freqs);
                                                       ^
    In file included from S4/main_python.c:39:0:
    S4/SpectrumSampler.h:41:5: note: expected ‘const double **’ but argument is of type ‘double **’
     int SpectrumSampler_GetFrequencies(const SpectrumSampler sampler, const double **freqs);
         ^
    S4/main_python.c: In function ‘S4_SolveInParallel’:
    S4/main_python.c:1993:14: warning: unused variable ‘layerName’ [-Wunused-variable]
      const char *layerName;
                  ^
    S4/main_python.c:1992:15: warning: unused variable ‘kwlist’ [-Wunused-variable]
      static char *kwlist[] = {"Layer", "Simulations", NULL};
                   ^
    S4/main_python.c: At top level:
    S4/main_python.c:659:18: warning: ‘S4Sim_ConvertUnits’ defined but not used [-Wunused-function]
     static PyObject *S4Sim_ConvertUnits(S4Sim *self, PyObject *args)
                      ^
    error: command 'gcc' failed with exit status 1

    ----------------------------------------

RHEL6 build fail sampler example

Hello,

Not sure if this is the appropriate place but I could not find any link for requesting help. I built S4 for RHEL6 but it's giving errors (see below). I could run many of the other examples fine. Would someone do a build of the latest source and test the examples below to verify that all is legit in the repo? Also, the INSTALL mentioned a configure script; can this be added to the repo? I customized the Makefile.Linux for my build. Thanks.

-bash-4.1$ S4  sampler.lua
sampler.lua:40: attempt to index a userdata value (global 'sampler')
stack traceback:
	sampler.lua:40: in main chunk
-bash-4.1$
-bash-4.1$ S4  interpolator.lua
interpolator.lua:9: attempt to index a userdata value (global 'interpolator')
stack traceback:
	interpolator.lua:9: in main chunk
-bash-4.1$
-bash-4.1$ pwd
/data/pkg/S4/S4/examples/magneto
-bash-4.1$ S4 slab.lua
slab.lua:83: unexpected symbol near ']'
-bash-4.1$

Compiling against lua 5.3 limits functionality

S4 seems to compile fine against lua-5.3, but some functionality is lost. Specifically, calling the Interpolator (or the SpectrumSampler) object gives the following errors (using the lua files in the "examples" dir)

interpolator.lua:9: attempt to index a userdata value (global 'interpolator')
stack traceback:
interpolator.lua:9: in main chunk

sampler.lua:40: attempt to index a userdata value (global 'sampler')
stack traceback:
sampler.lua:40: in main chunk

Lua 5.2 is no longer available on some linux distros (e.g. Fedora): is there a workaround for this?

ISO C90 forbids mixed declarations and code

When compiling S4_pyext on manjaro linux x86_64 box with gcc 4.9.1 the following errors, prompted from the -Werror=declaration-after-statement are thrown:

S4/main_python.c:1160:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
const char *lattice_truncation = NULL;

and

S4/main_python.c:1362:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
struct module_state *st = GETSTATE(m);

the solution I found is to prepend CFLAGS="-std=c99" to the line python setup.py build in order to relax the C90 standards. Is this correct?

Best

Giovanni

confusing units discussion in the manual

The manual says:

  • When the lattice vectors are set, this determines a length scale. Suppose we have a square lattice with a periodicity of 680nm. It might be logical then to choose 1 micron as the base length unit, and to specify all lengths in microns. The lattice would then be set to the vectors (0.68, 0) and (0, 0.68). Since frequency is in units of inverse length, then SetFrequency(1) corresponds to a wavelength of 680nm or a physical frequency of (c/680nm) = 441 THz, and SetFrequency(1.1) corresponds to a wavelength of (680/1.1) = 618nm, etc.

However, if you choose units as µm and set the lattice period to 0.68 (that is, 0.68µm), then doesn't SetFrequency(1) set the wavelength to 1µm/1 = 1000nm, not 680nm?

That is, isn't the frequency set relative to the choice of distance units, not relative to the period per se? We have checked S4's behavior against analytical calculations and it seems to match our understanding.

Energies don't add up with UsePolarizationDecomposition

With UsePolarizationDecomposition(), I often get the situation where reflected plus transmitted power is significantly different (higher or lower) than incident power, even though the structure is purely dielectric so there shouldn't be any loss or gain. Here is an example:

S = S4.NewSimulation()

S:SetLattice({0.7,0}, {0, 0.3})
S:SetNumG(50)
S:AddMaterial("Glass", {1.5^2,0})
S:AddMaterial("Air", {1,0})

S:AddLayer('Substrate', 0, 'Glass')
S:AddLayer('PatternLayer', 0.3, 'Air')
S:AddLayer('Air', 0, 'Air')

--S:SetLayerPatternEllipse(layer, material, center, angle, halfwidths)
S:SetLayerPatternEllipse('PatternLayer', 'Glass', {.45,0}, 0, {0.2,0.2})

--S:SetLayerPatternPolygon(layer, material, center, angle, vertices)
S:SetLayerPatternPolygon('PatternLayer', 'Glass', {0,0}, 0, {0,0,  0.2,0,  0.2,0.2,  0,0.2})

S:SetFrequency(2)

S:SetExcitationPlanewave(
    {0,0},  -- incidence angles (spherical coordinates: phi in [0,180], theta in [0,360])
    {1,0},  -- s-polarization amplitude and phase (in degrees)
    {1,0}) -- p-polarization amplitude and phase

S:UsePolarizationDecomposition()

incident_power, total_reflected_power = S:GetPowerFlux('Substrate', 0)
total_transmitted_power, this_should_be_zero = S:GetPowerFlux('Air', 0)
assert(this_should_be_zero == 0) -- this part works fine

print('total reflected power:', total_reflected_power)
print('total transmitted power', total_transmitted_power)
print('total reflected plus transmitted power:', math.abs(total_reflected_power) + math.abs(total_transmitted_power))
print('...whereas the incident power is:', incident_power)

Then the output (using the Windows .exe) is:

total reflected power:  -0.11690432308553
total transmitted power 1.4025400903532
total reflected plus transmitted power: 1.5194444134387
...whereas the incident power is:       1.3333333333333

If I understand correctly, the last two lines should be equal. Indeed, if I remove the UsePolarizationDecomposition line, then they are truly equal down to the last decimal point:

.......UsePolarizationDecomposition turned off.......
total reflected power:  -0.059337095586464
total transmitted power 1.2739962377469
total reflected plus transmitted power: 1.3333333333333
...whereas the incident power is:       1.3333333333333

Do you agree? Thanks so much for your hard and generous work, and thanks in advance for your help here. :-D

S.GetEpsilon varies from run to run

When I run S.GetEpsilon, often it is a nice fourier-series approximation of my actual epsilon as expected: (Blue is input epsilon, green is from S.GetEpsilon.)

example that works

...but more often it is weirdly scaled and shifted:

example that did not work

It randomly varies from run to run!!! Isn't that weird?

I compiled from source, but this happens whether or not I use FFTW, or BLAS, or LAPACK, or leave PTHREAD_LIB blank. So I don't think it's a threading-related error, although I'm no expert.

I haven't tried this in the lua frontend, only python.

Code:

from __future__ import division, print_function

import matplotlib.pyplot as plt
import numpy as np

import S4

period = 1.
s = 0.6*period #grating bar width
a = 0.4*period
eBar=10.234
thickness = 0.63*period #HCG thickness
lam_vac = 1.3*period #incident wavelength

S = S4.New(Lattice=period, NumBasis=100)

S.SetMaterial(Name = 'mymaterial', Epsilon = eBar)
S.SetMaterial(Name = 'Vacuum', Epsilon = 1)

S.AddLayer(Name='AirAbove', Thickness=0, Material='Vacuum')
S.AddLayer(Name='grating', Thickness=thickness, Material='Vacuum')
S.AddLayerCopy(Name='AirBelow', Thickness=0, Layer='AirAbove')

S.SetRegionRectangle(Layer='grating', Material='mymaterial', Center=(0,0), Angle=0, Halfwidths=(s/2,1))

S.SetExcitationPlanewave(IncidenceAngles=(0,0), sAmplitude = 1,
                         pAmplitude = 0, Order = 0)

S.SetFrequency(lam_vac)

xlist = np.linspace(-period/2, period/2, num=200)
zlist = np.linspace(-0.5*thickness, 1.5*thickness, num=3)
plt.figure()
plt.plot(xlist, [eBar if abs(x)<s/2 else 1 for x in xlist])
plt.plot(xlist, [S.GetEpsilon(x,0,thickness/2).real for x in xlist])

and the makefile is

BLAS_LIB = 
LAPACK_LIB = 
LUA_INC = -I/usr/include/lua5.2
LUA_LIB = -llua5.2 -ldl -lm
FFTW3_INC =
FFTW3_LIB = 
PTHREAD_INC = 
PTHREAD_LIB = 
CHOLMOD_INC = 
CHOLMOD_LIB = 
MPI_INC =
MPI_LIB =
CXX = g++
CC  = gcc
CFLAGS += -O3 -fPIC

but again, I get the same error with other makefiles I've tried.

make S4_pyext not working

An error with 'clang' is preventing me from installing the python extension when I use the command "make S4_pyext" after successfully using 'make' to install S4.
Thank you for your help!


$ make S4_pyext

mkdir -p ./build
mkdir -p ./build/S4k
mkdir -p ./build/S4r
mkdir -p ./build/modules
ar crvs build/libS4.a ./build/S4k/S4.o ./build/S4k/rcwa.o ./build/S4k/fmm_common.o ./build/S4k/fmm_FFT.o ./build/S4k/fmm_kottke.o ./build/S4k/fmm_closed.o ./build/S4k/fmm_PolBasisNV.o ./build/S4k/fmm_PolBasisVL.o ./build/S4k/fmm_PolBasisJones.o ./build/S4k/fmm_experimental.o ./build/S4k/fft_iface.o ./build/S4k/pattern.o ./build/S4k/intersection.o ./build/S4k/predicates.o ./build/S4k/numalloc.o ./build/S4k/gsel.o ./build/S4k/sort.o ./build/S4k/kiss_fft.o ./build/S4k/kiss_fftnd.o ./build/S4k/SpectrumSampler.o ./build/S4k/cubature.o ./build/S4k/Interpolator.o ./build/S4k/convert.o
r - ./build/S4k/S4.o
r - ./build/S4k/rcwa.o
r - ./build/S4k/fmm_common.o
r - ./build/S4k/fmm_FFT.o
r - ./build/S4k/fmm_kottke.o
r - ./build/S4k/fmm_closed.o
r - ./build/S4k/fmm_PolBasisNV.o
r - ./build/S4k/fmm_PolBasisVL.o
r - ./build/S4k/fmm_PolBasisJones.o
r - ./build/S4k/fmm_experimental.o
r - ./build/S4k/fft_iface.o
r - ./build/S4k/pattern.o
r - ./build/S4k/intersection.o
r - ./build/S4k/predicates.o
r - ./build/S4k/numalloc.o
r - ./build/S4k/gsel.o
r - ./build/S4k/sort.o
r - ./build/S4k/kiss_fft.o
r - ./build/S4k/kiss_fftnd.o
r - ./build/S4k/SpectrumSampler.o
r - ./build/S4k/cubature.o
r - ./build/S4k/Interpolator.o
r - ./build/S4k/convert.o
echo "-framework vecLib -framework vecLib -lfftw3 -lpthread " > ./build/tmp.txt
sh gensetup.py.sh ./build ./build/libS4.a
python setup.py build
running build
running build_ext
building 'S4' extension
creating build/temp.macosx-10.10-x86_64-2.7
creating build/temp.macosx-10.10-x86_64-2.7/S4
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c S4/main_python.c -o build/temp.macosx-10.10-x86_64-2.7/S4/main_python.o
S4/main_python.c:661:2: error: function declared in block scope cannot have 'static'
storage class
static PyObject S4Sim_SetMaterial(S4Sim *self, PyObject *args, PyObject *kwds);
^
S4/main_python.c:677:18: error: static declaration of 'S4Sim_SetMaterial' follows
non-static declaration
static PyObject *S4Sim_SetMaterial(S4Sim *self, PyObject *args, PyObject *kwds){
^
S4/main_python.c:661:19: note: previous declaration is here
static PyObject *S4Sim_SetMaterial(S4Sim *self, PyObject *args, PyObject *kwds);
^
S4/main_python.c:748:20: warning: assigning to 'char *' from 'const char *' discards
qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
layer->material = material;
^ ~~~~~~~~
S4/main_python.c:1701:51: warning: passing 'double *
' to parameter of type
'const double *_' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]
nf = SpectrumSampler_GetFrequencies(self->SpecS, &freqs);
^~~~~~
S4/SpectrumSampler.h:41:82: note: passing argument to parameter 'freqs' here
int SpectrumSampler_GetFrequencies(const SpectrumSampler sampler, const double *_freqs);
^
S4/main_python.c:1790:35: error: use of undeclared identifier 'S4Sim_SetMaterial'
{"SetMaterial" , (PyCFunction)S4Sim_SetMaterial, ...
^
S4/main_python.c:1818:33: error: use of undeclared identifier 'S4Sim_GetEField'
{"GetEField" , (PyCFunction)S4Sim_GetEField, ME...
^
S4/main_python.c:1819:33: error: use of undeclared identifier 'S4Sim_GetHField'
{"GetHField" , (PyCFunction)S4Sim_GetHField, ME...
^
S4/main_python.c:1823:41: error: use of undeclared identifier 'S4Sim_GetDiffractionOrder'
{"GetDiffractionOrder" , (PyCFunction)S4Sim_GetDiffractionOrder, ...
^
S4/main_python.c:1827:33: error: use of undeclared identifier 'S4Sim_GetGList'
{"GetGList" , (PyCFunction)S4Sim_GetGL...
^
S4/main_python.c:1828:32: error: use of undeclared identifier 'S4Sim_GetNumG'
{"GetNumG" , (PyCFunction)S4Sim_GetNu...
^
S4/main_python.c:1830:44: error: use of undeclared identifier
'S4Sim_SetBasisFieldDumpPrefix'
{"SetBasisFieldDumpPrefix" , (PyCFunction)S4Sim_SetBasisFieldDumpPref...
^
S4/main_python.c:1831:42: error: use of undeclared identifier 'S4Sim_SetLatticeTruncation'
{"SetLatticeTruncation" , (PyCFunction)S4Sim_SetLatticeTruncation...
^
S4/main_python.c:1985:15: warning: unused variable 'kwlist' [-Wunused-variable]
static char *kwlist[] = {"Layer", "Simulations", NULL};
^
S4/main_python.c:1986:14: warning: unused variable 'layerName' [-Wunused-variable]
const char *layerName;
^
4 warnings and 10 errors generated.
error: command 'clang' failed with exit status 1

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 when install on ubuntu14

Hi, I need help for installing S4 as a Python extension on ubuntu14.04 LTS 64-bit system. I got a few errors like this one:

error: ‘for’ loop initial declarations are only allowed in C99 mode

And it fails with this message:

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [S4_pyext] Error 1

Does anyone have any comments on how to fix this problem? Thanks a lot.


The whole output is below:

mkdir -p ./build
mkdir -p ./build/S4k
mkdir -p ./build/S4r
mkdir -p ./build/modules
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/S4.cpp -o build/S4k/S4.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/rcwa.cpp -o build/S4k/rcwa.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_common.cpp -o build/S4k/fmm_common.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_FFT.cpp -o build/S4k/fmm_FFT.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_kottke.cpp -o build/S4k/fmm_kottke.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_closed.cpp -o build/S4k/fmm_closed.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_PolBasisNV.cpp -o build/S4k/fmm_PolBasisNV.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_PolBasisVL.cpp -o build/S4k/fmm_PolBasisVL.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_PolBasisJones.cpp -o build/S4k/fmm_PolBasisJones.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fmm_experimental.cpp -o build/S4k/fmm_experimental.o
g++ -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/fmm/fft_iface.cpp -o build/S4k/fft_iface.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/pattern/pattern.c -o build/S4k/pattern.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/pattern/intersection.c -o build/S4k/intersection.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/pattern/predicates.c -o build/S4k/predicates.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/numalloc.c -o build/S4k/numalloc.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/gsel.c -o build/S4k/gsel.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/sort.c -o build/S4k/sort.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/kiss_fft/kiss_fft.c -o build/S4k/kiss_fft.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/kiss_fft/tools/kiss_fftnd.c -o build/S4k/kiss_fftnd.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/SpectrumSampler.c -o build/S4k/SpectrumSampler.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/cubature.c -o build/S4k/cubature.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/Interpolator.c -o build/S4k/Interpolator.o
gcc -c -O3 -msse3 -msse2 -msse -fPIC -I. -IS4 -IS4/RNP -IS4/kiss_fft -DHAVE_BLAS -DHAVE_LAPACK -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H S4/convert.c -o build/S4k/convert.o
ar crvs build/libS4.a ./build/S4k/S4.o ./build/S4k/rcwa.o ./build/S4k/fmm_common.o ./build/S4k/fmm_FFT.o ./build/S4k/fmm_kottke.o ./build/S4k/fmm_closed.o ./build/S4k/fmm_PolBasisNV.o ./build/S4k/fmm_PolBasisVL.o ./build/S4k/fmm_PolBasisJones.o ./build/S4k/fmm_experimental.o ./build/S4k/fft_iface.o ./build/S4k/pattern.o ./build/S4k/intersection.o ./build/S4k/predicates.o ./build/S4k/numalloc.o ./build/S4k/gsel.o ./build/S4k/sort.o ./build/S4k/kiss_fft.o ./build/S4k/kiss_fftnd.o ./build/S4k/SpectrumSampler.o ./build/S4k/cubature.o ./build/S4k/Interpolator.o ./build/S4k/convert.o
a - ./build/S4k/S4.o
a - ./build/S4k/rcwa.o
a - ./build/S4k/fmm_common.o
a - ./build/S4k/fmm_FFT.o
a - ./build/S4k/fmm_kottke.o
a - ./build/S4k/fmm_closed.o
a - ./build/S4k/fmm_PolBasisNV.o
a - ./build/S4k/fmm_PolBasisVL.o
a - ./build/S4k/fmm_PolBasisJones.o
a - ./build/S4k/fmm_experimental.o
a - ./build/S4k/fft_iface.o
a - ./build/S4k/pattern.o
a - ./build/S4k/intersection.o
a - ./build/S4k/predicates.o
a - ./build/S4k/numalloc.o
a - ./build/S4k/gsel.o
a - ./build/S4k/sort.o
a - ./build/S4k/kiss_fft.o
a - ./build/S4k/kiss_fftnd.o
a - ./build/S4k/SpectrumSampler.o
a - ./build/S4k/cubature.o
a - ./build/S4k/Interpolator.o
a - ./build/S4k/convert.o
echo "-lblas -llapack -lpthread " > ./build/tmp.txt
sh gensetup.py.sh ./build ./build/libS4.a
python setup.py build
running build
running build_ext
building 'S4' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/S4
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c S4/main_python.c -o build/temp.linux-x86_64-2.7/S4/main_python.o
S4/main_python.c: In function ‘excitation_converter’:
S4/main_python.c:323:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < data->n; i++)
^
S4/main_python.c:323:2: note: use option -std=c99 or -std=gnu99 to compile your code
S4/main_python.c: In function ‘interpolator_table_converter’:
S4/main_python.c:502:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0, ld = data->ny + 1; i < data->n; i++)
^
S4/main_python.c:523:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int j = 0; j < data->ny; j++)
^
S4/main_python.c: In function ‘S4Interpolator_Get’:
S4/main_python.c:579:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < ny; i++)
^
S4/main_python.c: In function ‘S4Sim_SetMaterial’:
S4/main_python.c:671:4: warning: assignment makes pointer from integer without a cast [enabled by default]
M = S4_Simulation_GetMaterialByName(self->S, name);
^
S4/main_python.c: In function ‘S4Sim_SetLayer’:
S4/main_python.c:741:20: warning: assignment makes integer from pointer without a cast [enabled by default]
layer->material = strdup(material);
^
S4/main_python.c: In function ‘S4Sim_SetRegionCircle’:
S4/main_python.c:816:10: warning: comparison between pointer and integer [enabled by default]
if(NULL != layer->copy){
^
S4/main_python.c: In function ‘S4Sim_SetRegionEllipse’:
S4/main_python.c:848:10: warning: comparison between pointer and integer [enabled by default]
if(NULL != layer->copy){
^
S4/main_python.c: In function ‘S4Sim_SetRegionRectangle’:
S4/main_python.c:880:10: warning: comparison between pointer and integer [enabled by default]
if(NULL != layer->copy){
^
S4/main_python.c: In function ‘S4Sim_SetRegionPolygon’:
S4/main_python.c:913:10: warning: comparison between pointer and integer [enabled by default]
if(NULL != layer->copy){
^
S4/main_python.c: In function ‘S4SpectrumSampler_GetFrequencies’:
S4/main_python.c:1696:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < nf; i++)
^
S4/main_python.c: In function ‘S4SpectrumSampler_SubmitResults’:
S4/main_python.c:1735:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < ny; i++)
^
S4/main_python.c: In function ‘S4SpectrumSampler_GetSpectrum’:
S4/main_python.c:1752:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i = 0; i < n; i++)
^
S4/main_python.c: In function ‘S4_SolveInParallel’:
S4/main_python.c:1987:14: warning: unused variable ‘layerName’ [-Wunused-variable]
const char *layerName;
^
S4/main_python.c:1986:15: warning: unused variable ‘kwlist’ [-Wunused-variable]
static char *kwlist[] = {"S4_Layer", "Simulations", NULL};
^
S4/main_python.c: At top level:
S4/main_python.c:653:18: warning: ‘S4Sim_ConvertUnits’ defined but not used [-Wunused-function]
static PyObject *S4Sim_ConvertUnits(S4Sim *self, PyObject *args)
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [S4_pyext] Error 1

Nonsense results when adding only patterns with same index as background

If the background index of all layers is 1, and you add only one or more structures with index 1, then there's really nothing happening here, the light should just pass right through.

(Running this simulation in the first place might seem like a silly thing to do ... I tried it because I wanted a quick "control" simulation where I knew what results to expect.)

But when you do this, you actually get totally wrong results. Here is an example lua script...

S = S4.NewSimulation()
S:SetLattice({1,0}, {0,1})
S:SetNumG(100)
S:AddMaterial("Air", {1,0})

S:AddLayer('start', 0, 'Air')
S:AddLayer('middle', 2, 'Air')
S:AddLayer('end', 0, 'Air')

S:SetLayerPatternCircle('middle', 'Air', {0.4,0.5}, .1)

S:SetFrequency(1/.3)

--S:SetExcitationPlanewave({incident_theta,incident_phi}, {s_amplitude, s_phase}, {p_amplitude, p_phase})
S:SetExcitationPlanewave({0,0},{1,0},{0,0})

Exr, Eyr, Ezr, Hxr, Hyr, Hzr, Exi, Eyi, Ezi, Hxi, Hyi, Hzi = S:GetFields({1.2, 3.4, 0.1})
print('Ex=', Exr, Exi, "Ey=", Eyr, Eyi, "Ez=", Ezr, Ezi)
print('Hx=', Hxr, Hxi, "Hy=", Hyr, Hyi, "Hz=", Hzr, Hzi)
print('|E|^2=', Exr^2 + Exi^2 + Eyr^2 + Eyi^2 + Ezr^2 + Ezi^2)
print('|H|^2=', Hxr^2 + Hxi^2 + Hyr^2 + Hyi^2 + Hzr^2 + Hzi^2)

forw,_ = S:GetAmplitudes('end',0)
_,back = S:GetAmplitudes('start',0)
G = S:GetNumG()
print('should be zero:', back[1][1], back[1][2], back[1+G][1], back[1+G][2])

...and the results...

Ex=     0       0       Ey=     0.2845451881264 -0.20715202380262       Ez=
0       0
Hx=     -0.15080894970699       -0.20715202380262       Hy=     0       0
Hz=     0       0
|E|^2=  0.12387792505141
|H|^2=  0.065655300277248
should be zero: 0.30718954248366        -0.95164835153994       0       0

When the circle has index 1.000001 instead of 1, it takes much longer to run and you get the expected results |E|^2 ~ |H|^2 ~ 1, and reflection ~ 0.

Interestingly, another way to get the expected results is if both theta and phi are nonzero for the incident wave.

This is with the S4 1.1.1 Windows .exe downloaded from the website (NOT compiled myself).

Thanks in advance! --Steve

How to install the Python extension

Hi, I'm looking for help for installing S4 as a Python extension. When I run make S4_pyext I get a long series of warnings and the error error: command 'x86_64-linux-gnu-gcc' failed with exit status 1. Any ideas how to solve it?

Crashing during compilation

Hi

I want to install S4 on RHEL6.8 over gcc and also over MPI
I installed lua-3.2.4. Edited the Makefile.Linux as below (commented lapack and blas). Kept lua lib location in LD_LIBRARY_PATH.
OBJDIR = build-S4
SHLIB_EXT = so
SHLIB_FLAGS = -fPIC -shared
#LA_LIBS = -llapack -lblas
LUA_INC = -I/dat/usr/x082685/Source/tools/apps/lua-5.2.4/include
LUA_LIB = -llua
LUA_MODULE_LIB =

MPI_INC =
MPI_LIB =

CFLAGS += -O3 -Wall -march=native -fcx-limited-range -fno-exceptions -fPIC
CXXFLAGS += -O3 -Wall -march=native -fcx-limited-range -fno-exceptions -fPIC

If compiling with MPI, the following must be modified to the proper MPI compilers

CC = gcc
CXX = g++

When I did a make, it gives me error as given in the link. Appreciate your help.
error.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.