Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR installing java modular interface on cygwin #1146

Closed
grilomoto opened this issue Jun 4, 2013 · 11 comments
Closed

ERROR installing java modular interface on cygwin #1146

grilomoto opened this issue Jun 4, 2013 · 11 comments

Comments

@grilomoto
Copy link

i have just installed all of the cygwin and am trying to install shogun.
at first i had the error:

Checking for Java ... 1.7.0_21
Checking for Java native interface files (jni.h) ... javac not detected

i've tested javac on cygwin and noticed that cygwin wasn't recognizing javac then i've used:

export PATH=$PATH:"/cygdrive/C/Program Files/Java/jdk1.6.0_23/bin/"

and cygwin started to recognyze javac but i still have the error:

Checking for Java ... 1.7.0_21
Checking for Java native interface files (jni.h) ... dirname: extra operand Files' Trydirname --help' for more information.

Error: could not find java includes

and i can not find a way to solve this issue

@lisitsyn
Copy link
Member

lisitsyn commented Jun 4, 2013

Hey,

I'll try to reproduce it and find a way around tomorrow.

@lisitsyn
Copy link
Member

Hey, sorry for that long delay. I can reproduce the error on my machine. Will attempt to fix it.

@vigsterkr
Copy link
Member

@grilomoto could you test this now with the new cmake build system
clone the develop branch of shogun.

@grilomoto
Copy link
Author

I uninstalled and reinstalled the whole cygwin(java and javac commands were both working). Then I've tried to install the shogun version that is available to download in the site again, and the result was the following(from the part where it check for Java):

grilomoto@grilomoto-PC ~/shogun-2.1.0/src
$ ./configure
.
.
.
Checking for Java ... 1.7.0_17
Checking for Java native interface files (jni.h) ... dirname: extra operand Files\\Java\\jre7\r' Trydirname --help' for more information.
yes
Checking for Ant ... ant not detected
Checking for Mono C# ... not detected
Checking for Ruby ... 1.9.3p448
Checking for Ruby Developer Files ... yes
Checking for Ruby NArray ... not detected
Checking for Lua ... 5.1.5
Checking for SWIG ... 2.0.9

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING: SHOGUN is built using SVMlight which was written
by Thorsten Joachims and uses a different non GPL compatible license.
To build a fully GPL'd SHOGUN use

./configure --disable-svm-light

The SVMlight license can be found in LICENSE.SVMlight. In case
you do not know or cannot agree to the licensing terms expressed in
LICENSE.SVMlight press ctrl+c to abort configure now.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SHOGUN was configured for

libshogun and the following interfaces: cmdline_static python_static octave_static octave_modular python_modular lua_modular

interface(s) with the following configure options

It will support the following data types bool,char,uint8_t,uint16_t,int32_t,int64_t,uint64_t,float32_t,float64_t.

type "make" now to compile

When I try to configure explicitly to Java(apparently Java ain't configured because shogun can not find Java includes...):

grilomoto@grilomoto-PC ~/shogun-2.1.0/src
$ ./configure --interfaces=java_modular
Running configure for SHOGUN version 2.1.0
.
.
.
Checking for Java ... 1.7.0_17
Checking for Java native interface files (jni.h) ... dirname: extra operand Files\\Java\\jre7\r' Trydirname --help' for more information.

Error: could not find java includes

Check configure.log if you do not understand why it failed.
The last 20 lines of configure.log are shown below

 ^

ldd ./configure-10138-6120.o
ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll (0x76cb0000)
kernel32.dll => /cygdrive/c/Windows/system32/kernel32.dll (0x76a90000)
KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll (0x7fefcb40000)
cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)

Result is: yes
##########################################

============ Checking for libshogun ============
Result is: yes (internal in source tree)
##########################################

============ Checking for Java ============
Result is: 1.7.0_17
##########################################

============ Checking for Java native interface files (jni.h) ============

Then I downloaded the develop branch from github as suggested by @vigsterkr and followed the "GENERAL" instructions in the "INSTALL" file. And that was the result(the cmake part was ok but the make had an error):

