Perl interpreter supporting both oracle and sybase - oracle

Can some one let me know how to use both sybase functions and oracle functions in same perl script using a perl interpreter supporting both syb and ora modules?
I have 2 perl interpreter running in same machine currently.
Sybase package is build on below version of perl. I could see that version in the README file of sybase modues
bash-4.1$ /usr/bin/perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread.
I am able to use this interpreter in script and compile successfully when I use sybase supported functions to fetch from db*
1st interpreter
test1.pl
#!/usr/bin/perl
2nd perl interpretor came with oracle sdk package.
its supporting only oracle fucntions to interact with Db
bash-4.1$ /home/oracle/12.2.0/client_1/perl/bin/perl -v
This is perl 5, version 22, subversion 0 (v5.22.0) built for x86_64-linux-thread-multi->this is supporting only oracle*
test2.pl
#!/home/oracle/12.2.0/client_1/perl/bin/perl
I tried to include oracle modules from this path /home/oracle/12.2.0/client_1/perl/bin/perl while running a script using perl bin from /usr/bin/perl path and #INC file i pointed to /home/oracle/12.2.0/client_1/perl/DBD/Oracle.pm it will throw error.
So I found oracle build on 1 perl version can't be included with other version of perl
test3.pl
#!/home/oracle/12.2.0/client_1/perl/bin/perl
---sydth/(EXEC.....)
Can I have 1 perl interpretor version supporting both Sybase and Oracle functions?
I am not talking about the DBI module to connect to to oracle and sybase.
I meant functions used using database handlers to support oracle and sybase after connection.
I managed to follow the below steps
Downloaded DBD-Oracle-1.73_01.tar.gz and tried to install got erros. So downloaded and installed the below dependencies first
2.downloanded dependencies ExtUtils-MakeMaker-7.4 and ExtUtils-ParseXS-35.tar.gz
downloaded a oracle sdk package 12.2.0 . it has perl.jdk,plsql,sqlplus.. etc
oracle/12.2.0/client_1/perl
set ORACLE_HOME =/oracle/12.2.0/client_1 and LD_LIBARRY_PATH=oracle/12.2.0/client_1/perl
cd DBD-Oracle-1.73_01/
--execute using perl v5.10 (perl Makefile.PL)
make && make install -> this step is throwing lot of errors
I am assuming oracle driver module and along with oracle sdk clients , can there be any kind of version mismatch here ?
Glance of errors
racle.c:2379: error: âcvâ undeclared (first use in this function)
Oracle.c:2380: error: âitemsâ undeclared (first use in this function)
Oracle.c:2382: error: âXS_VERSION_BOOTCHECKâ undeclared (first use in this function)
Oracle.c:2388: warning: implicit declaration of function âPerl_newXSâ
Oracle.c:2388: error: âXS_DBD__Oracle_constantâ undeclared (first use in this function)
Oracle.c:2389: error: âXSANYâ undeclared (first use in this function)
Oracle.c:2518: error: âXS_DBD__Oracle_ORA_OCIâ undeclared (first use in this function)
Oracle.c:2519: error: âXS_DBD__Oracle_ora_env_varâ undeclared (first use in this function)
Oracle.c:2523: error: âXS_DBD__Oracle__dr_dbixs_revisionâ undeclared (first use in this function)
Oracle.c:2533: error: âXS_DBD__Oracle__db__loginâ undeclared (first use in this function)
Oracle.c:2534: error: âXS_DBD__Oracle__db_selectall_arrayrefâ undeclared (first use in this function)
Oracle.c:2535: error: âXS_DBD__Oracle__db_selectrow_arrayrefâ undeclared (first use in this function)
Oracle.c:2545: error: âXS_DBD__Oracle__db_commitâ undeclared (first use in this function)
Oracle.c:2546: error: âXS_DBD__Oracle__db_rollbackâ undeclared (first use in t heis function)
./Oracle.xsi:19: warning: implicit declaration of function âSvIVXâ
./Oracle.xsi:19: warning: implicit declaration of function âperl_get_svâ
./Oracle.xsi:19: error: lvalue required as unary â&â operand
./Oracle.xsi:19: warning: cast to pointer from integer of different size
./Oracle.xsi:19: error: âdbistate_tâ has no member named âcheck_versionâ
./Oracle.xsi:21: warning: implicit declaration of function âsv_setivâ
./Oracle.xsi:21: error: âGV_ADDMULTIâ undeclared (first use in this function)
./Oracle.xsi:24: warning: implicit declaration of function âora_initâ
Oracle.c:2649: error: âXSRETURN_YESâ undeclared (first use in this function)
Oracle.c:2367: warning: unused variable âPerl___notusedâ
make: *** [Oracle.o] Error 1

