How to fix "Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)" - cocos2d-x

It appears you are building natively for Linux with GCC
Cocos2dx on Linux : "cmake -G 'CodeBlocks - Unix Makefiles'
-- OpenGL include dirs: /usr/include
CMake Error at /usr/local/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)
Call Stack (most recent call first):
/usr/local/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.4/Modules/FindGLEW.cmake:44 (find_package_handle_standard_args)
cocos2d/cmake/Modules/CocosBuildHelpers.cmake:44 (find_package)
cocos2d/CMakeLists.txt:190 (cocos_find_package)
-- Configuring incomplete, errors occurred!
See also "/home/daw/Dev/cocos2d-x-3.9/allProject/testC/CMakeFiles/CMakeOutput.log".

It's quite an old question but I was looking for solution of the same issue and came here, so maybe my answer will help someone in future.
In Ubuntu 17.10 it was enough to install libglew-dev package to solve this
sudo apt install libglew-dev

Download The OpenGL Extension Wrangler Library and add include and lib path in cmake project file.
For example:
set(GLEW_INCLUDE_DIR, "/glew-2.0.0/include/")
set(GLEW_LIBRARY, "/glew-2.0.0/lib")
Hope this helps.

Related

Installation using Jekyll fails on OS Mojave 10.14.5

I have an issue installing Jekyll, because ffi is not working:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.6.0/gems/ffi-1.11.1/ext/ffi_c
/usr/local/opt/ruby/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190721-87601-s2b792.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... yes
creating extconf.h
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.6.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.6.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR="
Configuring libffi
configure: error: in `/usr/local/lib/ruby/gems/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi-x86_64-darwin18':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make: *** ["/usr/local/lib/ruby/gems/2.6.0/gems/ffi-1.11.1/ext/ffi_c/libffi-x86_64-darwin18"/.libs/libffi_convenience.a] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.6.0/gems/ffi-1.11.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0/ffi-1.11.1/gem_make.out
It seems like ffi-1.11.1 is not working with jekyll. Has anyone been successful in installing jekyll? I'm using OS Mojave version 10.14.5.
Please check out this issue in the ffi repo and also this issue on Github which might be helpful, even if the error is slightly different this might be a trace to start for you.
Also, the solution and explanation provided in this issue looks very promising:
Finally I realised that I had a version of Xcode that was not updated because High Sierra is too older to support the lastest version (Thank you Apple...).
So I tried to enter the command gcc -v and I saw this line :
Apple LLVM version 8.0.0 (clang-800.0.38).
That was the problem ! Even If I installed the latest Xcode Command Line Developer Tools, the old gcc provided with Xcode was still used.
I entered the command xcode-select -s /Library/Developer/CommandLineTools/ and the command gcc -v displayed the new version :
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
High Sierra and Mojave might have the same issue with outdated xcode stuff here.

json.hpp required on linux

Hi I'm trying to install packet on Ubuntu 18.04 LTS but when I use the command cmake ../ I receive the message:
-- Poco_VERSION: 1.8.0
-- Poco_INCLUDE_DIRS:
-- Poco_LIBRARIES: Poco::Foundation;Poco::Util;Poco::XML;Poco::Net
-- Build type not specified: defaulting to release.
CMake Error at CMakeLists.txt:25 (message):
LoRa toolkit requires json.hpp, skipping...
-- Configuring incomplete, errors occurred!
See also "/home/jayme/LoRa-SDR/build/CMakeFiles/CMakeOutput.log".
See also "/home/jayme/LoRa-SDR/build/CMakeFiles/CMakeError.log".`
I have already installed json.hpp using git clone in this link: https://github.com/nlohmann/json.git but didn't work.
Assuming you try to build https://github.com/myriadrf/LoRa-SDR according to their README.md's instructions and have already successfully installed Pothos, I can reproduce you above error message.
As you already noticed, the problem is that json.hpp cannot be found. Cloning the repository is only the first step to solving this. Assuming you don't want a systemwide installation of json.hpp I would add include/ of the json project to cmake's search paths by specifying it on the command line:
cmake -DCMAKE_INCLUDE_PATH=/full/path/to/json/include ../

Compiling MySQL 5.7.20 in CentOS 7 Issues (A Lot)

