Skip to content
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

Bug report: Build issues on clair branch #14

Open
HugoStrand opened this issue Oct 15, 2023 · 7 comments
Open

Bug report: Build issues on clair branch #14

HugoStrand opened this issue Oct 15, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@HugoStrand
Copy link
Member

Description

I am trying to build the clair branch of app4triqs and get errors at build time.

Steps to Reproduce

  1. Install TRIQS/c2py at ab53c7d
  2. Install TRIQS/clair at e6b3489
  3. Install TRIQS/triqs at 2794ef5c
  4. Try to build TRIQS/app4triqs

minimal script example to reproduce the issue.

git clone git@github.com:TRIQS/app4triqs.git
cd app4triqs
git checkout clair
mkdir cbuild
cd cbuild
CC=clang CXX=clang++ \
  cmake \
    -DCMAKE_INSTALL_PREFIX=~/apps/app4triqs \
    -DCMAKE_BUILD_TYPE=Release \
    -DBuild_Documentation=ON \
    -DPython_EXECUTABLE="/opt/local/bin/python" \
    ..
make

Produces the compile time error

Extension error:
Could not import extension numpydoc (exception: No module named 'numpydoc')
1 warning generated.

Installing numpydoc fixes this.

Checking that the module is present at CMake config time would be nice. How are we doing with other python deps today?

Trying to compile again gives

Consolidate compiler generated dependencies of target app4triqs_module
[ 93%] Building CXX object python/app4triqs/CMakeFiles/app4triqs_module.dir/app4triqs_module.wrap.cxx.o
/Users/hugstr/dev/app4triqs/python/app4triqs/app4triqs_module.wrap.cxx:44:30: error: no member named 'tpxx_write_h5' in namespace 'c2py'
    {"__write_hdf5__", c2py::tpxx_write_h5<app4triqs::toto>, METH_VARARGS, "  "},
                       ~~~~~~^

Grepping into c2py seems to indicate that there is a failure in some automatic inclusion of c2py/serialization/h5.hpp

c2py % egrep -r h5.hpp *
c2py/c2py.hpp:// serialization/h5.hpp is not included by default. The plugin will include it case by case.

Manually modifying app4triqs/python/app4triqs/app4triqs_module.wrap.cxx to include the header:

% git diff
diff --git a/python/app4triqs/app4triqs_module.wrap.cxx b/python/app4triqs/app4triqs_module.wrap.cxx
index c982985..55bdb10 100644
--- a/python/app4triqs/app4triqs_module.wrap.cxx
+++ b/python/app4triqs/app4triqs_module.wrap.cxx
@@ -4,6 +4,7 @@
 #pragma clang diagnostic ignored "-W#warnings"
 #include "app4triqs_module.cpp"
 #include "c2py/c2py.hpp"
+#include "c2py/serialization/h5.hpp"
 
 using c2py::operator"" _a;

Fixes this compile error.

Compiling again gives the error

[ 93%] Building CXX object python/app4triqs/CMakeFiles/app4triqs_module.dir/app4triqs_module.wrap.cxx.o
/Users/hugstr/dev/app4triqs/python/app4triqs/app4triqs_module.wrap.cxx:123:27: error: no member named 'py_type_object' in namespace 'c2py'
  if (PyType_Ready(&c2py::py_type_object<c2py::py_range>) < 0)
                    ~~~~~~^

I can not find py_type_object anywhere in the c2py headers, but there is a test using it

c2py % egrep -r py_type_obj
./test/c2py/cls_der.cxx:  if (PyType_Ready(&py_type_object<B>) < 0) return NULL;
./test/c2py/cls_der.cxx:  py_type_object<B>.tp_new = PyType_GenericNew;
./test/c2py/cls_der.cxx:  py_type_object<A>.tp_base = &py_type_object<B>;
./test/c2py/cls_der.cxx:  if (PyType_Ready(&py_type_object<A>) < 0) return NULL;
./test/c2py/cls_der.cxx:  py_type_object<A>.tp_new = PyType_GenericNew;

However I can not figure out from where it is included.

Please help.

@HugoStrand HugoStrand added the bug Something isn't working label Oct 15, 2023
@parcollet
Copy link
Member

  • Is your c2py up to date ? py_type_object was renamed a few commits ago.
  • You need to pass -DClair=ON in the cmake for app4triqs
  • If Clair = OFF (default), then you just compile the wrap.cxx file of the source (but it also works here, I am confused why it does not in your case. Can you check that sources are up to date ? )
  • If Clair =ON it generated the wrapping with the plugin on the fly (and dumps it in a wrap.cxx as a byproduct).

@HugoStrand
Copy link
Member Author

Dear Olivier,

Thank you for the pointers. All repos are on the cutting edge unstable branches (see the git hashes in the original post).

Adding -DClair=ON in the cmake call fixes all problems and I am able to build and run the tests of app4triqs on the clair branch without any issues.

Cheers, Hugo

@Wentzell
Copy link
Member

Re-opening this, as the branch should also build without -DClair=ON, i.e. only when using c2py.
@parcollet Can you please update the branch accordingly?

@Wentzell Wentzell reopened this Oct 15, 2023
@parcollet
Copy link
Member

It works here without Clair=ON, I can not reproduce the issue.
@HugoStrand Can you make sure your sources are at latest unstable 6a92b3060928acb2974b11257ed3512668059ec6 ?

@HugoStrand
Copy link
Member Author

HugoStrand commented Oct 16, 2023

Dear @parcollet,

I am currently using four different packages,

  • TRIQS/c2py@unstable -> TRIQS/c2py@ab53c7d
  • TRIQS/clair@unstable -> TRIQS/clair@e6b3489
  • TRIQS/triqs@unstable -> TRIQS/triqs@2794ef5c
  • TRIQS/app4triqs@clair -> 3891b0d

I can not see the latest unstable 6a92b30 in any of the projects. Which project is the commit for?

Best, Hugo

@parcollet
Copy link
Member

Indeed, there was a forced rebase to do. Please retry app4triqs with and without clair now.

@Wentzell
Copy link
Member

@parcollet This should be fixed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants