Doing git pull in Engine Yard - deployment

I am deploying my rails app to Engine Yard.
What i had so far:
1. created SSH hey
2. Install public key to Engine Yard app.
3. ssh deploy#my.server.ip.address
I was put at home/deploy, which is not a right place to perform git pull.
The reason I need to deploy in this way, is because my app is using nmatrix gem, which need to be installed manually using c++ compiler. The automatic bundler got an error while fetching that gem, and stopped.
Update:
I guess my question should be, how to install nmatrix to EngineYard. This is the error message I got from calling gem install nmatrix:
Building native extensions. This could take a while...
ERROR: Error installing nmatrix:
ERROR: Failed to build gem native extension.
/usr/bin/ruby21 extconf.rb
checking for main() in -llapack... no
checking for main() in -lcblas... yes
checking for main() in -latlas... no
checking for clapack.h... no
checking for cblas.h... yes
checking for cblas.h... yes
checking for clapack_dgetrf() in cblas.h,clapack.h... no
checking for clapack_dgetri() in cblas.h,clapack.h... no
checking for dgesvd_() in clapack.h... no
checking for cblas_dgemm() in cblas.h... yes
using C++ standard... c++0x
g++ reports version... Hardened
creating nmatrix_config.h
creating Makefile
make "DESTDIR="
compiling nmatrix.cpp
In file included from nmatrix.cpp:331:0:
ruby_nmatrix.c: In function ‘VALUE nm_mset(int, VALUE*, VALUE)’:
ruby_nmatrix.c:1378:108: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
ruby_nmatrix.c: In function ‘VALUE nm_xslice(int, VALUE*, void* (*)(const STORAGE*, SLICE*), void (*)(NMATRIX*), VALUE)’:
ruby_nmatrix.c:1556:91: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
ruby_nmatrix.c: In function ‘SLICE* get_slice(size_t, int, VALUE*, size_t*)’:
ruby_nmatrix.c:1903:104: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘size_t’
ruby_nmatrix.c:1903:104: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘size_t’
compiling ruby_constants.cpp
compiling data/data.cpp
compiling util/io.cpp
compiling math.cpp
In file included from math.cpp:140:0:
math/rot.h: In function ‘void nm::math::rot(int, DType*, int, DType*, int, CSDType, CSDType) [with DType = nm::Complex<float>, CSDType = float]’:
math/rot.h:123:40: error: ‘cblas_csrot’ was not declared in this scope
math/rot.h: In function ‘void nm::math::rot(int, DType*, int, DType*, int, CSDType, CSDType) [with DType = nm::Complex<double>, CSDType = double]’:
math/rot.h:128:40: error: ‘cblas_zdrot’ was not declared in this scope
In file included from math.cpp:141:0:
math/rotg.h: In function ‘void nm::math::rotg(DType*, DType*, DType*, DType*) [with DType = nm::Complex<float>]’:
math/rotg.h:99:125: error: ‘cblas_crotg’ was not declared in this scope
math/rotg.h: In function ‘void nm::math::rotg(DType*, DType*, DType*, DType*) [with DType = nm::Complex<double>]’:
math/rotg.h:104:125: error: ‘cblas_zrotg’ was not declared in this scope
make: *** [math.o] Error 1
Gem files will remain installed in /home/deploy/.gem/ruby/2.1.0/gems/nmatrix-0.0.9 for inspection.
Results logged to /home/deploy/.gem/ruby/2.1.0/gems/nmatrix-0.0.9/ext/nmatrix/gem_make.out
One of the prerequisite to install nmatrix is to have gcc > v4.7, but EngineYard is having v4.5.4 only. Anyone know how to upgrade gcc? I think I am running Gentoo.

The question actually should include what you want to git pull.
When you ssh in, you are put into /home/deploy which is your home directory.
The Git copy of your app is located in /data/APPNAME/shared/cache-copy/ on the App Master
You can have multiple apps on one instance and each one can have a different deploy key so you use a GIT_SSH wrapper
GIT_SSH=/data/APPNAME/shared/config/pulse-ssh-wrapper git pull
(in all the above commands remember to replace APPNAME with the name used for the app)
If you want to find the actual location for a bundled gem, you can look in
/data/APPNAME/shared/bundled_gems/ruby/2.0.0/gems (version will depend on Ruby ABI)
if your Gemfile uses a :git remember that only a single deploy key can be used for both the app clone and bundle phase, you cannot select different keys per gem.
Most likely the issue with installing the nmatrix gem is that the ATLAS libraries are not installed yet and those would be installed with the system's package manager (Portage for Gentoo and Apt-get for Ubuntu). You can add them via "Edit Unix Packages" on the UI, just select sci-libs/blas-atlas and sci-libs/lapack-atlas. Currently this will fail because the EC2 instances are Xeon processors and the libraries do not build on these yet.
http://sourceforge.net/p/math-atlas/support-requests/614/
https://bugzilla.kernel.org/show_bug.cgi?id=13794
You can see the CPU type on your Linux instance with "cat /proc/cpuinfo" and will see something like
model name :Intel(R) Xeon(R) CPU E5-2650 0 # 2.00GHz

