I am trying to build 1.1.1g of OpenSSL.
I have tried under MSYS2 and MinGW64.
How do I resolve ?
MSys2 Build:
cd '${workspace_loc:/${project_name}}'; \
export MSYS=/D/msys64; \
export CC=' \
/D/msys64/mingw32/bin/gcc.exe -D_WIN32 -m32 -static \
-L/usr/lib \
'; \
export PATH=\
:/d/msys64/mingw32/i686-w64-mingw32/bin:\
:/d/msys64/mingw32/bin:\
:/usr/local/bin:\
perl Configure mingw shared no-hw no-asm no-md2 --prefix=`pwd` --openssldir=`pwd`; \
echo make depend; make; \
echo mingw32-make depend; mingw32-make; \
make Makefile openssl.pc libssl.pc libcrypto.pc build_libs build_apps build_tools
Output:
Configuring OpenSSL version 1.1.1g (0x1010107fL) for mingw
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
make depend
perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
perl "-I." -Mconfigdata "util/dofile.pl" \
"-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
make depend && make _all
make[1]: Entering directory '/d/Develop/WorkspaceCCpp/openssl-1.1.1g'
make[1]: Leaving directory '/d/Develop/WorkspaceCCpp/openssl-1.1.1g'
make[1]: Entering directory '/d/Develop/WorkspaceCCpp/openssl-1.1.1g'
perl util/mkbuildinf.pl " /D/msys64/mingw32/bin/gcc.exe -D_WIN32 -m32 -static -L/usr/lib -m32 -Wall
-O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_PIC -DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN -D_MT
-DOPENSSL_USE_APPLINK -DNDEBUG" "mingw" > crypto/buildinf.h
/D/msys64/mingw32/bin/gcc.exe -D_WIN32 -m32 -static -L/usr/lib -I. -Iinclude -Icrypto -m32 -Wall -
O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/d/Develop/WorkspaceCCpp/openssl-1.
1.1g\"" -DENGINESDIR="\"/d/Develop/WorkspaceCCpp/openssl-1.1.1g/lib/engines-1_1\"" -DUNICODE -D_UNIC
ODE -DWIN32_LEAN_AND_MEAN -D_MT -DOPENSSL_USE_APPLINK -DNDEBUG -MMD -MF crypto/cversion.d.tmp -MT c
rypto/cversion.o -c -o crypto/cversion.o crypto/cversion.c
In file included from D:/msys64/mingw32/i686-w64-mingw32/include/crtdefs.h:10,
from D:/msys64/mingw32/i686-w64-mingw32/include/stddef.h:7,
from D:/msys64/mingw32/lib/gcc/i686-w64-mingw32/10.1.0/include/stddef.h:1,
from /mingw32/include/stdlib.h:55,
from include/internal/cryptlib.h:13,
from crypto/cversion.c:10:
D:/msys64/mingw32/i686-w64-mingw32/include/corecrt.h:128:18: error: expected ';' before 'typedef'
128 | __MINGW_EXTENSION typedef __int64 __time64_t;
| ^~~~~~~~
| ;
In file included from /mingw32/include/time.h:45,
from include/openssl/crypto.h:15,
from include/internal/cryptlib.h:22,
from crypto/cversion.c:10:
/mingw32/include/sys/types.h:149:23: error: conflicting types for 'time_t'
149 | typedef __time32_t time_t;
| ^~~~~~
...
...
...
D:/msys64/mingw32/i686-w64-mingw32/include/corecrt.h:143:20: note: previous declaration of 'time_t'
was here
143 | typedef __time64_t time_t;
| ^~~~~~
make: *** [Makefile:2406: crypto/cversion.o] Error 1
One solution is to not build under MSys2 and Choose MinGW64 instead.
Then...
\mingw64\mingw32\msys\1.0\bin\bash.exe
Then...
(1)
--login -i -c "
cd '${workspace_loc:/${project_name}}';
export CC='/D/msys64/mingw32/bin/gcc.exe -DWIN32_LEAN_AND_MEAN -D_WIN32 -D_WIN64=0 -m32 -static -D_TIME_T_DEFINED -L/usr/lib';
-L/usr/lib
';
export PATH=
:/C/Perl64/bin:
:/d/msys64/mingw32/i686-w64-mingw32/bin:
:/d/msys64/mingw32/bin:
:/usr/local/bin:
$PATH;
echo PATH is: $PATH;
./Configure mingw no-shared no-asm no-md2 --prefix=pwd --openssldir=pwd;
make depend;
make
"
It then builds to completion.
NOTE: The path prepend for a newer Perl than the in-built MinGW64 Perl.
Related
I am currently trying to link Bonmin using cmake in my project under macOS High Sierra (10.13.4) with Xcode version 9.3. Before I describe the setup I should mention that the Bonmin example (/PATH_TO_BONMIN/Bonmin/examples/CppExample) compiles with the included make files. Later example I try to get to work in my environment, but it is not working. Thus, I think there must be an incompatibility.
Bonmin 1.8 (https://www.coin-or.org/Tarballs/Bonmin/) was build on my Mac using
../configure -C --disable-shared F77="/usr/local/bin/gfortran" FFLAGS="-fexceptions -m64 -fbackslash" CFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64"
My FindBonmin.cmake uses the package configuration files from "${BONMIN_LIBRARY_DIR}/pkgconfig":
find_path(BONMIN_LIBRARY_DIR
NAMES libbonmin.a
HINTS ...
HINTS /usr/local/include/coin
HINTS ${BONMIN_ROOT_DIR}/include/coin
HINTS ${BONMIN_ROOT_DIR}/include
)
if(IS_DIRECTORY "${BONMIN_LIBRARY_DIR}/pkgconfig")
set(CMAKE_PREFIX_PATH "${BONMIN_LIBRARY_DIR}/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "${BONMIN_LIBRARY_DIR}/pkgconfig")
else()
message("Directory ${BONMIN_LIBRARY_DIR}/pkgconfig does not exist!")
endif()
From this I get the following:
${BONMIN_LIBRARY_DIR}/pkgconfig =
/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig
${PKG_BONMIN_INCLUDE_DIRS} =
/Users/<PATH>/Bonmin-1.8/build/include/coin;/Users/<PATH>/Bonmin-1.8/build/include/coin/ThirdParty;/Users/<PATH>/Bonmin-1.8/build/include/coin;/Users/<PATH>/Bonmin-1.8/build/include/coin/ThirdParty
${PKG_BONMIN_LDFLAGS} = -L/Users/<PATH>/Bonmin-1.8/build/lib;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../..;-lbonmin;-lCbcSolver;-lCbc;-lCgl;-lOsiClp;-lClpSolver;-lClp;-lcoinasl;-lm;-ldl;-lOsi;-lCoinUtils;-lbz2;-lz;-framework;Accelerate;-lm;-lipopt;-framework;Accelerate;-lm;-ldl;-lcoinmumps;-framework;Accelerate;-lgfortranbegin;-lgfortran;-lSystem
This is used for the example:
include_directories(${PKG_BONMIN_INCLUDE_DIRS} )
add_executable(bonminExample runnables/bonminExample.cpp)
target_link_libraries(bonminExample ${PKG_BONMIN_LDFLAGS})
Additional information:
cmake_minimum_required(VERSION 3.6)
project(MyProject CXX)
# The version number.
set (MyProject_VERSION_MAJOR 1)
set (MyProject_VERSION_MINOR 0)
set(CMAKE_C_COMPILER "/usr/local/Cellar/llvm/5.0.1/bin/clang" CACHE FILEPATH "Path to the used C compiler; default clang." FORCE)
set(CMAKE_CXX_COMPILER "/usr/local/Cellar/llvm/5.0.1/bin/clang++" CACHE FILEPATH "Path to the used C++ compiler; default clang++." FORCE)
set(OPENMP_LIBRARIES "/usr/local/Cellar/llvm/5.0.1/lib" CACHE FILEPATH "Path to the OpenMP libraries." FORCE)
set(OPENMP_INCLUDES "/usr/local/Cellar/llvm/5.0.1/include" CACHE FILEPATH "Path to the OpenMP includes." FORCE)
## Set c++14
set(CMAKE_CXX_STANDARD 14)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
...
The error message I get, while trying to link Bonmin is:
ld: framework not found -lAccelerate
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/<PATH>/myproject/bin/bonminExample] Error 1
make[1]: *** [src/CMakeFiles/bonminExample.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
With the details:
[ 3%] Linking CXX executable /Users/<PATH>/myproject/bin/bonminExample
cd /Users/<PATH>/build_debug/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/bonminExample.dir/link.txt --verbose=1
cd /Users/<PATH>/build_debug && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/<PATH>/myproject /Users/<PATH>/build_debug/googletest-src/googlemock /Users/<PATH>/build_debug /Users/<PATH>/build_debug/googletest-build/googlemock /Users/<PATH>/build_debug/googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/DependInfo.cmake --color=
cd /Users/<PATH>/build_debug && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/<PATH>/myproject/ /Users/<PATH>/myproject/src /Users/<PATH>/build_debug /Users/<PATH>/build_debug/src /Users/<PATH>/build_debug/src/CMakeFiles/PGT.dir/DependInfo.cmake --color=
/usr/local/Cellar/llvm/5.0.1/bin/clang++ -fopenmp=libomp -Wno-unused-command-line-argument -DCOIN_USE_MUMPS_MPI_H -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD -march=native -g -Wall -ggdb -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/bonminExample.dir/runnables/BonminExample.cpp.o CMakeFiles/bonminExample.dir/bonminExample_autogen/mocs_compilation.cpp.o -o /Users/<PATH>/myproject/bin/bonminExample -L/usr/local/Cellar/llvm/5.0.1/lib -L/Users/<PATH>/external_libraries/ogdf20170723 -Wl,-rpath,/usr/local/Cellar/llvm/5.0.1/lib -Wl,-rpath,/Users/<PATH>/external_libraries/ogdf20170723 -L/Users/<PATH>/external_libraries/Bonming-1.8/build/lib -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lbonmin -lCbcSolver -lCbc -lCgl -lOsiClp -lClpSolver -lClp -lcoinasl -lm -ldl -lOsi -lCoinUtils -lbz2 -lz -framework -lAccelerate -lm -lipopt -framework -lAccelerate -lm -ldl -lcoinmumps -framework -lAccelerate -lgfortranbegin -lgfortran -lSystem -lm -ldl -lOsi -lCoinUtils -lbz2 -lz -lipopt -lcoinmumps -lgfortranbegin -lgfortran -lSystem
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/build
[ 4%] Automatic MOC for target gmock
cd /Users/<PATH>/build_debug/googletest-build/googlemock && /opt/local/bin/cmake -E cmake_autogen /Users/<PATH>/build_debug/googletest-build/googlemock/CMakeFiles/gmock_autogen.dir Debug
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/PGT.dir/build.make src/CMakeFiles/PGT.dir/build
ld: framework not found -lAccelerate
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/<PATH>/myproject/bin/bonminExample] Error 1
make[1]: *** [src/CMakeFiles/bonminExample.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/PGTIP.dir/build.make src/CMakeFiles/PGTIP.dir/build
Does anybody know what might be an issue or even has a solution to it?
Note that the make file from the Bonmin example gives me the following:
MBP:CppExample myname$ make VERBOSE=1
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --cflags bonmin` -c -o MyBonmin.o `test -f '../../../../Bonmin/examples/CppExample/MyBonmin.cpp' || echo '../../../../Bonmin/examples/CppExample/'`../../../../Bonmin/examples/CppExample/MyBonmin.cpp
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --cflags bonmin` -c -o MyTMINLP.o `test -f '../../../../Bonmin/examples/CppExample/MyTMINLP.cpp' || echo '../../../../Bonmin/examples/CppExample/'`../../../../Bonmin/examples/CppExample/MyTMINLP.cpp
bla=;\
for file in MyBonmin.o MyTMINLP.o; do bla="$bla `echo $file`"; done; \
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD -o CppExample $bla `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --libs bonmin`
Before XXX_LDFLAGS variable, obtained from PkgConfig module, is used in target_link_libraries call, modify that variable:
string(REPLACE "-framework;" "-framework " PKG_BONMIN_LDFLAGS "${PKG_BONMIN_LDFLAGS}")
(The quotation marks at "${PKG_BONMIN_LDFLAGS}" are important.)
After that, -framework option will be processed correctly:
target_link_libraries(... ${PKG_BONMIN_LDFLAGS})
Explanations
It seems that CMake incorrectly works with pkg-config when framework is used. When extract
-framework Acceletate
from the pkg-config output, these 2 words are interpreted as separate arguments. So, when passed to target_link_libraries:
target_link_libraries(... -framework Acceletate)
-l is appended to the second word according to the command's rules:
ld .... -framework -lAccelerate
Proper command's call should be
target_link_libraries(... "-framework Acceletate")
And this is exactly the purpose of above-mentioned string(REPLACE): It replaces CMake arguments delimiter ;, following -framework option, with normal space .
I want to learn to use shaders and therefore created a new C++ project on Netbeans (ver. 8.0.2).
I want to include the GLFW and the GLEW Library like stated in this tutorial: http://www.learnopengl.com/#!Getting-started/Creating-a-window
I think i included the librarys successfully. (Netbeans shows no error when using #include <GL\glew.h> or #include <GLFW\glfw3.h>, so i think it finds all the files).
My System: Windows 10 x64, using GNU gcc compiler via cygwin
Now here is the problem:
When i try to run the program, there is the following output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/finallyshaders.exe
make[2]: Entering directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
gcc -c -g -include /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL -include /cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.c
cc1: fatal error: /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL: No such file or directory
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/Cygwin-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin-Windows/main.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 722ms)
It seems to fail because the gcc compiler (or more precisely the cc1 part of it) can't find the include-directory for the library. But, as stated, the path is correct. When using cd <the path that cannot be found> everything works and cygwin finds this path.
(My program does nothing but calling printf() until now, that shouldn't be the problem)
Does anybody know what this could mean and how to solve this?
Thanks for your help
Erik Brendel
Your failing compiler commandline is:
gcc -c -g \
-include /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL \
-include /cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW \
-MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" \
-o build/Debug/Cygwin-Windows/main.o main.c
To fix the reported error:
cc1: fatal error: /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL: No such file or directory
it should be:
gcc -c -g \
-I/cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL \
-I/cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW \
-MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" \
-o build/Debug/Cygwin-Windows/main.o main.c
You have confused the compiler options -include and -I. See the documentation of
these options
Here is a pretty good introductory tutorial to the use of GCC
In the Netbeans project properties, the include search-directories should be
entered in Build -> C Compiler -> Include Directories, not Include Headers.
Are you configuring the proyect linker for Netbeans?? This means telling the IDE you will be using libraries that are not added by default with just the include command, for example the math.h library(remember you had to compile with -lm via command promp, it's the same thing).
This can be done by going to run-proyect configuration-customize-Linker-Libraries(you click on the button with says ...).
Then you click on add pkgconfig library or standard(for something like math.h or pthread in unix systems), and search for the library you wish to add.
I've setup a project in CodeLite (mingw, windows 10 64bit), that uses SFML with static linking. Rebuilding or cleaning the project produces this output:
C:\WINDOWS\system32\cmd.exe /C E:/DevTools/WinBuilds/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ SFML-Test - Release-Static ]----------"
mingw32-make.exe[1]: Entering directory 'E:/Workspaces/CodeLite/SFML/SFML-Test'
codelite-cc E:/DevTools/WinBuilds/bin/g++.exe -c "E:/Workspaces/CodeLite/SFML/SFML-Test/main.cpp" -O2 -std=c++11 -Wall -DNDEBUG -DSFML_STATIC -o ./Release-Static/main.cpp.o -I. -I. -IE:/Lib/cpp/SFML/include
"E:/DevTools/WinBuilds/bin/mingw32-make.exe": Interrupt/Exception caught (code = 0xc0000005, addr = 0x00007FFF8AFFEED8)
mingw32-make.exe: *** [All] Error 255
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====
If I build the project again it works, until I clean it again.
I've read that this is a problem of make and "(" or ")" in the path. I altered my environment PATH. The path to mingw is the first entry, but the problem still persists ...
I'm working on a project of drone and I'm having an issue with my Raspberry Pi 2 B. When I'm trying to install Fast - Corner Detector I get this on screen
pi#raspberrypi ~/workspace/fast/build $ make
/usr/bin/cmake -H/home/pi/workspace/fast -B/home/pi/workspace/fast/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/pi/workspace/fast/build/CMakeFiles /home/pi/workspace/fast/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/pi/workspace/fast/build'
make -f CMakeFiles/fast.dir/build.make CMakeFiles/fast.dir/depend
make[2]: Entering directory '/home/pi/workspace/fast/build'
cd /home/pi/workspace/fast/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/pi/workspace/fast /home/pi/workspace/fast /home/pi/workspace/fast/build /home/pi/workspace/fast/build /home/pi/workspace/fast/build/CMakeFiles/fast.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/pi/workspace/fast/build'
make -f CMakeFiles/fast.dir/build.make CMakeFiles/fast.dir/build
make[2]: Entering directory '/home/pi/workspace/fast/build'
/usr/bin/cmake -E cmake_progress_report /home/pi/workspace/fast/build/CMakeFiles 1
[ 20%] Building CXX object CMakeFiles/fast.dir/src/fast_10.cpp.o
/usr/bin/c++ -Dfast_EXPORTS -DTEST_DATA_DIR=\"/home/pi/workspace/fast/test/data\" -Wall -Werror -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -Wall -Werror -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -O3 -mmmx -msse -msse -msse2 -msse3 -mssse3 -fomit-frame-pointer -fPIC -I/home/pi/workspace/fast/include -I/home/pi/workspace/fast/src -I/usr/local/include/opencv -I/usr/local/include -o CMakeFiles/fast.dir/src/fast_10.cpp.o -c /home/pi/workspace/fast/src/fast_10.cpp
cc1plus: error: unrecognized command line option ‘-mmmx’
cc1plus: error: unrecognized command line option ‘-msse’
cc1plus: error: unrecognized command line option ‘-msse’
cc1plus: error: unrecognized command line option ‘-msse2’
cc1plus: error: unrecognized command line option ‘-msse3’
cc1plus: error: unrecognized command line option ‘-mssse3’
CMakeFiles/fast.dir/build.make:60: recipe for target 'CMakeFiles/fast.dir/src/fast_10.cpp.o' failed
make[2]: *** [CMakeFiles/fast.dir/src/fast_10.cpp.o] Error 1
make[2]: Leaving directory '/home/pi/workspace/fast/build'
CMakeFiles/Makefile2:66: recipe for target 'CMakeFiles/fast.dir/all' failed
make[1]: *** [CMakeFiles/fast.dir/all] Error 2
make[1]: Leaving directory '/home/pi/workspace/fast/build'
Makefile:119: recipe for target 'all' failed
make: *** [all] Error 2
I have Cmake installed (sudo apt-get cmake), Gcc (4.6.3) and OpenCV.
How can I solve the problem?
Raspberry Pi is ARM, -msse* does it apply. Based on the CMakeFile, they detect ARM and disabled SSE flags. Maybe it is not working for you, perhaps due to a different cmake version
Try changing this
IF(DEFINED ENV{ARM_ARCHITECTURE})
to
IF(DEFINED $ENV{ARM_ARCHITECTURE})
This is line 34 in CMakeLists.txt
If the fix does not work, then you could manually enable ARM specified flags by editing CMakeLists.txt
Remove this:
IF(DEFINED ENV{ARM_ARCHITECTURE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3 -mssse3")
ENDIF()
and replace with this
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
Maybe report an issue on github and tell the authors about it.
EDIT: you want to do these edits in https://github.com/uzh-rpg/fast/blob/master/CMakeLists.txt
Also try setting export ARM_ARCHITECTURE=1 before compiling
I want to cross-compile rtl8192cu driver targeting ARM Angstrom (BeagleBoard), on x86 Ubuntu 13.04.
Cross-compile prerequisites:
rtl8192cu driver
Cross-toolchain (CodeSourcery / arm-angstrom-linux-gnueabi)
kernel sources
For this reason, I copied kernel sources usr/src directory of BeagleBoard, on Ubuntu machine (they heve been compiled on BeagleBoard, as I needed to rebuild the kernel).
Running make for cross-compile, I get this error:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks1 M=/home/demetres/Desktop/rtl3 modules
make[1]: Entering directory `/home/demetres/Desktop/ks1'
CC [M] /home/demetres/Desktop/rtl3/core/rtw_cmd.o
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl3/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl3] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks1'
make: *** [modules] Error 2
If I run file fixdep I get:
fixdep: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
This makes sense, as fixdep, is part of kernel sources (compiled on ARM platform).
My query is: Is that procedure correct and how can I fix this error?
EDIT:
Running make V=1:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks M=/home/demetres/Desktop/rtl modules
make[1]: Entering directory `/home/demetres/Desktop/ks'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /home/demetres/Desktop/rtl/.tmp_versions ; rm -f /home/demetres/Desktop/rtl/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/demetres/Desktop/rtl
/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,/home/demetres/Desktop/rtl/core/.rtw_cmd.o.d -nostdinc -isystem /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/include -Iinclude -I/home/demetres/Desktop/ks/arch/arm/include -include include/linux/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-versatile/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -O1 -Wno-unused-variable -Wno-unused-value -Wno-unused-label -Wno-unused-parameter -Wno-unused-function -Wno-unused -Wno-uninitialized -I/home/demetres/Desktop/rtl/include -DCONFIG_POWER_SAVING -DCONFIG_LITTLE_ENDIAN -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(rtw_cmd)" -D"KBUILD_MODNAME=KBUILD_STR(8192cu)" -c -o /home/demetres/Desktop/rtl/core/rtw_cmd.o /home/demetres/Desktop/rtl/core/rtw_cmd.c
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks'
make: *** [modules] Error 2
fixdep is an ARM binary and you are trying to run it on x86 machine(intel). You probably have to recompile kernel resources (just make them) and try cross compiling again.