Syntax error caused by using different version of IDL - idl-programming-language

I am new in IDL. When I use IDL version 8, my program run successfully. But when I use IDL Version 7.1 I get a syntax error that you can see below.
How can I fix this issue?
IDL> .com schwmodfirstiter_box.pro
str +=pars[i].name+strn(p[i],format='('+pars[i].sformat+')')
^
% Syntax error.
At: /home/behzad/schwmodfirstiter_box.pro, Line 5
% 1 Compilation error(s) in module SCHMAKEPARSTRING.
str +=pars[i].name+strn(p[i],format='('+pars[i].sformat+')')
^
% Syntax error.
At: /home/behzad/schwmodfirstiter_box.pro, Line 14
% 1 Compilation error(s) in module SCHMAKEPARSTRING0.
mlstr=pars[0].name+strn(ml[k],format='('+pars[0].sformat+')')+'/'
^
% Syntax error.
At: /home/behzad/schwmodfirstiter_box.pro, Line 63
% 1 Compilation error(s) in module SCHMAKEMODEL.
% Compiled module: SUBMITORBLIB.
% Compiled module: COMPILENNLS.
% Compiled module: SCHWMODFIRSTITER.
IDL>
% Interrupt encountered.

strn.pro is not part of IDL but is likely from
https://idlastro.gsfc.nasa.gov/ftp/pro/misc/strn.pro
Make sure you have this procedure in your !Path and can compile it.

Related

IDL syntax error caused by getenv(), a path error

I am using exofast code in IDL, I set environment exactly as the developer describe it but when I ru the code for fitting I get this errors:
path = filepath('',root_dir=getenv('EXOFAST_PATH'),subdir=['examples','hat3'])
^
% Syntax error.
At: /usr/local/ITTVIS.IDL.v7.0.6.LINUX-TBE/idl706/EXOFASTv2/examples/hat3/fithat3.pro, Line 3
prefix=path+'fitresults'+path_sep() +'HAT-3b.Torres.', maxsteps=maxsteps, $
^
% Syntax error.
At: /usr/local/ITTVIS.IDL.v7.0.6.LINUX-TBE/idl706/EXOFASTv2/examples/hat3/fithat3.pro, Line 8
I don't know what is the problem in my environment. any help?

Error when using acre.pro routine: "Programs can't be compiled from single statement mode"

