tobspr / LUI

Lightweight User Interface for Panda3D
MIT License
84 stars 24 forks source link

Build fails on Fedora 25 #24

Closed bkeys closed 7 years ago

bkeys commented 7 years ago

I tried to compile the CMake project and am getting errors; some of these I will patch and make a PR for if needed. Here is the current output of my build. Could you list all the needed dependencies in the README perhaps?

Creating directory /home/bkeys/Devel/LUI/scripts/../linux_amd64_panda1.10.0_py35
Executing command:  cmake /home/bkeys/Devel/LUI -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_EXECUTABLE:STRING=/home/bkeys/Devel/DMUX-python/venv/bin/python -DPROJECT_NAME:STRING=lui -DINTERROGATE_LIB:STRING=p3interrogatedb -DPYTHONVERDOT:STRING=3.5 -DHAVE_LIB_EIGEN=TRUE -DIGATE_VERBOSE=0 -DOPTIMIZE=3
-- Bitness: 32 bit ('')
-- Found Panda: ;/usr/lib64/panda3d/libp3framework.so;/usr/lib64/panda3d/libpanda.so;/usr/lib64/panda3d/libpandaexpress.so;/usr/lib64/panda3d/libp3dtool.so;/usr/lib64/panda3d/libp3dtoolconfig.so;/usr/lib64/panda3d/libp3direct.so;/usr/lib64/panda3d/libpanda.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bkeys/Devel/LUI/linux_amd64_panda1.9.4_py27
Executing command:  cmake --build . --config RelWithDebInfo -- -j7 

Scanning dependencies of target lui
[  3%] Building CXX object CMakeFiles/lui.dir/source/interrogate_module.cpp.o
[  7%] Building CXX object CMakeFiles/lui.dir/source/luiAtlas.cxx.o
[ 11%] Building CXX object CMakeFiles/lui.dir/source/interrogate_wrapper.cpp.o
[ 14%] Building CXX object CMakeFiles/lui.dir/source/config_lui.cxx.o
[ 18%] Building CXX object CMakeFiles/lui.dir/source/luiAtlasPool.cxx.o
[ 22%] Building CXX object CMakeFiles/lui.dir/source/luiAtlasPacker.cxx.o
[ 25%] Building CXX object CMakeFiles/lui.dir/source/luiAtlasDescriptor.cxx.o
In file included from /usr/include/panda3d/freetypeFont.h:27:0,
                 from /usr/include/panda3d/dynamicTextFont.h:22,
                 from /home/bkeys/Devel/LUI/source/./luiFontPool.h:13,
                 from /home/bkeys/Devel/LUI/source/interrogate_wrapper.cpp:29:
/usr/include/panda3d/freetypeFace.h:26:22: fatal error: ft2build.h: No such file or directory
 #include <ft2build.h>
                      ^
