-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling OpenSpiel as a C++ library fails #1058
Comments
Hi, Seems like you are missing the dependencies. You still need to run |
Solved! I did run into another error later on that I managed to solve with the help of Bing Chat. I ran into the following error: Bing chat told me the -lopen_spiel option should be specified after the object files or source files to ensure that the linker can find the definitions for the functions used in your code. After running the updated command: |
Ok, great. The Sure, we will add a mention of installing the dependencies. Thanks! |
The -lopen_spiel is indeed mentioned but I ran into an error when it is in the middle of the command, when moving it to the end of the command it did work. This might be because I am using g++ instead, I am not sure. |
Ah, yes, it seems like it is related to g++/gcc: https://stackoverflow.com/questions/3363398/g-linking-order-dependency-when-linking-c-code-to-c-code I had forgotten about that. So I've re-ordered the order in the example to match yours. |
When following the steps for compiling OpenSpiel as a Shared Library the following command fails:
BUILD_SHARED_LIB=ON CXX=clang++ cmake -DPython3_EXECUTABLE=$(which python3) -DCMAKE_CXX_COMPILER=${CXX} ../open_spiel
The following errors are reported:
CMake Error at CMakeLists.txt:199 (add_subdirectory):
add_subdirectory given source "abseil-cpp" which is not an existing
directory.
Not building wheel. Finding Python normally...
-- Could NOT find Python3 (missing: Development Development.Module Development.Embed) (found version "3.10.9")
Python executable: /home/boris/miniconda3/envs/Othello/bin/python3
Python include dirs: /home/boris/anaconda3/include/python3.9
Python library dirs: /home/boris/anaconda3/lib
OPEN_SPIEL_ENABLE_JAX set to AUTO. Detecting Jax...
Not found. Enable printing errors in python/CMakeLists.txt to see output.
OPEN_SPIEL_ENABLE_PYTORCH set to AUTO. Detecting PyTorch...
Not found. Enable printing errors in python/CMakeLists.txt to see output.
OPEN_SPIEL_ENABLE_TENSORFLOW set to AUTO. Detecting Tensorflow...
Not found. Enable printing errors in python/CMakeLists.txt to see output.
-- Configuring incomplete, errors occurred!
See also "/home/boris/Downloads/open_spiel-1.2/build/CMakeFiles/CMakeOutput.log".
See also "/home/boris/Downloads/open_spiel-1.2/build/CMakeFiles/CMakeError.log".
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER=
CMake Error at games/CMakeLists.txt:201 (add_library):
Cannot find source file:
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
CMake Error at games/CMakeLists.txt:201 (add_library):
No SOURCES given to target: bridge_double_dummy_solver
For some weird reason neither "/home/boris/Downloads/open_spiel-1.2/build/CMakeFiles/CMakeOutput.log" nor "/home/boris/Downloads/open_spiel-1.2/build/CMakeFiles/CMakeError.log" exist.
I have tried this on two different devices and neither of them worked.
The text was updated successfully, but these errors were encountered: