Add a perl project in Komodo - perl

I have an old perl(5.12.3) project, which I would like to debug in the komodo 3.0.1 environment (temporarely i have only this old version). The project is a multiple module project, with a three like structure:
Root
core
module1.pm
...
external
ext_module.pm
...
caller.bat
The project start point is the .bat file. Would it be possible to add and debug it in komodo? Any suggestion are appreciated.
set PERL_EXIST=0
perl -version >nul 2>&1 && ( set PERL_EXIST=1 )
if %PERL_EXIST% EQU 0 (
rem if perl doesn't exist give an error message and finish
echo.
echo ERROR: Perl %PERL_DIR% is missing
set PERL_EXIST=
set MY_EXIT_CODE=1
goto EXIT
)
.
.
.
#perl starts here
use core::FirstModule;
use Cwd qw(getcwd chdir);
use Switch;
use core::FirstModule;
use Env qw(PATH VAR_1 PROJ_VERSION CORE_LOC );
# adapt the environment to point to main folder
$ENV{'CORE_LOC'}=~s/[\\\/]?[^\\\/]*$//;
if ($ENV{'CORE_LOC'}=~/[\\\/].*$/i) {
$ENV{'CORE_LOC'} =~s/[\\\/]?[^\\\/]*$//;
.
.
.
.
push #INC,$sourceDir;
$hFirstModule = core::FirstModule->new("object properties");
$hFirstModule->checkDir($dir_version);

Related

Play framework 2.5 not loading application.prod.conf, only the default application.conf

I've run sbt clean stage and am trying to run my application in prod mode using the generated script. When running target\universal\stage\bin\app-name.bat . -Dconfig.resource=application.prod.conf it complains that the application secret is not set. After some troubleshooting I realised that it was still loading the default config filebecause after deleting target\universal\stage\conf\application.conf I get the following error:
Oops, cannot start the server.
Configuration error: Configuration error[application: application.conf: java.io.IOException: resource not found on classpath: application.conf, application.json: java.io.IOException: resource not found on classpath: application.json, application.properties: java.io.IOException: resource not found on classpath: application.properties]
I've tried refering to it with the full path using -Dconfig.file, with the same result. How do I get it to load the right config file, other than renaming it to application.conf?
Here is the full command contained in the .bat file, autogenerated by sbt:
#REM game-check-match launcher script
#REM
#REM Environment:
#REM JAVA_HOME - location of a JDK home dir (optional if java on path)
#REM CFG_OPTS - JVM options (optional)
#REM Configuration:
#REM GAME_CHECK_MATCH_config.txt found in the GAME_CHECK_MATCH_HOME.
#setlocal enabledelayedexpansion
#echo off
if "%GAME_CHECK_MATCH_HOME%"=="" set "GAME_CHECK_MATCH_HOME=%~dp0\\.."
set "APP_LIB_DIR=%GAME_CHECK_MATCH_HOME%\lib\"
rem Detect if we were double clicked, although theoretically A user could
rem manually run cmd /c
for %%x in (!cmdcmdline!) do if %%~x==/c set DOUBLECLICKED=1
rem FIRST we load the config file of extra options.
set "CFG_FILE=%GAME_CHECK_MATCH_HOME%\GAME_CHECK_MATCH_config.txt"
set CFG_OPTS=
if exist "%CFG_FILE%" (
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%CFG_FILE%") DO (
set DO_NOT_REUSE_ME=%%i
rem ZOMG (Part #2) WE use !! here to delay the expansion of
rem CFG_OPTS, otherwise it remains "" for this loop.
set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)
)
rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%
if "%_JAVACMD%"=="" (
if not "%JAVA_HOME%"=="" (
if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
)
)
if "%_JAVACMD%"=="" set _JAVACMD=java
rem Detect if this java is ok to use.
for /F %%j in ('"%_JAVACMD%" -version 2^>^&1') do (
if %%~j==java set JAVAINSTALLED=1
if %%~j==openjdk set JAVAINSTALLED=1
)
rem BAT has no logical or, so we do it OLD SCHOOL! Oppan Redmond Style
set JAVAOK=true
if not defined JAVAINSTALLED set JAVAOK=false
if "%JAVAOK%"=="false" (
echo.
echo A Java JDK is not installed or can't be found.
if not "%JAVA_HOME%"=="" (
echo JAVA_HOME = "%JAVA_HOME%"
)
echo.
echo Please go to
echo http://www.oracle.com/technetwork/java/javase/downloads/index.html
echo and download a valid Java JDK and install before running game-check-match.
echo.
echo If you think this message is in error, please check
echo your environment variables to see if "java.exe" and "javac.exe" are
echo available via JAVA_HOME or PATH.
echo.
if defined DOUBLECLICKED pause
exit /B 1
)
rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "!_JAVA_OPTS!"=="" set _JAVA_OPTS=!CFG_OPTS!
rem We keep in _JAVA_PARAMS all -J-prefixed and -D-prefixed arguments
rem "-J" is stripped, "-D" is left as is, and everything is appended to JAVA_OPTS
set _JAVA_PARAMS=
set _APP_ARGS=
:param_loop
call set _PARAM1=%%1
set "_TEST_PARAM=%~1"
if ["!_PARAM1!"]==[""] goto param_afterloop
rem ignore arguments that do not start with '-'
if "%_TEST_PARAM:~0,1%"=="-" goto param_java_check
set _APP_ARGS=!_APP_ARGS! !_PARAM1!
shift
goto param_loop
:param_java_check
if "!_TEST_PARAM:~0,2!"=="-J" (
rem strip -J prefix
set _JAVA_PARAMS=!_JAVA_PARAMS! !_TEST_PARAM:~2!
shift
goto param_loop
)
if "!_TEST_PARAM:~0,2!"=="-D" (
rem test if this was double-quoted property "-Dprop=42"
for /F "delims== tokens=1,*" %%G in ("!_TEST_PARAM!") DO (
if not ["%%H"] == [""] (
set _JAVA_PARAMS=!_JAVA_PARAMS! !_PARAM1!
) else if [%2] neq [] (
rem it was a normal property: -Dprop=42 or -Drop="42"
call set _PARAM1=%%1=%%2
set _JAVA_PARAMS=!_JAVA_PARAMS! !_PARAM1!
shift
)
)
) else (
if "!_TEST_PARAM!"=="-main" (
call set CUSTOM_MAIN_CLASS=%%2
shift
) else (
set _APP_ARGS=!_APP_ARGS! !_PARAM1!
)
)
shift
goto param_loop
:param_afterloop
set _JAVA_OPTS=!_JAVA_OPTS! !_JAVA_PARAMS!
:run
set "APP_CLASSPATH="
set "APP_MAIN_CLASS=-jar %APP_LIB_DIR%\game-check-match.game-check-match-0.1.0-launcher.jar"
if defined CUSTOM_MAIN_CLASS (
set MAIN_CLASS=!CUSTOM_MAIN_CLASS!
) else (
set MAIN_CLASS=!APP_MAIN_CLASS!
)
rem Call the application and pass all arguments unchanged.
"%_JAVACMD%" !_JAVA_OPTS! !GAME_CHECK_MATCH_OPTS! -cp "%APP_CLASSPATH%" %MAIN_CLASS% !_APP_ARGS!
#endlocal
:end
exit /B %ERRORLEVEL%

shared lib libmwi18n.so not find

I saw a similar question here
After reading the answers and comment in the above link I located the 'libmwi18n.so' file and set the LD_LIBRRY_PATH, but I'm still getting this error:
'error while loading shared libraries: libmwi18n.so: cannot
open shared object file: No such file or directory'
I did the following:
locate libmwil8n.so
which gives output
/usr/local/MATLAB/R2012a/bin/glnx86/libmwi18n.so
Then I did
export LD_LIBRARY_PATH= /usr/local/MATLAB/R2012a/bin/glnx86
and ran the shell program again,
./run_app.sh
which returns the same error.
Please help me , how can I solve this problem?
Update-
content of the run_spp.sh
!/bin/sh
# script for execution of deployed applications
#
# Sets up the MCR environment for the current $ARCH and executes
# the specified command.
#
exe_name=$0
exe_dir=`dirname "$0"`
echo "------------------------------------------"
if [ "x$1" = "x" ]; then
echo Usage:
echo $0 \<deployedMCRroot\> args
else
echo Setting up environment variables
MCRROOT="$1"
echo ---
LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnx86 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnx86 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnx86;
MCRJRE=${MCRROOT}/sys/java/jre/glnx86/jre/lib/i386 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;
XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
export LD_LIBRARY_PATH;
export XAPPLRESDIR;
echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
shift 1
args=
while [ $# -gt 0 ]; do
token=`echo "$1" | sed 's/ /\\\\ /g'` # Add blackslash before each blank
args="${args} ${token}"
shift
done
"${exe_dir}"/b $args
fi
exit
Your LD_LIBRARY_PATH should not include the library itself, but rather, the path that contains the library. Try:
export LD_LIBRARY_PATH=/usr/local/MATLAB/R2012a/bin/glnx86
or perhaps appending this location to the path:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/MATLAB/R2012a/bin/glnx86
EDIT: (after more info on question provided)
The shell script run_app.sh sets up it's own library path, using the environment variable LD_LIBRARY_PATH (it is declared in lines 17--24, and overwritten in line 26). This means that anything that is set in your shell before executing the script will be overwritten.
To include the path for libmwi18n.so, append the path within the script, after line 17 and before line 26, with:
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/MATLAB/R2012a/bin/glnx86
(Note: there is also a printout of the LD path so you should be able to tell whether the glnx86 path is present or not).
I think you want glnx86, not glnx68.
Apologies if that was just a typo in your question.

Open2 Api failure while installing Mead software

I am running into some issues trying to install a software called MEAD . I would appreciate if someone could have alook .
I get the following error while installing
/mead/bin # ./mead.pl GA3
Using system rc-file: /home/karosh/mead/bin/../.meadrc
Warning: Can't find user rc-file
Cluster: /home/karosh/mead/bin/../data/GA3/GA3.cluster
open2: exec of /home/karosh/mead/bin/driver.pl failed at ./mead.pl line 230
THe mead software is not written by me so I have not changed any of the perl scrips . I line 230 in the driver.pl file is
sub run_mead {
my %options = #_;
my $reader = FileHandle->new();
my $writer = FileHandle->new();
unless ( open2($reader, $writer, "$FindBin::Bin/driver.pl") ) {
die "Unable to run MEAD.\n";
}
...
...
}
Does this error mean that open2 was not found . The mead folks have put the following line in the file:
use strict;
use File::Spec;
use FileHandle;
use IPC::Open2;
Or does it mean that i need to install the rpm that contains the API . I see that this API is a part of the core perl bundle http://perldoc.perl.org/IPC/Open2.html. So why was it not installed ? Do i need to install perl again .
Someone has earlier faced this problem - http://www.summarization.com/~radev/mead/email/0160.html but the solution is not working for me . I find no Perl files with the incorrect perl directives . The mead team has been dissolved and there is no one to ask questions but I need to use this software.
I think if some one can explain me the meaning of the error than I can do deeper. Anyone?
It probably means that .../driver.pl doesn't have execute permission. Change the file permissions or call it like
open2($reader, $writer, "perl $FindBin::Bin/driver.pl")
open2($reader, $writer, "$^X $FindBin::Bin/driver.pl")

Facebook-iOS-SDK: How to correct build framework and add it to project?

I develop an app for iPad.
At now, i test application on iPad-5.1 Simulator.
And for my unhappiness, application falls down.
1) I use FacebookSDK 3.0
2) Compile FacebookSDK into Framework FBiOSSDK
3) Add Framework FBiOSSDK to project
4) See log of Linker
5) Undefined symbols for architecture i386:
"_sqlite3_open_v2" and many-many "_sqlite3_*" symbols.
Maybe i set wrong options to facebook-sdk project when build it to framework?
Can anybody help?
After search, i find a solution:
"Add to project libsqlite3.0.dylib"
But Linker said:
"ignoring file /path/libsqlite3.dylib, missing required architecture i386 in file"
-- Main Problem --
After an hour, i've found out, that i link framework in wrong way.
Script create it in local directory (not in System/Library/Frameworks or Library/Frameworks).
After adding it, Framework Search Paths changes to not default value.
How to build framework in right way?
Thanks!
So, after a long time i make such things to make this FacebookSDK work:
1)First, I delete build of FacebookSDK framework (rm -rf) and run script for building framework (build_framework.sh)
2)After that, i add to project (project -> build phases -> link binary with libraries ) FacebookSDK.framework (from local directory, with button add other) and libsqlite3.0dylib and libsqlite3.dylib (just search it in search-field!)
0) or 3)And After that i make this: find directory ~/Library/Developer/Xcode/DerivedData and delete EVERYTHING from this. (use command rm -rf dir_name/*)
You can do it from step 3) that i also named step 0).
Here i provide a script, which can help you
#!/usr/bin/perl
my $pathToCacheDirectory = qq(~/Library/Developer/Xcode/DerivedData/);
sub TaskToDo{
my ($refToArgv)=#_;
die "can't work with too much parameters" unless(scalar(#$refToArgv)==1);
my $what = shift #$refToArgv;
my $time = 30; #wait 30 seconds in each iteration
my $workRef = sub{
print "i will delete: ";
print qx(ls $pathToCacheDirectory);
qx(rm -rf $pathToCacheDirectory);
};
#view help
if ($what eq 'help'){
print qx(perldoc -t $0);
}
#list directory
if ($what eq 'watch'){
print qx(ls $pathToCacheDirectory);
}
#kill files instantly
if ($what eq 'now'){
print 'kill now'.qq(\n);
$workRef->();
print 'see result'.qq(\n);
print qx(ls $pathToCacheDirectory);
}
#switch on watcher
if ($what eq 'work'){
for(;;){
#in INF loop
for my $s(0..4){
#print "this is <<$_>>\n";
print "time remaining: ".(5-$s)*$time." sec \n";
sleep($time);
}
$workRef->();
sleep(10);
}
}
}
TaskToDo(\#ARGV);
__END__
=head1 DESCRIPTION
This script clear directory with cache from Xcode
-- 'help' will show this log
-- 'work' will run script as observer and killer
-- 'watch' will show info about directory with cache
-- 'now' will kill all instantly
Example: perl scriptName.pl help
=cut
The solution I found was to go to the Target Info and delete the Framework search path that XCode created. Then everything compiled correctly.

Configuring the compile sources of a build phase

I have a project with many targets.
Every time I create a new target, I am adding a specific class to the Compile Sources and I am setting a compiler flag for that class. How can I apply this setting automatically?
I think this needs to be done by modifying the project file directly. In other words, write a script that will make the changes.
Here's a simple example to add arc flags to a file for all targets.
#!/bin/sh
set -e
USAGE="$0 <filename> ..."
PROJECTFILE="project.pbxproj"
FILES="$*"
COMPILER_FLAGS="\"-fobjc-arc\"";
if [ "${FILES}" = "" ] ; then
echo ${USAGE};
exit 1 ;
fi
if [ ! -f "${PROJECTFILE}" ] ; then
echo "Cannot find ${PROJECTFILE} - Please run from within the .xcodeproj directory";
exit 1 ;
fi
cp ${PROJECTFILE} ${PROJECTFILE}.bak
for f in ${FILES}; do
echo "Adding flags for $f" ;
sed -ie "s/\(${f}.*{ *isa *= *PBXBuildFile.*\)};$/\\1 settings = {COMPILER_FLAGS = ${COMPILER_FLAGS}; }; };/g" "${PROJECTFILE}"
done