compilation terminated.
CMakeFiles/lui.dir/build.make:86: recipe for target 'CMakeFiles/lui.dir/source/interrogate_wrapper.cpp.o' failed
gmake[2]: *** [CMakeFiles/lui.dir/source/interrogate_wrapper.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/panda3d/freetypeFont.h:27:0,
                 from /usr/include/panda3d/dynamicTextFont.h:22,
                 from /home/bkeys/Devel/LUI/source/luiFontPool.h:13,
                 from /home/bkeys/Devel/LUI/source/luiText.h:15,
                 from /home/bkeys/Devel/LUI/source/config_lui.cxx:16:
/usr/include/panda3d/freetypeFace.h:26:22: fatal error: ft2build.h: No such file or directory
 #include <ft2build.h>
                      ^
compilation terminated.
CMakeFiles/lui.dir/build.make:110: recipe for target 'CMakeFiles/lui.dir/source/config_lui.cxx.o' failed
gmake[2]: *** [CMakeFiles/lui.dir/source/config_lui.cxx.o] Error 1
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:7:8: error: LibraryDef does not name a type
 extern LibraryDef lui_moddef;
        ^~~~~~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:10:37: error: variable or field Dtool_lui_BuildInstants declared void
 extern void Dtool_lui_BuildInstants(PyObject *module);
                                     ^~~~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:10:37: error: PyObject was not declared in this scope
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:10:47: error: module was not declared in this scope
 extern void Dtool_lui_BuildInstants(PyObject *module);
                                               ^~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:16:51: error: PyObject does not name a type
 extern "C" __attribute__((visibility("default"))) PyObject *PyInit_lui();
                                                   ^~~~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp: In function void initlui():
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:65:3: error: LibraryDef was not declared in this scope
   LibraryDef *defs[] = {&lui_moddef, NULL};
   ^~~~~~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:65:15: error: defs was not declared in this scope
   LibraryDef *defs[] = {&lui_moddef, NULL};
               ^~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:65:20: error: expected primary-expression before ] token
   LibraryDef *defs[] = {&lui_moddef, NULL};
                    ^
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:65:26: error: lui_moddef was not declared in this scope
   LibraryDef *defs[] = {&lui_moddef, NULL};
                          ^~~~~~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:67:3: error: PyObject was not declared in this scope
   PyObject *module = Dtool_PyModuleInitHelper(defs, "lui");
   ^~~~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:67:13: error: module was not declared in this scope
   PyObject *module = Dtool_PyModuleInitHelper(defs, "lui");
             ^~~~~~
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:67:58: error: Dtool_PyModuleInitHelper was not declared in this scope
   PyObject *module = Dtool_PyModuleInitHelper(defs, "lui");
                                                          ^
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:69:35: error: Dtool_lui_BuildInstants was not declared in this scope
     Dtool_lui_BuildInstants(module);
                                   ^
/home/bkeys/Devel/LUI/source/interrogate_module.cpp: At global scope:
/home/bkeys/Devel/LUI/source/interrogate_module.cpp:74:1: error: PyObject does not name a type
 PyObject *PyInit_lui() {
 ^~~~~~~~
CMakeFiles/lui.dir/build.make:62: recipe for target 'CMakeFiles/lui.dir/source/interrogate_module.cpp.o' failed
gmake[2]: *** [CMakeFiles/lui.dir/source/interrogate_module.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lui.dir/all' failed
gmake[1]: *** [CMakeFiles/lui.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
gmake: *** [all] Error 2
Traceback (most recent call last):
  File "build.py", line 52, in <module>
    run_cmake_build(config, args)
  File "/home/bkeys/Devel/LUI/scripts/setup.py", line 158, in run_cmake_build
    try_execute("cmake", "--build", ".", "--config", configuration, "--", core_option)
  File "/home/bkeys/Devel/LUI/scripts/common.py", line 216, in try_execute
    raise Exception("Process had non-zero returncode:", process.returncode)
Exception: ('Process had non-zero returncode:', 2)
bkeys commented 7 years ago

I have gotten the build working and documented all the issues I ran into on my blog here. If you want you could adapt what I found and add it to the README.

tobspr commented 7 years ago

Thanks, I will see what causes the issue, I guess it might be a change to the module builder I made

rdb commented 7 years ago

The issue was resolved on IRC and turned out to be a combination of the facts that his build of the Panda SDK was compiled without HAVE_PYTHON, and that he used a .whl install of Panda to run the setup.py to begin with, whereas the .whl builds don't include the header files.

It might be an option for ModuleBuilder to warn if run with a pip-installed build of Panda, and in the longer term, for us to offer a panda3d-devel wheel that includes header files and .lib files.

tobspr commented 7 years ago

@rdb okay, is there a flag which I can query?

rdb commented 7 years ago

To check whether it's a pip-installed build? Hmm, well, other than analysing the directory structure, you could use pkg_resources to check whether panda3d was installed as a package. If it is, you would get something like:

>>> import pkg_resources
>>> pkg_resources.require('panda3d')
[panda3d 1.10.0.dev1086 (/tmp/stuff/lib/python3.6/site-packages)]

If it isn't, you would instead get a pkg_resources.DistributionNotFound error.