Related

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

Could not find openssl in backend

Error I get:
error[E0433]: failed to resolve: could not find `openssl` in `backend`
--> ...\src\...\swagger-0.12.1\src\connector.rs:41:34
|
41 | native_tls::backend::openssl::TlsConnectorBuilderExt::from_openssl(ssl);
| ^^^^^^^ could not find `openssl` in `backend`
error[E0433]: failed to resolve: could not find `openssl` in `backend`
--> ...\swagger-0.12.1\src\connector.rs:85:34
|
85 | native_tls::backend::openssl::TlsConnectorBuilderExt::from_openssl(ssl);
| ^^^^^^^ could not find `openssl` in `backend`
Compiling hyper v0.2.1
error: expected identifier, found `"rustc-serialize"`
--> ...\hyper-0.2.1\src\lib.rs:129:14
|
129 | extern crate "rustc-serialize" as serialize;
| ^^^^^^^^^^^^^^^^^ expected identifier
Generated a server stub user swagger. Ran into issues where cargo couldn't find openssl, giving an error like 'custom build something openssl-sys 0.9.24'. This was a known issue and I overcame it by downloading vcpkg, and using vcpkg to download openssl. Then using environment variables to point to the download folder so cargo could use openssl. But now the error seems to be that openssl doesn't exist in backend?
It also seems to specific to windows, any ideas?
Tried changing the version of native-tls to the most up to date version but it doesn't seem to have an affect at all. It looks like swagger's dependencies need updating but I literally just generated this stub...
You've landed on a flaw from the Rust documentation tools; it picks up what is in a package, but doesn't show the limits.
The backend module definition is defined as:
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub mod security_framework;
#[cfg(target_os = "windows")]
pub mod schannel;
#[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))]
pub mod openssl;
In other words, the situation is the following:
If you are on linux (i.e. not macOS, not windows, not iOS), then openssl is available
If you are on windows, then schannel is available
If you are on MacOS or iOS security_framework is available
You should, however, not be trying to target a specific backend, as this defeats the purpose of the library. Instead of importing native_tls::backend::openssl::TlsConnectorBuilderExt, import native_tls::TlsConnectorBuilder and let it decide what backend you need.
This may be easier said than done, however, since by the looks of your error this is caused by a third-party library, which indicates that it was only tested on Linux.

POSTGRESQL - ERROR: could not load library pgafis.so : undefined symbol: lfsparms_V2

I'm using PGAFIS library for fingerprint matching. For this i have installed postgresql and having some user defined c functions.
PGAFIS contain makefile, .control file, sql and unpacked sql file everything
I have compiled and pgafis.so file for the same and everyfile is on right location.
In my PGAdmin-III when i run CREATE EXTENSION pgafis it gives me following error:
ERROR: could not load library "/usr/lib/postgresql/9.4/lib/pgafis.so": /usr/lib/postgresql/9.4/lib/pgafis.so: undefined symbol: lfsparms_V2
SQL state: XX000
Please help. Thanks in advance
(This is a follow-up from Postgresql user defined c function issues)
I expect you forgot to link to the required library.
Try adding
PG_LIBS = -lmindtct
or whatever. If it's not on the default linker path you'll need to need to add -L/path/to/the/containing/directory to PG_CPPFLAGS too.

OpenCobol & PostgreSQL on Windows with Visual Studio

