Compiling a shared library
-
Dear Community! Concerning a topic that deals with the compilation of a program written in C++ i would like to ask for your support. Just for information at the beginning: I am a beginner in C++ programming. Most of the things I do in Python, Java and PHP. However, for writing the master thesis, I have to deal with an open source software where the relevant part is written in C++ where i have to modify one part and now have to compile the folder where the source files are located to a shared library (.so) The source code is from https://github.com/qgis/QGIS The file i modified was https://github.com/qgis/QGIS/blob/master/src/analysis/raster/qgskde.cpp (In the installed version of QGIS, the folder analysis appears just as _analysis.so) I am working on a MacBook using MacOS 10.15.4 and a Raspberry Pi using Raspbian and have CMake Version 3.4 installed. The CMakeLists.txt File i try to compile using the command "cmake . --debug-output" (having directed to the directory "..../QGIS-master/src/analysis/" before) is https://github.com/qgis/QGIS/blob/master/src/analysis/CMakeLists.txt where i added cmake_minimum_required(VERSION 3.4.0) in Line 4. The output i get when executing the command described above is:
Running with debug output on.
CMake Error at CMakeLists.txt:390 (find_package):
By not providing "FindEXIV2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "EXIV2", but
CMake did not find one.Could not find a package configuration file provided by "EXIV2" with any of
the following names:EXIV2Config.cmake exiv2-config.cmake
Add the installation prefix of "EXIV2" to CMAKE_PREFIX_PATH or set
"EXIV2_DIR" to a directory containing one of the above files. If "EXIV2"
provides a separate development package or SDK, be sure it has been
installed.Called from: [1] /home/pi/QGIS-master/src/analysis/CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "/home/pi/QGIS-master/src/analysis/CMakeFiles/CMakeOutput.log".After several attempts of trying to solve this problem using google i don't get any further. I attached the
CMakeOutput.log
below. Can someone give my advice on how i proceed here? Thanks for any help in advance. Best regards! CMakeOutput.log ----------------------------------------------
The system is: Linux - 4.1.19+ - armv6l
Compiling the C compiler identification source file " -
Dear Community! Concerning a topic that deals with the compilation of a program written in C++ i would like to ask for your support. Just for information at the beginning: I am a beginner in C++ programming. Most of the things I do in Python, Java and PHP. However, for writing the master thesis, I have to deal with an open source software where the relevant part is written in C++ where i have to modify one part and now have to compile the folder where the source files are located to a shared library (.so) The source code is from https://github.com/qgis/QGIS The file i modified was https://github.com/qgis/QGIS/blob/master/src/analysis/raster/qgskde.cpp (In the installed version of QGIS, the folder analysis appears just as _analysis.so) I am working on a MacBook using MacOS 10.15.4 and a Raspberry Pi using Raspbian and have CMake Version 3.4 installed. The CMakeLists.txt File i try to compile using the command "cmake . --debug-output" (having directed to the directory "..../QGIS-master/src/analysis/" before) is https://github.com/qgis/QGIS/blob/master/src/analysis/CMakeLists.txt where i added cmake_minimum_required(VERSION 3.4.0) in Line 4. The output i get when executing the command described above is:
Running with debug output on.
CMake Error at CMakeLists.txt:390 (find_package):
By not providing "FindEXIV2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "EXIV2", but
CMake did not find one.Could not find a package configuration file provided by "EXIV2" with any of
the following names:EXIV2Config.cmake exiv2-config.cmake
Add the installation prefix of "EXIV2" to CMAKE_PREFIX_PATH or set
"EXIV2_DIR" to a directory containing one of the above files. If "EXIV2"
provides a separate development package or SDK, be sure it has been
installed.Called from: [1] /home/pi/QGIS-master/src/analysis/CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "/home/pi/QGIS-master/src/analysis/CMakeFiles/CMakeOutput.log".After several attempts of trying to solve this problem using google i don't get any further. I attached the
CMakeOutput.log
below. Can someone give my advice on how i proceed here? Thanks for any help in advance. Best regards! CMakeOutput.log ----------------------------------------------
The system is: Linux - 4.1.19+ - armv6l
Compiling the C compiler identification source file "Did you compile it "before" you started making changes? That way, you know that it worked in the first place. If not, start over.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
-
Did you compile it "before" you started making changes? That way, you know that it worked in the first place. If not, start over.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
No unfortunately not. But I have downloaded the same sourcecode (means kind of "virgin") from github where i didn't implement my changes (which are should not have any impact as it is just a change of a formula in one calculation) and the exact error occurs also. However, I've worked myself through somehow to get around this exiv2 problem by inserting
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_MODULE_PATH}/home/pi/QGIS-master/src/analysis/")
to the CMakeLists.txt file. However, i'm stuck at this line now:
Running with debug output on.
-- Found exiv2: /usr/lib/arm-linux-gnueabihf/libexiv2.so
Called from: [2] /home/pi/QGIS-master/src/analysis/FindEXIV2.cmake
[1] /home/pi/QGIS-master/src/analysis/CMakeLists.txt
CMake Error at CMakeLists.txt:400 (ADD_FLEX_FILES_PREFIX):
Unknown CMake command "ADD_FLEX_FILES_PREFIX".Called from: [1] /home/pi/QGIS-master/src/analysis/CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "/home/pi/QGIS-master/src/analysis/CMakeFiles/CMakeOutput.log".and except finding google solutions that redirect me to the same file or similar ones of the QGIS github project i cant find where it fails now. Do you have an idea? Thanks for your time in advance!
-
No unfortunately not. But I have downloaded the same sourcecode (means kind of "virgin") from github where i didn't implement my changes (which are should not have any impact as it is just a change of a formula in one calculation) and the exact error occurs also. However, I've worked myself through somehow to get around this exiv2 problem by inserting
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_MODULE_PATH}/home/pi/QGIS-master/src/analysis/")
to the CMakeLists.txt file. However, i'm stuck at this line now:
Running with debug output on.
-- Found exiv2: /usr/lib/arm-linux-gnueabihf/libexiv2.so
Called from: [2] /home/pi/QGIS-master/src/analysis/FindEXIV2.cmake
[1] /home/pi/QGIS-master/src/analysis/CMakeLists.txt
CMake Error at CMakeLists.txt:400 (ADD_FLEX_FILES_PREFIX):
Unknown CMake command "ADD_FLEX_FILES_PREFIX".Called from: [1] /home/pi/QGIS-master/src/analysis/CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "/home/pi/QGIS-master/src/analysis/CMakeFiles/CMakeOutput.log".and except finding google solutions that redirect me to the same file or similar ones of the QGIS github project i cant find where it fails now. Do you have an idea? Thanks for your time in advance!
Then check the history of this project. Maybe it never worked (recently). Anyway, take out some useful part and see if you can compile that. Never met software where I couldn't find something to remove / refactor (or totally rewrite). If you don't understand it, you probably don't need it.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food