grilomoto@grilomoto-PC ~/shogun-develop/src
$ cmake [options] ..
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find CCache (missing: CCACHE)
-- Performing Test HAS_CXX11_FLAG
-- Performing Test HAS_CXX11_FLAG - Success
-- Checking C++11 support for "func"
-- Checking C++11 support for "func": works
-- Checking C++11 support for "atomic"
-- Checking C++11 support for "atomic": works
-- Checking C++11 support for "auto"
-- Checking C++11 support for "auto": works
-- Checking C++11 support for "auto_ret_type"
-- Checking C++11 support for "auto_ret_type": works
-- Checking C++11 support for "class_override_final"
-- Checking C++11 support for "class_override_final": not supported
-- Checking C++11 support for "constexpr"
-- Checking C++11 support for "constexpr": works
-- Checking C++11 support for "cstdint"
-- Checking C++11 support for "cstdint": works
-- Checking C++11 support for "decltype"
-- Checking C++11 support for "decltype": works
-- Checking C++11 support for "initializer_list"
-- Checking C++11 support for "initializer_list": works
-- Checking C++11 support for "lambda"
-- Checking C++11 support for "lambda": works
-- Checking C++11 support for "long_long"
-- Checking C++11 support for "long_long": works
-- Checking C++11 support for "nullptr"
-- Checking C++11 support for "nullptr": works
-- Checking C++11 support for "regex"
-- Checking C++11 support for "regex": not supported
-- Checking C++11 support for "rvalue-references"
-- Checking C++11 support for "rvalue-references": works
-- Checking C++11 support for "sizeof_member"
-- Checking C++11 support for "sizeof_member": works
-- Checking C++11 support for "static_assert"
-- Checking C++11 support for "static_assert": works
-- Checking C++11 support for "variadic_templates"
-- Checking C++11 support for "variadic_templates": works
-- Using system's malloc
-- Looking for log2
-- Looking for log2 - found
-- Looking for powl
-- Looking for powl - not found
-- Looking for lgammal
-- Looking for lgammal - not found
-- Looking for sqrtl
-- Looking for sqrtl - not found
-- Looking for xmmintrin.h
-- Looking for xmmintrin.h - found
-- Looking for emmintrin.h
-- Looking for emmintrin.h - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Found PkgConfig: /usr/bin/pkg-config.exe (found version "0.27.1")
-- Looking for sgemm

