I tried to compile an old codebase. My environments are (as required by the codebase):
Python 2.7
CMake 2.8.10.1
The provided CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 2.6)
project(KOL)
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR})
#ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#check if Eigen exists
find_path(EIGEN_PATH NAMES Eigen PATHS ${EIGEN_DIR} REQUIRED)
if (NOT EIGEN_DIR)
message(FATAL_ERROR "Eigen is not found, please specify by: -DEIGEN_DIR=<eigen_path>")
endif (NOT EIGEN_DIR)
FILE(GLOB data_files src/data/*.h)
FILE(GLOB loss_files src/loss/*.h)
FILE(GLOB opti_files src/kernel/*.h)
FILE(GLOB comm_files src/common/*.h)
set (data_files ${data_files}
src/data/basic_io.cpp
)
include_directories(
${EIGEN_PATH}
)
#set (data_files ${datafiles}
# src/data/basic_io.cpp
# src/data/zlib_io.cpp
# src/data/gzip_io.cpp
# )
source_group("data" FILES ${data_files})
source_group("loss" FILES ${loss_files})
source_group("kernel" FILES ${opti_files})
source_group("common" FILES ${comm_files})
set (SRC_LIST
${data_files} ${loss_files} ${opti_files} ${comm_files}
)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -O2 -s")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
add_executable(KOL src/Params.cpp src/Params.h
src/main.cpp ${SRC_LIST})
IF(UNIX)
target_link_libraries(KOL pthread)
ENDIF(UNIX)
add_executable(Cacher src/data/Cacher.cpp ${data_files})
IF(UNIX)
target_link_libraries(Cacher pthread)
ENDIF(UNIX)
install(TARGETS KOL Cacher
DESTINATION .)
And my command is: cmake -EIGEN_DIR=../Eigen -CMAKE_CXX_FLAGS='-std=c++0x -O3' ..
The error is:
loading initial cache file MAKE_CXX_FLAGS=-std=c++0x -O3
CMake Error: Error processing file:MAKE_CXX_FLAGS=-std=c++0x -O3
-- The C compiler identification is Clang 10.0.1
-- The CXX compiler identification is Clang 10.0.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++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:13 (message):
Eigen is not found, please specify by: -DEIGEN_DIR=<eigen_path>
My project structure is like this:
--Master
|--build
|--Eigen
|--CMakeLists.txt
I ran the command inside of the build directory. It kept saying that EIGEN_PATH is not defined and Eigen is not found.
I tried -EIGEN_DIR=`pwd`/../Eigen. I also tried to use -DEIGEN_DIR but still got the same error. Please help.
You should use -DEIGEN_DIR from command line specifying the folder in Eigen library containing the FindEigen.cmake file (search for it with `find ../Eigen -name "*.CMake").
Be careful, the package name should match exactly (case sensitive):
the name of the find module or config script (FindPackageName.cmake or PackageNameConfig.cmake)
in find_package call
the name of the PackageName_DIR
To specify a cache variable via the CMake command line, use the -D flag before the variable names EIGEN_DIR and CMAKE_CXX_FLAGS. Here is the documentation for the cmake command line options and flags. Because this creates cached entries, try clearing your CMake cache before running the command, to get rid of any stale paths retained within.
Also, be sure to use double quotes " ... " when enclosing the flags for the CMAKE_CXX_FLAGS variable:
cmake -DEIGEN_DIR=Eigen -DCMAKE_CXX_FLAGS="-std=c++0x -O3" ..
Related
I have a C project with Python unit tests. In bash shell and using SWIG, i succesfully generated a python module from C header files of my project, containing definitions i need in my unit tests.
Now i want to integrate the SWIG generation process into CMake, and after today's efforts, i do not get any output files, albeit running the CmakeLists.txt works.
CMakeLists.txt:
# This is a CMake example for Python
# Locates the SWIG binary
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
# Locate Python libraries to link with SWIG generated code
set(PYTHON_INCLUDE_DIR /usr/include/python3.9)
set(PYTHON_LIBRARY /usr/lib/python3.9/config-3.9-x86_64-linux-gnu/libpython3.9.so)
FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "")
SET_SOURCE_FILES_PROPERTIES(${PROJECT_ROOT}/CIP/Inc/CIP_enums.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(${PROJECT_ROOT}/CIP/Inc/CIP_enums.i PROPERTIES SWIG_FLAGS "-includeall")
SWIG_ADD_LIBRARY(CIP_enums LANGUAGE python SOURCES ${PROJECT_ROOT}/CIP/Inc/CIP_enums.i)
set_target_properties(_CIP_enums PROPERTIES LINKER_LANGUAGE CXX)
SWIG_LINK_LIBRARIES(CIP_enums ${PYTHON_LIBRARIES})
return()
Executing this CmakeLists.txt with --debug flag gives the following output (but no generated .py or .so files):
-- Configuring done
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_CXX_CREATE_SHARED_MODULE
-- Generating done
-- Build files have been written to: <my_output_path>
For reference, this is the SWIG code that successfully generates my python interface when executed in bash:
swig -python CIP_enums.h
gcc -fpic -c CIP_enums_wrap.c -I /usr/include/python3.9
ld -shared CIP_enums_wrap.o -o _CIP_enums.so
I am trying to run cmake in our school project, the CMakeList.txt looks as follows:
cmake_minimum_required(VERSION 3.0)
project(nagata)
FIND_PACKAGE( OpenMP )
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
set(CMAKE_C_COMPILER clang-omp CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER clang-omp++ CACHE STRING "C++ compiler" FORCE)
FIND_PACKAGE( pybind11 REQUIRED )
FIND_PACKAGE(PythonInterp 3)
FIND_PACKAGE(PythonLibs 3)
IF( PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND PYBIND11_FOUND )
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_DIRS}
${PYBIND11_INCLUDE_DIRS}
)
ENDIF()
INCLUDE_DIRECTORIES("/usr/include/python3.7m")
add_library(pynagata SHARED pythonlib.cpp)
# The library must not have any prefix and should be located in
# a subfolder that includes the package name. The setup will be
# more complicated otherwise.
SET_TARGET_PROPERTIES( pynagata
PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pynagata"
)
add_executable(nagata main.cpp)
install(TARGETS nagata RUNTIME DESTINATION bin)
When I run cmake .. in my build directory I get this output which looks almost OK:
-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/llvm/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -fopenmp=libomp (found version "5.0")
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
OPENMP FOUND
-- Found PythonInterp: /usr/local/bin/python3.8 (found version "3.8.6")
-- Found PythonLibs: /usr/local/opt/python#3.8/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Found PythonInterp: /usr/local/bin/python3.8 (found suitable version "3.8.6", minimum required is "3")
-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at least version "3")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/.../build
Except the line -- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at least version "3") which seems odd to me as few lines before it literally finds it:-- Found PythonLibs: /usr/local/opt/python#3.8/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib. I tried to set an env variable PYTHON_INCLUDE_DIRS="/usr/local/opt/python#3.8/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib" which is the exact same path as from the line above. Still, I get this error.
How can I make it find the PythonLibs? I really don't understand why the env variable doesn't work. I will also be happy to provide more info - I just don't know what.
I am using:
CLT: 12.0.0.0.1.1599194153
Xcode: 12.0.1
macOS Catalina ver. 10.15.7
Clang: 12.0 build 1200
PS: When I try to run make afterwards I get fatal error: 'string' file not found #include <string> which is maybe somehow connected to this issue...
It looks like I got the flags' names wrong. Calling the cmake with the following flags solved the problem for me:
cmake -DPYTHON_LIBRARY=$(python3-config --prefix)/lib/libpython3.8.dylib -DPYTHON_INCLUDE_DIR=$(python3-config --prefix)/include/python3.8 ..
It finds the PythonLibs successfully now.
I'm trying to create a Python binding for a Qt C++ class with Shiboken2. As far as I can tell, there's no official example on how to do so (the only example on the Qt Blog deals with a generic C++ class https://www.qt.io/blog/2018/05/31/write-python-bindings). So I'm following this blog post instead: https://blog.basyskom.com/2019/using-shiboken2-to-create-python-bindings-for-a-qt-library/
The example works on Linux, but Shiboken2 fails to build on a Mac with the error qobject.h:46:10: fatal: 'QtCore/qobjectdefs.h' file not found
This is a log of what happens:
(pyside2build) MacBook-Pro-i7:build andreac$ cmake ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- QtCore include folders: /Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework;/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers;/Users/andreac/Qt/5.12.6/clang_64/.//mkspecs/macx-clang
-- Using python interpreter: /Users/andreac/pyside2build/bin/python
-- Found Python3: /Users/andreac/pyside2build/bin/python3.7 (found version "3.7.5") found components: Interpreter Development
-- Using PySide2 installation: /Users/andreac/pyside2build/lib/python3.7/site-packages/PySide2
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/andreac/pyside2build/src/binding-example/build
(pyside2build) MacBook-Pro-i7:build andreac$ make
Scanning dependencies of target libexamplebinding_autogen
[ 9%] Automatic MOC for target libexamplebinding
[ 9%] Built target libexamplebinding_autogen
Scanning dependencies of target libexamplebinding
[ 18%] Building CXX object CMakeFiles/libexamplebinding.dir/libexamplebinding_autogen/mocs_compilation.cpp.o
[ 27%] Building CXX object CMakeFiles/libexamplebinding.dir/qobjectwithenum.cpp.o
[ 36%] Linking CXX shared library libexamplebinding.dylib
[ 36%] Built target libexamplebinding
Scanning dependencies of target Shiboken2QtExample_autogen
[ 45%] Running generator for /Users/andreac/pyside2build/src/binding-example/bindings.xml.
(bindings) clang_parseTranslationUnit2(0x0, cmd[17]=-nostdinc -isystem/opt/X11/include -isystem/usr/local/include -isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1 -isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include -isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -iframework/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -fPIC -Wno-expansion-to-defined -Wno-constant-logical-operand -std=c++14 -I/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework -I/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers -I/Users/andreac/Qt/5.12.6/clang_64/mkspecs/macx-clang -I/Users/andreac/pyside2build/src/binding-example /private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp)
/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/qobject.h:46:10: fatal error: 'QtCore/qobjectdefs.h' file not found
(bindings) Errors in /private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp:
/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/qobject.h:46:10: fatal: 'QtCore/qobjectdefs.h' file not found
/private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp:1:10: note: in file included from /private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp:1:
/Users/andreac/pyside2build/src/binding-example/bindings.h:3:10: note: in file included from /Users/andreac/pyside2build/src/binding-example/bindings.h:3:
/Users/andreac/pyside2build/src/binding-example/qobjectwithenum.h:2:10: note: in file included from /Users/andreac/pyside2build/src/binding-example/qobjectwithenum.h:2:
/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/QObject:1:10: note: in file included from /Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/QObject:1:
(bindings) Clang: 1 diagnostic messages:
/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/qobject.h:46:10: fatal: 'QtCore/qobjectdefs.h' file not found
/private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp:1:10: note: in file included from /private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp:1:
/Users/andreac/pyside2build/src/binding-example/bindings.h:3:10: note: in file included from /Users/andreac/pyside2build/src/binding-example/bindings.h:3:
/Users/andreac/pyside2build/src/binding-example/qobjectwithenum.h:2:10: note: in file included from /Users/andreac/pyside2build/src/binding-example/qobjectwithenum.h:2:
/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/QObject:1:10: note: in file included from /Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers/QObject:1:
Keeping temporary file: /private/var/folders/8v/8h2g7jz573g9rlwyp4zh87qm0000gn/T/bindings_eyZJOr.hpp
shiboken: Error running ApiExtractor.
Command line: --generator-set=shiboken --enable-parent-ctor-heuristic --enable-return-value-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack -I/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework -I/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers -I/Users/andreac/Qt/5.12.6/clang_64/.//mkspecs/macx-clang -T/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework -T/Users/andreac/Qt/5.12.6/clang_64/lib/QtCore.framework/Headers -T/Users/andreac/Qt/5.12.6/clang_64/.//mkspecs/macx-clang -I/Users/andreac/pyside2build/src/binding-example -T/Users/andreac/pyside2build/src/binding-example --output-directory=/Users/andreac/pyside2build/src/binding-example/build /Users/andreac/pyside2build/src/binding-example/bindings.h /Users/andreac/pyside2build/src/binding-example/bindings.xml
make[2]: *** [Shiboken2QtExample/qobjectwithenum_wrapper.cpp] Error 1
make[1]: *** [CMakeFiles/Shiboken2QtExample_autogen.dir/all] Error 2
make: *** [all] Error 2
Any ideas on how to fix the problem?
It looks like I need to use the -F option for Shiboken2 to specify the location of a Framework. Adding the following to the invocation command solves the issue:
-F/Users/andreac/Qt/5.12.6/clang_64/lib/
I am trying to install python gym-retro library which uses cmake to build Unix Makefiles. However I am getting following errors during the process:
I am running on Windows 10 x64. Python 3.6.3 and Gym-Retro 0.6.0
CmakeErrorList:
Detecting C compiler ABI info failed to compile with the following output:
Change Dir: C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/CODEBL~1/make.exe" "cmTC_fc586/fast"
Starting cbp2make rev.147...
Using default configuration.
Cannot copy output executable
''
to destination specified by COPY_FILE:
'C:/Git/gym-retro/bin/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_C.bin'
Unable to find the executable at any of:
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/cmTC_fc586.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Debug/cmTC_fc586.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Development/cmTC_fc586.exe
Detecting C [-std=c11] compiler features failed to compile with the following output:
Change Dir: C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/CODEBL~1/make.exe" "cmTC_9e0fb/fast"
Starting cbp2make rev.147...
Using default configuration.
Cannot copy output executable
''
to destination specified by COPY_FILE:
'C:/Git/gym-retro/bin/CMakeFiles/feature_tests.bin'
Unable to find the executable at any of:
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/cmTC_9e0fb.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Debug/cmTC_9e0fb.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Development/cmTC_9e0fb.exe
Detecting CXX compiler ABI info failed to compile with the following output:
Change Dir: C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/CODEBL~1/make.exe" "cmTC_318a9/fast"
Starting cbp2make rev.147...
Using default configuration.
Cannot copy output executable
''
to destination specified by COPY_FILE:
'C:/Git/gym-retro/bin/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_CXX.bin'
Unable to find the executable at any of:
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/cmTC_318a9.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Debug/cmTC_318a9.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Development/cmTC_318a9.exe
Detecting CXX [-std=c++1z] compiler features failed to compile with the following output:
Change Dir: C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/CODEBL~1/make.exe" "cmTC_aeefc/fast"
Starting cbp2make rev.147...
Using default configuration.
Cannot copy output executable
''
to destination specified by COPY_FILE:
'C:/Git/gym-retro/bin/CMakeFiles/feature_tests.bin'
Unable to find the executable at any of:
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/cmTC_aeefc.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Debug/cmTC_aeefc.exe
C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp/Development/cmTC_aeefc.exe
CMakeOutput:
The system is: Windows - 10.0.17134 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: C:/MinGW/bin/gcc.exe
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.exe"
The C compiler identification is GNU, found in "C:/Git/gym-retro/bin/CMakeFiles/3.12.2/CompilerIdC/a.exe"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/MinGW/bin/c++.exe
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.exe"
The CXX compiler identification is GNU, found in "C:/Git/gym-retro/bin/CMakeFiles/3.12.2/CompilerIdCXX/a.exe"
Determining if the C compiler works passed with the following output:
Change Dir: C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/CODEBL~1/make.exe" "cmTC_b7619/fast"
Starting cbp2make rev.147...
Using default configuration.
Determining if the CXX compiler works passed with the following output:
Change Dir: C:/Git/gym-retro/bin/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/CODEBL~1/make.exe" "cmTC_1bba6/fast"
Starting cbp2make rev.147...
Using default configuration.
Powershell Log after running pip3 install gym-retro:
Pastebin
I have no idea why this is happening, I have tried reinstalling MinGW and CMake or ran pip3 install as admin but that didn't work.
I am trying to install this python package on my cygwin(last available version) setup, using gcc and no windows/microsoft components at all. The package has many dependencies so it can take a while for you to try to install it. I guess the error is generic and you don't require to replicate the issue to provide insights on how to fix it.
I have found this error for several(all?) .la libraries on the package:
Making all in centrality
make[4]: Entering directory '/cygdrive/d/gdrive/Thesis/tech/urv tech/graph-tool-2.2.31/src/graph/centrality'
CXX graph_betweenness.lo
CXX graph_centrality_bind.lo
CXX graph_closeness.lo
CXX graph_eigentrust.lo
CXX graph_eigenvector.lo
CXX graph_hits.lo
CXX graph_katz.lo
CXX graph_pagerank.lo
CXX graph_trust_transitivity.lo
CXXLD libgraph_tool_centrality.la
/usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x182b): undefined reference to `graph_tool::GraphInterface::GetNumberOfVertices()'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x19bd): undefined reference to `graph_tool::GraphInterface::GetNumberOfVertices()'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x1a68): undefined reference to `graph_tool::ValueException::ValueException(std::string const&)'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x1a87): undefined reference to `graph_tool::ValueException::~ValueException()'
.libs/graph_betweenness.o:graph_betweenness.cc:(.text+0x1ad1): undefined reference to `graph_tool::ValueException::ValueException(std::string const&)'
/usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: .libs/graph_betweenness.o: bad reloc address 0x6 in section `.text$_ZN5boost16exception_detail10clone_baseD1Ev[__ZN5boost16exception_detail10clone_baseD1Ev]'
collect2: error: ld returned 1 exit status
Makefile:474: recipe for target 'libgraph_tool_centrality.la' failed
As I see .lo files are built, probably not correctly, and when it comes to generate the .la file is when I get the 'bad reloc address' error. In other words, my assumption is that because the .lo files are not correctly generated the .la built fails.
Doing some research I have found this bug reported and fixed back in 2009:
https://www.mail-archive.com/bug-binutils#gnu.org/msg07150.html
Based on it, I understand that an approach to try to fix the problem would be to replace the -export-dynamic flag by -export-all-symbols in the configure file the python library uses to install itself. There are two files that I modify: configure and [configure.ac][2]
Configure has this kind of export-dynamic mentions, related to other settings:
export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
Configure.ac has this one only:
[MOD_LDFLAGS="-module -avoid-version -export-dynamic -no-undefined -Wl,-E -Wl,--as-needed"]
that I think is the key one because it refers to LD flags.
But if I do this, the project seems to break an I receive messages saying the files used in the build have the wrong version of libtool.
make[4]: Entering directory '/cygdrive/d/gdrive/Thesis/tech/urv tech/graph-tool-2.2.31/src/graph/centrality'
CXX graph_betweenness.lo
libtool: Version mismatch error. This is libtool 2.4.2, but the
libtool: definition of this LT_INIT comes from libtool 2.4.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2
libtool: and run autoconf again.
Makefile:507: recipe for target 'graph_betweenness.lo' failed
There are mentions also in aclocal.m4 that if I try to change cause additional problems related to build files version.
In addition, in ltmain.sh it is verified for some libraries if they have been generated with the flag export-dynamic.
So, several points here:
what is the difference between the .la and the .lo libraries that the module tries to generate?
I think the problem is related to differences in static and dynamic link but really don't know how to fix it. Are there other settings involved?
In general, any hints on what to try?