The standard way to talk to Sybase databases is using Perl's DBI (database interface) module and DBD::Sybase (which is the database driver for Sybase). Similarly, for an Oracle database, you'd use DBI together with DBD::Oracle.
It is perfectly possible to have both of these modules installed in the same Perl installation. It probably makes most sense to add DBD::Oracle to the version of Perl in /usr/bin/perl. You can do that by running
$ sudo cpan DBD::Oracle
on your command line. Note that you will need sudo access on the system and it will also need a C compiler and the Oracle development libraries.
If you have problems when you try it, post details of the errors you get in a new question here and we'll try to help you.

Related

Getting error when trying to bundle fast_stack on windows

I'm trying to understand how to fix error:
C:\inetpub\wwwroot\DISCOU~2>gem install fast_stack
ERROR: Error installing fast_stack:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR="
generating fast_stack-i386-mingw32.def
compiling fast_stack.c
In file included from c:/Ruby200/include/ruby-2.0.0/ruby/defines.h:153:0,
from c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Ruby200/include/ruby-2.0.0/ruby.h:33,
from fast_stack.c:3:
c:/Ruby200/include/ruby-2.0.0/ruby/win32.h:276:12: error: conflicting types for 'gettimeofday'
In file included from fast_stack.c:2:0:
c:\ruby200\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/sys/time.h:42:13: note: previous declaration of 'gettimeofday' was here
fast_stack.c: In function 'rb_profile_start':
fast_stack.c:9:22: error: storage size of 'timer' isn't known
fast_stack.c:11:34: error: 'suseconds_t' undeclared (first use in this function)
fast_stack.c:11:34: note: each undeclared identifier is reported only once for each function it appears in
fast_stack.c:11:46: error: expected ';' before 'rb_num2long_inline'
fast_stack.c:13:5: warning: implicit declaration of function 'setitimer' [-Wimplicit-function-declaration]
fast_stack.c:13:15: error: 'ITIMER_REAL' undeclared (first use in this function)
fast_stack.c:9:22: warning: unused variable 'timer' [-Wunused-variable]
fast_stack.c: In function 'rb_profile_stop':
fast_stack.c:21:22: error: storage size of 'timer' isn't known
fast_stack.c:23:15: error: 'ITIMER_REAL' undeclared (first use in this function)
fast_stack.c:21:22: warning: unused variable 'timer' [-Wunused-variable]
make: *** [fast_stack.o] Error 1
Gem files will remain installed in C:/inetpub/wwwroot/DISCOU~2/GEM_HOME/gems/fast_stack-0.1.0 for inspection.
It happens when I write "bundle install" command for the discourse.org application installing on Helicon Zoo environment.
It appears that it's not the Zoo itself, more issue with the gem. Try to install it separately, outside the environment of Zoo. Simply Ruby, in test catalog, but outside the Zoo. If that's working, contact HeliconTech directly and address as an issue, they're quite quick and good at fixing these things.

OpenCV 2.4.3 on Xcode 4.5

I'm trying to compile a project that uses opencv using xcode 4.5 on Mountain Lion 10.8, I followed closely the procedure on this link:
Compile OpenCV (2.3.1+) for OS X Lion / Mountain Lion with Xcode
This is the sequence that I have followed;
Installed opencv using ports: sudo port install opencv
configure.compiler = llvm-gcc-4.2
Opened Xcode and created a new project (command line app using c++).
Added the "/opt/local/lib/**" path to "Library search paths"
Added any libopencv_. Dylib to a new group
Added the "/opt/local/include/**" path to "Header search paths"
Every time I try to compile xcode fail with this error:
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:46:
In file included from /opt/local/include/opencv2/core/core_c.h:47:
/opt/local/include/opencv2/core/types_c.h:322:17: error: use of undeclared identifier 'lrint'
return (int)lrint(value);
^
/opt/local/include/opencv2/core/types_c.h:742:5: error: use of undeclared identifier 'assert'
assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F );
^
/opt/local/include/opencv2/core/types_c.h:773:5: error: use of undeclared identifier 'assert'
assert( (unsigned)row < (unsigned)mat->rows &&
^
/opt/local/include/opencv2/core/types_c.h:780:9: error: use of undeclared identifier 'assert'
assert( type == CV_64FC1 );
^
/opt/local/include/opencv2/core/types_c.h:790:5: error: use of undeclared identifier 'assert'
assert( (unsigned)row < (unsigned)mat->rows &&
^
/opt/local/include/opencv2/core/types_c.h:797:9: error: use of undeclared identifier 'assert'
assert( type == CV_64FC1 );
^
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:46:
/opt/local/include/opencv2/core/core_c.h:1118:5: error: use of undeclared identifier 'assert'
assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ );
^
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:47:
In file included from /opt/local/include/opencv2/core/core.hpp:56:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:76:5: error: use of undeclared identifier 'va_start'
va_start(__args, __fmt);
^
/usr/include/c++/4.2.1/bits/c++locale.h:84:5: error: use of undeclared identifier 'va_end'
va_end(__args);
^
/usr/include/c++/4.2.1/cstdarg:54:20: note: expanded from macro 'va_end'
#define va_end(ap) va_end (ap)
^
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:47:
In file included from /opt/local/include/opencv2/core/core.hpp:56:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:48:
In file included from /usr/include/c++/4.2.1/bits/postypes.h:45:
In file included from /usr/include/c++/4.2.1/cwchar:51:
/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace
using ::clock_t;
~~^
/usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace
using ::tm;
~~^
/usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace
using ::clock;
~~^
/usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace
using ::difftime;
~~^
/usr/include/c++/4.2.1/ctime:71:11: error: no member named 'mktime' in the global namespace
using ::mktime;
~~^
/usr/include/c++/4.2.1/ctime:72:11: error: no member named 'time' in the global namespace
using ::time;
~~^
/usr/include/c++/4.2.1/ctime:73:11: error: no member named 'asctime' in the global namespace
using ::asctime;
~~^
/usr/include/c++/4.2.1/ctime:74:11: error: no member named 'ctime' in the global namespace
using ::ctime;
~~^
/usr/include/c++/4.2.1/ctime:75:11: error: no member named 'gmtime' in the global namespace
using ::gmtime;
~~^
/usr/include/c++/4.2.1/ctime:76:11: error: no member named 'localtime' in the global namespace
using ::localtime;
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
I Tried also to change compiler to LLVM GCC 4.2 compiler with no luck.
Someone can 'tell me the exact steps to build projects on xcode using opencv Mountain Lion and Xcode 4.5?
Without access to your code, I can't say whether this would be a complete fix but, in order to to resolve your "no member named..." compilation errors, you might try substituting "/opt/local/lib" for "/opt/local/lib/**" by double clicking on the "Header Search Paths" field and selecting the "non-recursive" option under XCode's "Build Settings" > "Search Paths" > "Header Search Paths".
You could also try recompiling after navigating to "Build Settings" > "Apple LLVM compiler 4.2 - Language" > "C++ Standard Library", and selecting "libstdc++ (GNU C++ standard library)" rather than XCode 4.5's default "libc++ (LLVM C++ standard library with C++11 support)".
I would use a different installing command:
sudo port install tbb
sudo port install opencv +debug +eigen +python27 +qt4 +tbb
eigen and qt4 is optional, tbb is rather essential, since opencv uses tbb massively for multithreading when present. In other words, opencv is much slower without tbb.
I would not manually specify the compiler. As I remember that did not work for me.
make sure its compiled as c++, rename your m files to mm

VSTGUI 4.0.1 XCODE 4.5 and MacOSX 10.8 Troubles

That's the first time I use stack overflow 'cause I got a problem develop VST Plugins with GUI on MacOSX 10.8.
I'm new to mac development and I'm not shure why I get the following errors due compiling and linking my product using VSTGUI 4.0.1.
/Users/christianschragen/Downloads/samples/vst2.x/mac/aeffguieditor.cpp:115:34: 'createDrawContext' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/aeffguieditor.cpp:182:10: 'TickCount' is deprecated: first deprecated in Mac OS X 10.8
/Users/christianschragen/Downloads/samples/vst2.x/mac/aeffguieditor.cpp:237:27: Conversion from string literal to 'char *' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/cview.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/cview.cpp:661:22: No matching function for call to 'make_pair'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:239:5: 'beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:244:21: 'runModalForDirectory:file:types:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:255:5: 'beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:260:21: 'runModalForDirectory:file:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:493:4: Use of undeclared identifier 'GetPortBounds'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:524:2: Use of undeclared identifier 'GetPortBounds'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:539:24: Use of undeclared identifier 'QDSwapPort'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:542:3: Use of undeclared identifier 'QDSwapPort'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:634:124: Non-constant-expression cannot be narrowed from type 'CCoord' (aka 'double') to 'CGFloat' (aka 'float') in initializer list
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:747:13: Enumeration value 'kError' not handled in switch
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:808:24: Use of undeclared identifier 'NewRgn'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:822:5: Use of undeclared identifier 'DisposeRgn'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:1016:17: Use of undeclared identifier 'kQDRegionToRectsMsgParse'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:1117:37: Use of undeclared identifier 'kQDParseRegionFromTopLeft'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewoptionmenu.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewoptionmenu.cpp:107:17: 'UniqueID' is deprecated: first deprecated in Mac OS X 10.8
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewtextedit.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewtextedit.cpp:111:3: Use of undeclared identifier 'GetFNum'
Any ideas what's wrong?
Thanks
Chris
I have a strong feeling that VSTGUI does not support 10.8 yet. You should set the target SDK in your Xcode build settings to 10.7 (or maybe 10.6), which probably involves downloading a huge DMG from Apple via Xcode.
Also it probably wouldn't hurt to contact the VSTGUI developers to seek support from them.

Compiling Z3 for OCaml

I tried to compile the OCaml version for Z3, however when I build it, it always shows a bunch of error and warning.
These are several of the errors:
z3_stubs.c:7384: error: storage size of `_ctxs' isn't known
z3_stubs.c:7385: error: `camlidl_ctx' undeclared (first use in this function)
z3_stubs.c:7385: error: expected `;' before `_ctx'
I dont really get it, I just try to run the build.cmd, and the error happens, anyone has an idea?
Do you have camlidl installed?

Compile Ruby Enterprise Edition on Mac OS X

Hi
when trying to compile Ruby Enterprise Edition 2010.02
readline.c: In function ‘username_completion_proc_call’:
readline.c:734: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:734: error: (Each undeclared identifier is reported only once
readline.c:734: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
I tried also specifying the option -c '--with-readline-path=/usr/local' (where I installed the readline libs), but I have the same issue.
I tried to install readline with port and delete my manual compile, but the problem still there.
I never had troubles under Linux (the system I'm used to), having ldconfig, etc...
HELP! :)
Thanks
Have you tried using RVM (Ruby Version Manager)?
Ok, I resolved in this way:
I compiled readline 5.2 following this guide
http://techdebug.com/blog/2009/01/03/compiling-readline-on-an-osx-105-intel-x86_64/
readline 6.1 does not work with ree.
Doing the installation with the following:
./installer -c '--with-readline-dir=PATH'
works fine

Resources