ndk-build not found in cygwin - android-ndk

I'm trying to use ndk-build in cygwin but for some reason, it isn't able to find the command.
I've tried to add the path of the NDK to PATH Environment variable as shown. I'm able to invoke ndk-build from command-line but cannot do so in cygwin.
Then as suggested from this post, I've tried to run ndk-build by appending ./ in front. Still doesn't work.
As a last resort, I edited .bash_profile's path so that it points to the NDK directory. Again, it doesn't work.
SIGH....... I'd appreciate any guidance.

Remove that trailing/blank space in the folder where the ndk is installed.
See Android NDK: No rule to make target for a similar problem.

Related

CMAKE version won't change

I made a change in a shell script to use a version of cmake and can't find this script. I want to use cmake-3.18.5, I have installed it and changed the path to it in bashrc, but it still uses the older version cmake-3.18.2. How to find where this happens?
You're problem appears to be that you put the filename in your path, not the directory.
First, try this at the command line to make sure cmake is installed:
/HOME/cmake-3.18.5/bin/cmake --version
Then if that works, change your path on the command line:
export PATH=/HOME/cmake-3.18.5/bin:$PATH
Note that PATH takes directories, not files or executables.
Now type
type -aP cmake
Make sure the right directory shows up (/HOME/cmake-3.18.5/bin/cmake)
Now put this path command in your .bashrc file and see if it works this time.

CMAKE opencv change build folder

i have a question (i suppose that it's stupid but i've difficult). I'm try to compile with cmake (not cmake-gui!!!) opencv. The problem is that i need to change the build folder. I give you an example:
I have the source code and the cmakelist on directory /home/xxx/opencv/
I would like to execute cmake and put the build into /home/yyy/lib_opencv/ and subsequently call make install....
With cmake-gui i don't have a problem. But i have to use the cmake command shell.
Can you help me? I hope that i have explained clearly the problem
First, create a directory you want build files to be in and cd there
mkdir /home/yyy/lib_opencv/
cd /home/yyy/lib_opencv/
Then just run cmake and point it to OpenCV source dir:
cmake /home/xxx/opencv/

How to set CMake search paths

In my CMakeLists.txt
include (CheckFunctionExists.cmake)
When I run ccmake (I am following the official tutorial)
CMake Error at CMakeLists.txt:10 (include):
include could not find load file:
CheckFunctionExists.cmake
However, I have the file specified:
sw3#pc90313-sw3:~/learn_cmake/build$ find / -name CheckFunctionExists.cmake 2>/dev/null
/usr/share/cmake-2.8/Modules/CheckFunctionExists.cmake
I am using a cmake installation form the Ubuntu 13.04 repository:
sw3#pc90313-sw3:~/learn_cmake/build$ cmake --version
cmake version 2.8.10.1
If the absolute path is specified, everything works out well and a working makefile is generated. However, this workaround is far from ideal (and diverges from the tutorial). Where could the problem be?
The path is called ${CMAKE_ROOT}. So the proper include command for system files is
include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
, mentioned later in the tutorial.

Problems with porting a fortran program from ubuntu to windows

I previously had some troubles updating old code that still needed a not supported compiler and expensive libraries to a version with gfortran in Eclipse on Windows. I let it rest for a while and recently I took a whole other approach, rebuilding the program from scratch, developping on a ubuntu machine, but now I want to bring it back to a windows machine so that my co-workers can contribute on it.
The status:
Program compiles, runs and gives good results on an ubuntu machine with the GCC GNU compiler
Windows 7 machine, 64bit
Cygwin installation (for gnu fortran) with lapack and liblapack-devel (however, I don't use these, because I compile blas and lapack manually)
(C:/cygwin/lib added to windows Path)
Original Issue:
The program compiles in cygwin (by calling the make-command, calling the make command with the makefile situated here: http://thijsvandenbrande.be/phd/hamfemInstall/makefile
This returns the file hamfem.exe which returns the following error when runned by double-clicking on it in windows: The program can't start because cyglapack-0.dll is missing from your computer. Try reinstalling the program to fix this problem.
When running the executable from cygwin, by calling the ./hamfem.exe command the executable starts to run. However, I want a solution so that I can give this executable to my co-workers so that they can change the input files (located in a folder in that has a relative path to the executable).
Going further on the comments below, I tried the next things:
Adding the exact path to the C:\cygwin\lib\lapack\cyglapack-0.dll file in windows path and even rebooting afterwards doesn't help.
adding a -static to the makefile before calling the library, resulting in dependency errors because I use two commands of the lapack library that depend on quite a lot of other commands (DPBTRF and DPBTRS). These commands are used in the mainprog.f90 module. The error: /usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../liblapack.a(dpbtrf.f.o): In function 'dpbtrf':
/usr/src/debug/lapack-3.4.2-1/SRC/dpbtrf.f:277: undefined reference to 'dtrsm_'
and a couple of more lines stating the dependencies.
add the liblapack.a file to the src folder, but compiler always goes back to the lapack in cygwin
On the website of lapack you can normally download the functions with their dependencies (example DPBTRF), but these are not available anymore. Does anyone have another idea how to include these two functions and their dependencies in a static library-file that I can compile beforehand and add to the src-folder?
Current (semi-)Fix
The next thing worked (a bit) for me: following the instructions on http://gcc.gnu.org/wiki/GfortranBuild to manually build libblas.a and liblapack.a in the /usr/src folder of Cygwin and refering to this folder in the makefile. The updated makefile can be found here: http://thijsvandenbrande.be/phd/hamfemInstall/makefileNew
The code compiles nicely on Windows by running the make command from cygwin (next step in the process, running it out of Eclipse) and i get a .exe file that can be run by double clicking it and that keeps running if I move it with its folder to another location. Because this process is quite labour intensive, figuring it all out, I added the answer here below, stating the commands you have to parse to cygwin in order to make it work.
For your information: my file structure looks like this (after the build, I move the .exe file one folder up, both in the linux version as the windows version):
hamfem.exe
in
input.txt
NGCR_building01.txt
out
(empty folder for output files of the routine)
src
hamfem.f90 (main file)
mainprog.f90 (file that contains the commands from lapack)
...(a bunch of other modules)
makefile
I figured things out myself, with some pointers from all over stackoverflow. In order for others to help them resolve similar issues, I would like my work method here so that the question is fully documented.
The issue can be resolved by clean building the Lapack library !and the Blas library on your local machine in cygwin and pasting the liblapack.a and libblas.a file to the library folder that you refer to in the makefile. The errors that were casted by calling Lapack staticly where a result of some routines of Blas used in the two commands.
These are the steps I followed:
download the lapack.tgz and blas.tgz files from the website and past them in the C:\Cygwin\usr\src folder
Extract these files with the following commands in cygwin:
cd /usr/src
tar -xvzf lapack.tgz
tar -xvzf blas.tgz
Build the two library files with the commands shown below in Cygwin. Compiling Lapack can take a while and will result in some errors in the end because of some missing links in the test files. These tests are run for accuracy tools. A more detailed look into the make.inc file is needed to resolve these issues.
cd $HOME
cd /usr/src/BLAS
make
mv blas_LINUX.a ../libblas.a
cd ../lapack-3.4.2
mv make.inc.example make.inc
make
mv liblapack.a ../liblapack.a
check the makefile included in this repository for the correct linking to the libraries. These should say /usr/src and -static -llapack -lblas, the other options are for the linux compiler.

Freeswitch mod_java installation problem

I am trying to install mod_java on ubuntu.
I have installed the latest java(1.6).
I have configured freeswitch with mod_java module enabled in module.conf.xml
then when i run the make file, it says:
freeswitch_java.h:5:17: error: jni.h: No such file or directory
I have searched through the java installtion folders, but did not find any include folder or jni.h.
Can anyone help, what is being the problem here.
Thanks for reading this question.
I had the same problem. The solution was to run configure with the option --with-java:
./configure --with-java=/usr/lib/jvm/java-1.6.0-openjdk/include/
I don't know if it makes any difference but I added mod_java after building freeswitch without it. It was disabled in my initial build in module.conf.xml but afterwards I ran the above command plus:
make mod_java-install
It worked for me on ubuntu with openjdk. Are you using the Sun JDK? Maybe in the version you have dont have the include folder which has the source files. Try installing the other JDK. Or try and see of ther are some other related packages in apt that will get you the include folder.
Type this linux command to locate your jni.h file on your filesystem.
locate jni.h
you should be able to get it somewhere
in /usr/lib/java directory or some other directory
depending upon your java home.
copy paste the jni.h in src/include folder of your freeswitch src.
It will throw you some more errors for different .h files
just copy all of them to your src/include folder.
in latest freeswitch, installing through Makefile, its not possible to configure as the Makefile downloads and installs. Its possible by modifying the Makefile.in file to add the include path
mod_java_la_CPPFLAGS
-I/usr/lib/jvm/default-java/include \

Resources