victorliu / S4

Stanford Stratified Structure Solver - Electromagnetic simulator for layered periodic structures
http://www.stanford.edu/group/fan/S4/
GNU General Public License v2.0
128 stars 149 forks source link

pointer and integer comparison #78

Open fragkrag opened 6 years ago

fragkrag commented 6 years ago

Attempting to compile on Mac OS X gives error

"S4/S4.cpp:879:28: error: ordered comparison between pointer and zero ('const double *' and 'int') if(NULL == thick || thick < 0){ ret = -3; }"

I tried fixing it by removing "|| thick < 0" and adding a new variable thick_db = *thick; and putting that in tjhe comparison

This allows it to compile, but then when running the python extension, I try the following:

import S4 S = S4.New(Lattice = ((100,0),(0,100)), NumBasis = 40) S.SetMaterial(Name = 'Vacuum', Epsilon = 1) S.AddLayer(Name = 'top', Thickness = 100, Material = 'Vacuum')

this fails at AddLayer with Traceback (most recent call last): File "", line 1, in TypeError: Required argument 'S4_Material' (pos 3) not found

the other two commands run fine

fragkrag commented 6 years ago

I should add that simply using 'make' causes it to fail with some Lua error, so after downloading the package I immediately call 'make S4_pyext'

make lib does nothing