-- Looking for sgemm
- found
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Looking for clapack_dpotrf in /usr/lib/liblapack.dll.a
-- Looking for clapack_dpotrf in /usr/lib/liblapack.dll.a - not found
-- Could NOT find ATLAS (missing: ATLAS_LIBRARIES ATLAS_INCLUDES)
-- Found CBLAS: /lib/libgslcblas.dll.a
-- Looking for cblas_dsyrk in /lib/libgslcblas.dll.a
-- Looking for cblas_dsyrk in /lib/libgslcblas.dll.a - found
-- Found GLPK: /lib/libglpk.dll.a
-- Could NOT find CPLEX (missing: CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
-- Found Arpack : /usr/lib/libarpack.dll.a
-- Could NOT find Eigen3 (missing: EIGEN_INCLUDE_DIR) (Required is at least version "3.1.2")
-- Performing Test HAVE_MEM_USAGE_T_EXPANSIONS
-- Performing Test HAVE_MEM_USAGE_T_EXPANSIONS - Failed
-- Performing Test SUPERLU_MIN_VERSION_4_3
-- Performing Test SUPERLU_MIN_VERSION_4_3 - Failed
-- Could NOT find SuperLU (missing: SUPERLU_INCLUDE_DIR SUPERLU_LIBRARY)
-- Could NOT find NLOPT (missing: NLOPT_LIBRARY NLOPT_INCLUDE_DIR)
-- Could NOT find LPSOLVE (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_DIR)
-- Found Doxygen: /usr/bin/doxygen.exe (found version "1.8.4")
-- Found PythonInterp: /usr/bin/python (found version "2.7.5")
-- checking for one of the modules 'libjson>=0.11;json>=0.11;json-c>=0.11'
-- Found LibXml2: /usr/lib/libxml2.dll.a (found version "2.9.1")
-- Found HDF5: debug;/usr/lib/libhdf5.dll.a;optimized;/usr/lib/libhdf5.dll.a
-- Found ZLIB: /usr/lib/libz.dll.a (found version "1.2.8")
-- Found BZip2: /usr/lib/libbz2.dll.a (found version "1.0.6")
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.dll.a
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.dll.a - found
-- Could NOT find LibLZMA (missing: LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET)
-- Could NOT find SNAPPY (missing: SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
-- Lzo Library /usr/lib/liblzo2.dll.a
-- Lzo Include Found in /usr/include
-- Spinlock support not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/grilomoto/shogun-develop/src

grilomoto@grilomoto-PC ~/shogun-develop/src
$ make
Scanning dependencies of target class_list
[ 0%] Generating /home/grilomoto/shogun-develop/src/shogun/base/class_list.cpp
[ 0%] Built target class_list
Scanning dependencies of target version
[ 1%] Generating version header
CMake Error at /home/grilomoto/shogun-develop/cmake/version.cmake:48 (EXECUTE_PROCESS):
execute_process given COMMAND argument with no value.

src/shogun/CMakeFiles/version.dir/build.make:52: recipe for target src/shogun/CMakeFiles/version' failed make[2]: *** [src/shogun/CMakeFiles/version] Error 1 CMakeFiles/Makefile2:147: recipe for targetsrc/shogun/CMakeFiles/version.dir/all' failed
make[1]: *** [src/shogun/CMakeFiles/version.dir/all] Error 2
Makefile:136: recipe for target `all' failed
make: *** [all] Error 2

@vigsterkr
Copy link
Member

@grilomoto thanks for getting back to us so soon!
unfortunately the build instructions are still outdated in the INSTALL for the new cmake system.

so what you would need to run cmake build with the develop branch:

git clone https://github.com/shogun-toolbox/shogun.git
cd shogun
mkdir build
cd build
cmake -DJavaModular=ON -DBUILD_EXAMPLES=ON ..
make

could you copy-paste the output of this if there's still an error

@grilomoto
Copy link
Author

grilomoto@grilomoto-PC ~
$ git clone https://github.com/shogun-toolbox/shogun.git
Cloning into 'shogun'...
remote: Counting objects: 115671, done.
remote: Compressing objects: 100% (24965/24965), done.
remote: Total 115671 (delta 93739), reused 110459 (delta 90212)
Receiving objects: 100% (115671/115671), 37.14 MiB | 584 KiB/s, done.
Resolving deltas: 100% (93739/93739), done.

grilomoto@grilomoto-PC ~
$ cd shogun

grilomoto@grilomoto-PC ~/shogun
$ mkdir build

grilomoto@grilomoto-PC ~/shogun
$ cd build

grilomoto@grilomoto-PC ~/shogun/build
$ cmake -DJavaModular=ON -DBUILD_EXAMPLES=ON ..
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find CCache (missing: CCACHE)
-- Found SWIG: /usr/bin/swig.exe (found suitable version "2.0.9", minimum required is "2.0.4")
-- Performing Test HAS_CXX11_FLAG
-- Performing Test HAS_CXX11_FLAG - Success
-- Checking C++11 support for "func"
-- Checking C++11 support for "func": works
-- Checking C++11 support for "atomic"
-- Checking C++11 support for "atomic": works
-- Checking C++11 support for "auto"
-- Checking C++11 support for "auto": works
-- Checking C++11 support for "auto_ret_type"
-- Checking C++11 support for "auto_ret_type": works
-- Checking C++11 support for "class_override_final"
-- Checking C++11 support for "class_override_final": not supported
-- Checking C++11 support for "constexpr"
-- Checking C++11 support for "constexpr": works
-- Checking C++11 support for "cstdint"
-- Checking C++11 support for "cstdint": works
-- Checking C++11 support for "decltype"
-- Checking C++11 support for "decltype": works
-- Checking C++11 support for "initializer_list"
-- Checking C++11 support for "initializer_list": works
-- Checking C++11 support for "lambda"
-- Checking C++11 support for "lambda": works
-- Checking C++11 support for "long_long"
-- Checking C++11 support for "long_long": works
-- Checking C++11 support for "nullptr"
-- Checking C++11 support for "nullptr": works
-- Checking C++11 support for "regex"
-- Checking C++11 support for "regex": not supported
-- Checking C++11 support for "rvalue-references"
-- Checking C++11 support for "rvalue-references": works
-- Checking C++11 support for "sizeof_member"
-- Checking C++11 support for "sizeof_member": works
-- Checking C++11 support for "static_assert"
-- Checking C++11 support for "static_assert": works
-- Checking C++11 support for "variadic_templates"
-- Checking C++11 support for "variadic_templates": works
-- Using system's malloc
-- Looking for log2
-- Looking for log2 - found
-- Looking for powl
-- Looking for powl - not found
-- Looking for lgammal
-- Looking for lgammal - not found
-- Looking for sqrtl
-- Looking for sqrtl - not found
-- Looking for xmmintrin.h
-- Looking for xmmintrin.h - found
-- Looking for emmintrin.h
-- Looking for emmintrin.h - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Found PkgConfig: /usr/bin/pkg-config.exe (found version "0.27.1")
-- Looking for sgemm

-- Looking for sgemm
- found
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Looking for clapack_dpotrf in /usr/lib/liblapack.dll.a
-- Looking for clapack_dpotrf in /usr/lib/liblapack.dll.a - not found
-- Could NOT find ATLAS (missing: ATLAS_LIBRARIES ATLAS_INCLUDES)
-- Found CBLAS: /lib/libgslcblas.dll.a
-- Looking for cblas_dsyrk in /lib/libgslcblas.dll.a
-- Looking for cblas_dsyrk in /lib/libgslcblas.dll.a - found
-- Found GLPK: /lib/libglpk.dll.a
-- Could NOT find CPLEX (missing: CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
-- Found Arpack : /usr/lib/libarpack.dll.a
-- Could NOT find Eigen3 (missing: EIGEN_INCLUDE_DIR) (Required is at least version "3.1.2")
-- Could NOT find NLOPT (missing: NLOPT_LIBRARY NLOPT_INCLUDE_DIR)
-- Could NOT find LPSOLVE (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_DIR)
-- Could NOT find ColPack (missing: COLPACK_LIBRARIES COLPACK_LIBRARY_DIR COLPACK_INCLUDE_DIR)
-- Found Doxygen: /usr/bin/doxygen.exe (found version "1.8.4")
-- Found PythonInterp: /usr/bin/python (found version "2.7.5")
-- checking for one of the modules 'libjson>=0.11;json>=0.11;json-c>=0.11'
-- Found LibXml2: /usr/lib/libxml2.dll.a (found version "2.9.1")
-- Found HDF5: debug;/usr/lib/libhdf5.dll.a;optimized;/usr/lib/libhdf5.dll.a
-- Found ZLIB: /usr/lib/libz.dll.a (found version "1.2.8")
-- Found BZip2: /usr/lib/libbz2.dll.a (found version "1.0.6")
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.dll.a
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.dll.a - found
-- Could NOT find LibLZMA (missing: LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET)
-- Could NOT find SNAPPY (missing: SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
-- Lzo Library /usr/lib/liblzo2.dll.a
-- Lzo Include Found in /usr/include
-- Spinlock support not found
-- Found Java: /cygdrive/c/Windows/system32/java.exe (found version "1.7.0.17")
CMake Error at /usr/share/cmake-2.8.11.2/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-2.8.11.2/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8.11.2/Modules/FindJNI.cmake:249 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:594 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

@vigsterkr
Copy link
Member

do you have the full java SDK installed?
from this error message i suspect that cmake couldn't find your JAVA_HOME.
for example in case of openjdk you would need to set the JAVA_HOME environment to point to your SDK root:

JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64 cmake -DJavaModular=ON -DBUILD_EXAMPLES=ON ..

but of course in your case i don't know where the JAVA_HOME actually is

@grilomoto
Copy link
Author

I do have the full JDK but it is on windows (cygwin don't have java it uses the one on windows).

ok i will try to set JAVA_HOME as soon as i find its path for cygwin through windows...

@grilomoto
Copy link
Author

I've set JAVA_HOME and the error stood the same

@vigsterkr
Copy link
Member

where's your libawt.so and libjvm.so ? or i guess it would be libjvm.dll and libjvm.dll on windows...

@grilomoto
Copy link
Author

Sorry for the time it took for me to answer, I was reinstalling java as well as cygwin and resetting all of the environment variables related to java... And the same error happens again. There is no libawt or libjvm, there is however a awt.dll and a jvm.dll. And they are both in jre\bin whose path already is on the class_path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants