Anyone with knowledge on Cygwin? (+Shogun)

Hi Guys!
Im having a major problem with Cygwin.

I decided to use an api called ShoGun
http://www.shogun-toolbox.org/page/home/

Anyway, i downloaded and then i installed Cygwin.

On Cygwin i downloaded a package of stuff… Python,G++, Cmake,make etc.

So when i tried to build with Cygwin, i got this :
http://pastebin.com/rJJjPC4h

I emailed the Devs and they told me to try this :
http://pastebin.com/BF5UqbyF

Problem is, i have little knowledge on C++
And no knowledge on Cygwin.

If theres anyone on forum who can at least guide or help me, i would appreciate so much, im completely lost.

PS : I decided to post here because i know there are mass dev’s here, besides i dont know/trust other java forums who are friendly as in here. Or maybe i guess i do like here…

I believe the easiest approach in this situation would be to edit the CMakeLists.txt file in the top level Shogun source directory. Do a search for a line at the top that looks like:


SET(CMAKE_CXX_FLAGS "")

You can add the flag there which would make the line look like:


SET(CMAKE_CXX_FLAGS "-U__STRICT_ANSI__")

This should apply the flag to the compiler as well as the linker for the build process. Unfortunately I don’t have a full cygwin environment installed here at work, so I’m not able to test it at the moment.

Cygwin is best avoided…

The description sounds like a GCC (version) issue.

Thanks for the replies guys.
CodeHead :
http://pastebin.com/9PXTYCMx

There are some if’s that contain that SET command… which one should i actually change?

Roquen, im not sure, it may be…

Riven, what are my options? MinGw instead?

Search “CMAKE_CXX_FLAGS” (22 hits in 1 file)
D:\shogun-3.2.0\CMakeLists.txt (22 hits)
Line 22: SET(CMAKE_CXX_FLAGS “${CCACHE_FLAGS} ${CMAKE_CXX_FLAGS}”)
Line 22: SET(CMAKE_CXX_FLAGS “${CCACHE_FLAGS} ${CMAKE_CXX_FLAGS}”)
Line 116: SET(CMAKE_CXX_FLAGS “${COMPILER_WARNINGS} -g ${CMAKE_CXX_FLAGS}”)
Line 116: SET(CMAKE_CXX_FLAGS “${COMPILER_WARNINGS} -g ${CMAKE_CXX_FLAGS}”)
Line 118: SET(CMAKE_CXX_FLAGS_RELEASE “-O3 ${RELEASE_COMPILER_FLAGS}”)
Line 120: SET(CMAKE_CXX_FLAGS_DISTRIBUTION “-O2”)
Line 131: SET(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} --coverage”)
Line 131: SET(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} --coverage”)
Line 199: SET(CMAKE_CXX_FLAGS “${CXX11_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}”)
Line 199: SET(CMAKE_CXX_FLAGS “${CXX11_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}”)
Line 206: SET(CMAKE_CXX_FLAGS “${CXX11_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}”)
Line 206: SET(CMAKE_CXX_FLAGS “${CXX11_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}”)
Line 217: SET(CMAKE_CXX_FLAGS “-stdlib=libstdc++ ${CMAKE_CXX_FLAGS}”)
Line 217: SET(CMAKE_CXX_FLAGS “-stdlib=libstdc++ ${CMAKE_CXX_FLAGS}”)
Line 233: SET(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -march=native”)
Line 233: SET(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -march=native”)
Line 246: SET(CMAKE_CXX_FLAGS “${EXTERNAL_MALLOC_CFLAGS} ${CMAKE_CXX_FLAGS}”)
Line 246: SET(CMAKE_CXX_FLAGS “${EXTERNAL_MALLOC_CFLAGS} ${CMAKE_CXX_FLAGS}”)
Line 254: SET(CMAKE_CXX_FLAGS “${EXTERNAL_MALLOC_CFLAGS} ${CMAKE_CXX_FLAGS}”)
Line 254: SET(CMAKE_CXX_FLAGS “${EXTERNAL_MALLOC_CFLAGS} ${CMAKE_CXX_FLAGS}”)
Line 527: set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}”)
Line 527: set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}”)

The ones you have listed are basically adding values, if you want to be thorough use this at the beginning

SET(CMAKE_CXX_FLAGS “-U__STRICT_ANSI__ ${CMAKE_CXX_FLAGS}”")

Any previous settings won’t be lost

${CMAKE_CXX_FLAGS}" just adds the previous value of CMAKE_CXX_FLAGS to the end of what you want to add.

If you were using GCC 3.x this problem wouldn’t occur. MinGw will have the same issue. Depending on your perspective you could place the blame about anywhere. Cygwin for using NewLib, GCC for changing behavior, the devs for their cmake script or option choices or for the fact that their using stdio in C++. Undefining STRICT_ANSI is a really ugly hack…but hey…if it works!

Why its an ugly hack? :smiley:

Bottom line: don’t worry about it if doing it works.

It’s an ugly hack because it’s an automatically defined macro by the compiler depending on the passed in command line parameters:

https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

Hm, looks like I may have grabbed a different version of the lib. The CMakeLists.txt posted on the paste bin is different from the copy that I had here. Either way, ziozio is correct. Cmake is appending values to the flags variable, so adding the line before the # CCACHE section would probably be an optimal placement.

Since I’m assuming you’re doing some *nix based programming, I’ll pose this thought. Have you considered creating a live CD/USB with a base version of Linux and the development tool chain? It’s not guaranteed to keep issues like this from happening, but it does provide a slightly more reliable environment.

Meh…if you don’t want good 3D accel…just do virtual box. Feature wise it’s better than a real install.

Six of one, half a dozen of the other. :wink: Live CDs/USBs just tend to be less intrusive and a lot more portable since there is nothing to install on the hard drive. I’ve had good experiences with both. :slight_smile:

I think it worked. Although im not being able to generate the java interface.
I did this :
OPTION(JavaModular “Java Modular” ON)

then i did the instructions. But theres no java interface there.
I think its not looking for the JDK in the right place.

http://pastebin.com/7gsYShmZ

I did cmake -DJavaModular=on

Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found version “1.8.0.25”)

Looking at line 1052 in the file that you posted last, it would appear that cmake is referencing the FindJava.cmake file in the shogun-x.x.x/cmake folder. Editing the “set(_JAVA_PATHS … )” section of the file should allow you to add the path where you have your copy of Java installed into its search locations. Once that’s done, give the compilation process another shot.

http://pastebin.com/hKFNzs6S

Im not sure where to change…

The path is this one
C:\Program Files\Java\jdk1.8.0_31

Im trying this :

# Hard-coded guesses should still go in PATHS. This ensures that the user
# environment can always override hard guesses.
set(_JAVA_PATHS
  /usr/lib/java/bin
  /usr/share/java/bin
  /usr/local/java/bin
  /usr/local/java/share/bin
  /usr/java/j2sdk1.4.2_04
  /usr/lib/j2sdk1.4-sun/bin
  /usr/java/j2sdk1.4.2_09/bin
  /usr/lib/j2sdk1.5-sun/bin
  /opt/sun-jdk-1.5.0.04/bin
  /cygdrive/c/Progra~1/Java/jdk1.8.0_31/bin
   C:/Program Files/Java/jdk1.8.0_31/bin
  )

New Error :

André V Lopes@MasterRevan /cygdrive/d/shogun-4.0.0
$ cmake -DJAVAMODULAR=on
CMake Warning at /usr/share/cmake-2.8.11.2/Modules/Platform/CYGWIN.cmake:15 (mes                                        sage):
  CMake no longer defines WIN32 on Cygwin!

  (1) If you are just trying to build this project, ignore this warning or
  quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
  the CMake cache.  If later configuration or build errors occur then this
  project may have been written under the assumption that Cygwin is WIN32.
  In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.

  (2) If you are developing this project, add the line

    set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required

  at the top of your top-level CMakeLists.txt file or set the minimum
  required version of CMake to 2.8.4 or higher.  Then teach your project to
  build on Cygwin without WIN32.
Call Stack (most recent call first):
  /usr/share/cmake-2.8.11.2/Modules/CMakeSystemSpecificInformation.cmake:36 (inc                                        lude)
  CMakeLists.txt:7 (project)


-- Found CCache: /usr/bin/ccache.exe
-- Using system's malloc
-- Could NOT find GDB (missing:  GDB_COMMAND GDB_VERSION)
-- Could NOT find MOSEK (missing:  MOSEK_DIR MOSEK_INCLUDE_DIR MOSEK_LIBRARY)
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Could NOT find ATLAS (missing:  ATLAS_LIBRARIES ATLAS_INCLUDES)
-- Could NOT find CBLAS (missing:  CBLAS_LIBRARY)
-- Could NOT find GLPK (missing:  GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERS                                        ION_FOUND)
-- Could NOT find CPLEX (missing:  CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
-- Could NOT find Eigen3 (missing:  EIGEN_INCLUDE_DIR) (Required is at least ver                                        sion "3.1.2")
-- Could NOT find OPENCL (missing:  OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
-- Could NOT find ViennaCL (missing:  VIENNACL_INCLUDE_DIR OPENCL_INCLUDE_DIRS O                                        PENCL_LIBRARIES) (Required is at least version "1.5.0")
-- 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 COLPA                                        CK_INCLUDE_DIR)
-- Could NOT find ARPREC (missing:  ARPREC_LIBRARIES ARPREC_INCLUDE_DIR)
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Could NOT find HDF5 (missing:  HDF5_INCLUDE_DIRS)
-- Could NOT find CURL (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
-- Could NOT find SNAPPY (missing:  SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
-- Lzo includes and libraries NOT found.
-- Spinlock support not found
-- Could NOT find PROTOBUF (missing:  PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
-- NO supported backend(s) for linear algebra libraries found
-- Found Java: C:/Program Files/Java/jdk1.8.0_25/jre/bin/java.exe (found version                                         "1.8.0.25")
CMake Error at /usr/share/cmake-2.8.11.2/Modules/FindPackageHandleStandardArgs.c                                        make: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 (_FP                                        HSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8.11.2/Modules/FindJNI.cmake:249 (FIND_PACKAGE_HANDLE_STAND                                        ARD_ARGS)
  CMakeLists.txt:1053 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!

André V Lopes@MasterRevan /cygdrive/d/shogun-4.0.0
$

I Tried This :

http://pastebin.com/TCDbda5q

-- Spinlock support not found
-- Could NOT find PROTOBUF (missing:  PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
-- NO supported backend(s) for linear algebra libraries found
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:266 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:1053 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!

It appears that it’s failing to find the jawt.lib and jvm.lib files. Looking at some postings about the issue, maybe the following will help it find what it needs:


JAVA_HOME=C:/Program Files/Java/jdk1.8.0_25 cmake -DJavaModular=ON

My hunch is that it’s searching for the libraries in the jre folder instead of the jdk folder. Setting the environment variable before starting the build process should cause it to look in the correct location. Tracing down compilation errors can feel like going down a rabbit hole at times. :o