I am trying to setup a MySQL server using CentOS (No GUI) and I need to switch to OpenSSL instead of YaSSL in order to have access to the encryption tools.
The issues happen when runing the cmake. At first I got the error that cmake was not able to find boost, I fixed this adding the parameter -DWITH_BOOST.
The cmake line is as follows.
cmake . -DWITH_READLINE=ON -DWITH_SSL=system -DWITH_BOOST=/usr/local/src/mysql-5.7.20/boost/
After the adjustment I ran again the CMAKE the I got several errors.
SSL Error, cmake can not find the OpenSSL files. I checked if the library was installed, I also downloaded the tar.gz file and decompress it and pointed the cmake to the folder, none of this worked.
Can not find NUMA libraries, again I checked and it is installed, at this point I ran the system update to check for everything but this did not solve the issue.
Can not find the ncurses, the same thing, is on the system but for some reason cmake is not able to find those.
Can not fin libaio, I didn't have this one installed, I installed, ran cmake again, and again cmake was not able to find it.
I been looking around, trying to figure out all this issues, I've been joining information from different websites but still not able to figure out this.
Thanks ahead to everyone for the help.
You're facing the dependencies hell with MySQL. If you don't really need to compile from the sources, you still can install with the RPM which is much easier. The RPM method is described here : https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
As you're asking a ready-to-go install from the sources, this is what I just did and it worked, on a fresh CentOS 7.4 minimal, 2 vcpus 3Gb :
yum group install -y 'Development Tools'
yum install -y cmake ncurses-devel curl
curl -Ovk https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.20.tar.gz
tar zxf mysql-5.7.20.tar.gz
cd mysql-5.7.20
cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=$HOME/boost -DENABLE_DOWNLOADS=1
make -j2
make install
After that you need to configure it, add the startup scripts, and of course secure it. Here are some additional docs :
http://howtolamp.com/lamp/mysql/5.6/installing/
https://dev.mysql.com/doc/refman/5.7/en/mysql-secure-installation.html
Perhaps try make clean; cmake clean; ldconfig then run your cmake command. Sometimes the system can't find the shared libraries, and ldconfig refreshes the library search path. This helped once when I was compiling something (emscripten?) which required a lot of libraries which I was installing as compilation errors arose.
The make clean; cmake clean will ensure that the compiler isn't looking at the old library search path when you recompile.

"/usr/bin/ld: cannot find -lopenblas" error in Caffe compilation

When I was compiling Caffe, I had this error, despite OpenBLAS is installed:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: cannot find -lopenblas
collect2: ld devolvió el estado de salida 1
make: *** [.build_release/lib/libcaffe.so] Error 1
Is there a solution for it?
Including the base packs even after cloning OpenBlas and making will link the appropriate libraries in 14.04 and 16.
apt install liblapack-dev liblapack3 libopenblas-base libopenblas-dev
apt install liblapack-dev liblapack3 libopenblas-base libopenblas-dev
I faced the same problem. Even adding library directory "/opt/OpenBLAS/lib/" to ldconfig cache didn't help (as my libopenblas.so is at "/opt/OpenBLAS/lib/libopenblas.so").
Using cmake helped me. Try this from caffe root directory:
mkdir build
cd build
cmake -DBLAS=open ..
make all
make runtest
If you need to use make, add the symlink of libopenblas.so to /usr/lib. I did the following:
ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/libopenblas.so
I saw the similar problem (I'm compiling caffe again for some reason).
I found the library file the builder is looking for (-lcblas or -latlas means libcblas.so and libatlas.so) are under /usr/lib64/atlas. So just added symbolic links under /usr/lib64 like this.
sudo ln /usr/lib64/atlas/libcblas.so.3.0 /usr/lib64/libcblas.so
sudo ln -s /usr/lib64/atlas/libatlas.so.3.0 /usr/lib64/libatlas.so
But I guess more proper method is to set Makefile.config (the CBLAS path). (I thought the default path will do away with it reading the comment saying so, but it did not.) Hope this helps anyone.

Geant4 does not find Expat library

I'm trying to install Geant4 10.00 on Linux Mint 15. I have the unzipped geant4 file geant4.10.00.p01 in the directory I made:
/home/mickmau5/Geant4
along with the required build file geant4.10.00-build.
This site goes throught the installation process http://goo.gl/nzxpQG . I'm at the lengthy cmake command part and getting this error
mickmau5#linuxmint ~/Geant4/geant4.10.00-build $ cmake -DCMAKE_INSTALL_PREFIX=/home/mickmau5/Geant4/geant4.10.00.p01-install /home/mickmau5/Geant4/geant4.10.00.p01
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindEXPAT.cmake:50 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/Modules/Geant4OptionalComponents.cmake:71 (find_package)
CMakeLists.txt:78 (include)
-- Configuring incomplete, errors occurred!
Seems like I ought to download some things.
Thanks for any help!
From the Geant4 documentation:
GEANT4_USE_SYSTEM_EXPAT (DEFAULT : ON)
If set to ON, build Geant4 with an external install of Expat. In this
case, the Expat headers and library will be searched for under the
standard system paths. If these are not sufficient to locate the
required Expat installation, see the Advanced EXPAT_INCLUDE_DIR and
EXPAT_LIBRARY options.
Whilst Expat is installed on the vast majority of systems, it may be
missing in certain instances. In these cases, simply switch this
option to OFF and Geant4 will build and use its internal version of
Expat.
REQUIRES : Expat library and headers.
I had the same problem and I could fix it by downloading the expat-devel library.
To install expat-devel package (dnf package manager):
dnf install expat-devel