I'm currently facing a problem with this team of 4.
Using binaries I downloaded on kiska's site. I'm able to compile cobol to C and run it with cobcrun or compile it to an executable. However I can 't get opencobol to find the postgres commands.
Here is the strat of my cobol script :
identification division.
program-id. pgcob.
data division.
working-storage section.
01 pgconn usage pointer.
01 pgres usage pointer.
01 resptr usage pointer.
01 resstr pic x(80) based.
01 result usage binary-long.
01 answer pic x(80).
procedure division.
display "Before connect:" pgconn end-display
call "PQconnectdb" using
by reference "dbname = postgres" & x"00"
by reference "host = 10.37.180.146" & "00"
returning pgconn
end-call
...
the call PQconnectdb fail with module ont found : PQconnectdb
I noticed that if i rename the libpq.dll the error message change to can't find entry point. So at least I'm sure it can get my dll.
After digging into the code of the call method of the libcob library. I found it it was possible to pre load some dll using an environment variable COB_PRE_LOAD but sitll no results.
Here is what look the script to compile the cobol :
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat"
set COB_CONFIG_DIR=C:\OpenCobol\config
set COB_COPY_DIR=C:\OpenCobol\Copy
set COB_LIBS=%COB_LIBS% c:\OpenCobol\libpq.lib
set COB_LIBRARY_PATH=C:\OpenCobol\bin
set COB_PRE_LOAD=C:\OpenCobol\libpq.dll
#echo on
cobc -info
cobc -free -o pgcob -L:"C:\OpenCobol" -llibpq.lib test_cobol\postgres.cob
call cobcrun pgcob
I don't see anything missing, I'm using the 64-bit binaries from kiska's site and use the 64-bit cl.exe from Visual Studio, Postgres is a 64 bit version too (checked with dependencyChecker).
I even tryed to compile the generated C from Visual Studio, same result, but I may miss something, I'm pretty rotten in C and never really had to manage DLL or use Visual Studio.
What am I missing ?
COB_PRE_LOAD doesn't take any path or extension, see the short documentation for the available runtime configurations. I guess
set COB_LIBRARY_PATH=C:\OpenCobol\bin;C:\OpenCobol
set COB_PRE_LOAD=libpq
Will work. You can omit the C:\OpenCobol\bin if you did not placed any additional executables there.
If it doesn't work (even if it does) I'd try to get the C functions resolved at compile time. Either use
CALL STATIC "PQconnectdb" using ...
or an appropriate CALL-CONVENTION or leave the program as-is and use
cobc -free -o pgcob -L"C:\OpenCobol" -llibpq -K PQconnectdb test_cobol\postgres.cob
From cobc --help:
-K generate CALL to <entry> as static
In general: the binaries from kiska.net are quite outdated. I highly suggest getting newer ones from the official download site or ideally build them on your own from source, see the documentation for building GnuCOBOL with VisualStudio.

Errors with installing SNA packages

I've been trying to install SNA packages but i always get the next errors,
> install.packages("sna")
Installing package(s) into ‘/home/rvaca/R/i486-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/sna_2.2-0.tar.gz'
Content type 'application/x-gzip' length 273329 bytes (266 Kb)
opened URL
==================================================
downloaded 266 Kb
The downloaded packages are in
‘/tmp/Rtmp7iF3Qz/downloaded_packages’
> library(sna)
starting httpd help server ... done
Error in attr(helpObj, "call") <- this.call :
attempt to set an attribute on NULL
Error: package/namespace load failed for ‘sna’
> library("sna")
Error in attr(helpObj, "call") <- this.call :
attempt to set an attribute on NULL
Error: package/namespace load failed for ‘sna’
> library('sna')
Error in attr(helpObj, "call") <- this.call :
attempt to set an attribute on NULL
Error: package/namespace load failed for ‘sna’
What happened? Thanks in advance
vacing
When loading the sna package using library(sna) or require(sna), the function .First.lib() is (still) called. This function is now among the defunct functions in the base package (see ?.First.lib), but that's beside the point.
Looking at the source files for sna, .First.lib() is defined in the file zzz.R and contains the line
ehelp <- help(package="sna")$info[[1]].
This does not work well if getOption("help_type") is not "text". You could, therefore, try setting this option before loading the package to see if that works.
options(help_type="text")
library(sna)
Does this still produce an error?
EDIT
Since the above still gives an error, and since the package has properties that are being phased out (i.e., no namespace, and using .First.lib()), I would recommend contacting the package's maintainer (perhaps with a reference to this question on SO):
packageDescription("sna")$Maintainer
Again, my suspicion is that the problem lies in creating the object ehelp in the .First.lib() function, which is called since there is no package namespace specified.
Ok this is the result of sessionInfo(), (I forgot to comment that i runs it into Eclipse)
> sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: i486-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8
[9] LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Cairo_1.5-1 igraph_0.5.5-4 rj_1.0.3-7
loaded via a namespace (and not attached):
[1] rj.gd_1.0.3-3 sna_2.2-0 tools_2.14.2