I am trying to use acre.pro routine. It is a cosmic ray extraction program used to identify and remove cosmic ray strikes from an image. Here is an excerpt from the documentation of the routine (https://www.boulder.swri.edu/~buie/idl/pro/acre.html)
CALLING SEQUENCE:
; pro acre,dirty_im,clean_im,thresh,width
INPUTS:
; dirty_im - Original input image to be cleaned.
; thresh - Deviation threshold, in sigma, from background to cause
; pixel to be fixed.
; width - Median smoothing width to get local background reference.
OUTPUTS:
; clean_im - Final cleaned up image.
I followed the above procedure to use this program, however, IDL gives me two errors:
"Syntax Error" and "Programs can't be compiled from single statement mode."
Here is two of the many things that I've tried and the errors that I got:
IDL> pro acre ,'N1487262225_2cal.IMG','cosmic_clean.IMG',3,7
pro acre ,'N1487262225_2cal.IMG','cosmic_clean.IMG',3,7
^
% Syntax error.
IDL> pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
^
% Programs can't be compiled from single statement mode.
pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
^
% Programs can't be compiled from single statement mode.
pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
^
% Syntax error.
Try:
IDL> acre, 'N1487262225_2cal.IMG', 'cosmic_clean.IMG', 3, 7

Wrong directory for sipcfg.sip_module_dir

By trying to compile QGIS from sources on Ubuntu, there is the file /opt/QGIS/cmake/FindSIP.py which content is:
import sipconfig
sipcfg = sipconfig.Configuration()
print("sip_version:%06.0x" % sipcfg.sip_version)
print("sip_version_num:%d" % sipcfg.sip_version)
print("sip_version_str:%s" % sipcfg.sip_version_str)
print("sip_bin:%s" % sipcfg.sip_bin)
print("default_sip_dir:%s" % sipcfg.default_sip_dir)
print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
# SIP 4.19.10+ has new sipcfg.sip_module_dir
if hasattr(sipcfg, "sip_module_dir"):
print("sip_module_dir:%s" % sipcfg.sip_module_dir)
else:
print("sip_module_dir:%s" % sipcfg.sip_mod_dir)
In Python3.6, the last if/else statement prints:
sip_module_dir:/usr/lib/python3.6/dist-packages
But the string /usr/lib/python3.6/dist-packages doesn't match an existing directory (it is probably part of why I encountered the error:
python/CMakeFiles/python_module_qgis__core.dir/build.make:537: recipe for target 'python/core/sip_corepart0.cpp' failed' failed during build process).
I either have:
/usr/lib/python3/dist-packages
or
/usr/lib/python3.6/site-packages
And it's only in /usr/lib/python3/dist-packages that I have some 'sip' related files (the other directory gives no results):
$ find . -iname "*sip*"
./twisted/protocols/__pycache__/sip.cpython-36.pyc
./twisted/protocols/sip.py
./twisted/test/test_sip.py
./twisted/test/__pycache__/test_sip.cpython-36.pyc
./sipconfig.py
./sip.pyi
./sipconfig_nd6.py
./sipdistutils.py
./__pycache__/sipconfig_nd6.cpython-36.pyc
./__pycache__/sipdistutils.cpython-36.pyc
./__pycache__/sipconfig.cpython-36.pyc
./sip.cpython-36m-x86_64-linux-gnu.so
I guess there is something to fix within 'sip' itself but don't know where exactly, neither how to do that.
More information;
OS: Ubuntu 16.04 64 bits
Python: 3.6.7
Sip: 4.19.7

sqlcipher on windows using cygwin

I am using this site here. http://retroshare.sourceforge.net/wiki/index.php/Win32CompileLibrariesMingw#Compile_OpenSSL
and I have come across a problem. The error is
In file included from /usr/include/w32api/windows.h:95:0, from sqlite3.c:9607:
/cygdrive/c/sqlcipher-2.2.0/../openssl-1.0.1c/include/openssl/ossl_typ.h:153:29: error: expected ‘)’ before numeric constant typedef struct X509_name_st X509_NAME;
/cygdrive/c/sqlcipher-2.2.0/../openssl-1.0.1c/include/openssl/ossl_typ.h:199:33: error: expected ‘)’ before numeric constant typedef struct ocsp_response_st OCSP_RESPONSE;
Makefile:573: recipe for target 'sqlite3.lo' failed
make: *** [sqlite3.lo] Error 1
I opened the ossl_typ.h file to find only 1 line in it so i am not able to trace the error. Thank you for your help!
I came across the same problem trying to build sqlcipher. The problem is that recent versions of minGW define X509_NAME and OCSP_RESPONSE.
You need to add CFLAGS="-DNOCRYPT" to your ./configure, e.g. ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DNOCRYPT -lcrypto" in order to tell the compiler not to define these constants first.
Here is a link that explain the problem : http://cygwin.com/ml/cygwin/2012-12/msg00194.html

XCode 4.2 clang seg fault

Just upgraded to Lion and xcode 4.2. Now when I recompile my program I getting these errors:
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';'
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: parsing Objective-C method 'updateWithTouchLocationMoved:withEvent:view:'
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1789:3: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1796:4: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1799:5: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
There is nothing odd going on around those line numbers. No compound statements, just simple if (a == b) type stuff. Some of the error line numbers aren't even on statements, just blank lines or a { brace. I suspect that the line numbers are not accurate. I'm kind of dead in the water now. Code compiled fine under 4.1.
Any advice?
I stopped the compiler from crashing. After commenting out line after line of code to see where this was actually happening I arrived at this line:
shape.shapeType |= kTypeBreakable;
Doing...
shape.shapeType = shape.shapeType | kTypeBreakable;
...compiles fine. So does...
shape.shapeType |= 0x00000200;
kTypeBreakable is an enum that is set to 0x00000200
shapeType is just a obj-c object variable with a getter/setting.
Very very odd compiler bug.

Resources