cyclops-community / ctf

Cyclops Tensor Framework: parallel arithmetic on multidimensional arrays
Other
194 stars 53 forks source link

make libpy fails on ubuntu #42

Closed bigerl closed 6 years ago

bigerl commented 6 years ago

I failed to compile the libpy make target (and so python). I'm working on the python branch. Here is what I did:

Now trying to build:

  1. ./configure

    Checking compiler type/version... Using GNU compilers.
    Checking whether __APPLE__ is defined... no.
    Checking compiler (CXX)... successful.
    Checking availability of C++11... successful.
    Checking flags (CXXFLAGS)... successful.
    Checking if OpenMP is provided... using OpenMP via -fopenmp flag.
    Checking whether BLAS works... BLAS library was not specified, using -lblas (with underscores).
    Checking whether to use CUDA... cuda will not be used.
    A config.mk file has been created (to adjust all settings edit the config.mk file manually or rerun ./configure to create a new one).
    Configure finished successfully.

    -> seems ok

  2. make

    make ctflib
    make[1]: Entering directory '/home/me/Downloads/pythonbranch/ctf'
    make ctf -C src; 
    make[2]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src'
    make -C interface
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/interface'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c common.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/common.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c flop_counter.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/flop_counter.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c world.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/world.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c idx_tensor.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/idx_tensor.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c term.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/term.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c schedule.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/schedule.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c semiring.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/semiring.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c partition.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/partition.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c fun_term.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/fun_term.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c monoid.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/monoid.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c set.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/set.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/interface'
    make -C shared
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/shared'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c util.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/util.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c memcontrol.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/memcontrol.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c int_timer.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/int_timer.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c model.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/model.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c init_models.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/init_models.o
    mpicxx -x c++ -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c offload.cu -o /home/me/Downloads/pythonbranch/ctf/obj/offload.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/shared'
    make -C tensor
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/tensor'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c untyped_tensor.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/untyped_tensor.o
    untyped_tensor.cxx: In member function ‘int CTF_int::tensor::sparsify(std::function<bool(const char*)>)’:
    untyped_tensor.cxx:1297:15: warning: argument 1 value ‘18446744073709551608’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
       int64_t nnz_blk_old[calc_nvirt()];
               ^~~~~~~~~~~
    untyped_tensor.cxx:1297:15: note: in a call to built-in allocation function ‘void* __builtin_alloca_with_align(long unsigned int, long unsigned int)’
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c algstrct.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/algstrct.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/tensor'
    make -C symmetry
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/symmetry'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sym_indices.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sym_indices.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c symmetrization.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/symmetrization.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/symmetry'
    make -C mapping
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/mapping'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c mapping.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/mapping.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c distribution.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/distribution.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c topology.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/topology.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/mapping'
    make -C redistribution
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/redistribution'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c redist.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/redist.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sparse_rw.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sparse_rw.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c pad.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/pad.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c nosym_transp.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/nosym_transp.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c cyclic_reshuffle.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/cyclic_reshuffle.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c glb_cyclic_reshuffle.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/glb_cyclic_reshuffle.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c dgtog_redist.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/dgtog_redist.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c dgtog_calc_cnt.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/dgtog_calc_cnt.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/redistribution'
    make -C scaling
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/scaling'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c scaling.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/scaling.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sym_seq_scl.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sym_seq_scl.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c scale_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/scale_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c strp_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/strp_tsr.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/scaling'
    make -C summation
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/summation'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c summation.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/summation.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sym_seq_sum.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sym_seq_sum.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sum_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sum_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c spr_seq_sum.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/spr_seq_sum.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c spsum_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/spsum_tsr.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/summation'
    make -C contraction
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/contraction'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c contraction.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/contraction.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sym_seq_ctr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sym_seq_ctr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c ctr_offload.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/ctr_offload.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c ctr_comm.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/ctr_comm.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c ctr_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/ctr_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c ctr_2d_general.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/ctr_2d_general.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c sp_seq_ctr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/sp_seq_ctr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c spctr_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/spctr_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c spctr_comm.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/spctr_comm.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c spctr_2d_general.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/spctr_2d_general.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c spctr_offload.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/spctr_offload.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/contraction'
    make -C sparse_formats
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/sparse_formats'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c coo.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/coo.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -c csr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj/csr.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/sparse_formats'
    make[2]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src'
    ar -crs /home/me/Downloads/pythonbranch/ctf/lib/libctf.a /home/me/Downloads/pythonbranch/ctf/obj/*.o; 
    make[1]: Leaving directory '/home/me/Downloads/pythonbranch/ctf'
    make ctflibso
    make[1]: Entering directory '/home/me/Downloads/pythonbranch/ctf'
    make ctf -C src; 
    make[2]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src'
    make -C interface
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/interface'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c common.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/common.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c flop_counter.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/flop_counter.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c world.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/world.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c idx_tensor.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/idx_tensor.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c term.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/term.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c schedule.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/schedule.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c semiring.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/semiring.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c partition.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/partition.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c fun_term.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/fun_term.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c monoid.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/monoid.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c set.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/set.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/interface'
    make -C shared
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/shared'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c util.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/util.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c memcontrol.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/memcontrol.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c int_timer.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/int_timer.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c model.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/model.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c init_models.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/init_models.o
    mpicxx -x c++ -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c offload.cu -o /home/me/Downloads/pythonbranch/ctf/obj_shared/offload.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/shared'
    make -C tensor
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/tensor'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c untyped_tensor.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/untyped_tensor.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c algstrct.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/algstrct.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/tensor'
    make -C symmetry
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/symmetry'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sym_indices.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sym_indices.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c symmetrization.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/symmetrization.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/symmetry'
    make -C mapping
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/mapping'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c mapping.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/mapping.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c distribution.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/distribution.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c topology.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/topology.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/mapping'
    make -C redistribution
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/redistribution'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c redist.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/redist.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sparse_rw.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sparse_rw.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c pad.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/pad.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c nosym_transp.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/nosym_transp.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c cyclic_reshuffle.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/cyclic_reshuffle.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c glb_cyclic_reshuffle.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/glb_cyclic_reshuffle.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c dgtog_redist.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/dgtog_redist.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c dgtog_calc_cnt.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/dgtog_calc_cnt.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/redistribution'
    make -C scaling
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/scaling'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c scaling.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/scaling.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sym_seq_scl.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sym_seq_scl.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c scale_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/scale_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c strp_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/strp_tsr.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/scaling'
    make -C summation
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/summation'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c summation.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/summation.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sym_seq_sum.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sym_seq_sum.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sum_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sum_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c spr_seq_sum.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/spr_seq_sum.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c spsum_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/spsum_tsr.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/summation'
    make -C contraction
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/contraction'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c contraction.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/contraction.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sym_seq_ctr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sym_seq_ctr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c ctr_offload.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/ctr_offload.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c ctr_comm.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/ctr_comm.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c ctr_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/ctr_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c ctr_2d_general.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/ctr_2d_general.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c sp_seq_ctr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/sp_seq_ctr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c spctr_tsr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/spctr_tsr.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c spctr_comm.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/spctr_comm.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c spctr_2d_general.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/spctr_2d_general.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c spctr_offload.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/spctr_offload.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/contraction'
    make -C sparse_formats
    make[3]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src/sparse_formats'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c coo.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/coo.o
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c csr.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_shared/csr.o
    make[3]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src/sparse_formats'
    make[2]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src'
    make ctf_ext_objs -C src_python; 
    make[2]: Entering directory '/home/me/Downloads/pythonbranch/ctf/src_python'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -c ctf_ext.cxx -o /home/me/Downloads/pythonbranch/ctf/obj_ext/ctf_ext.o
    make[2]: Leaving directory '/home/me/Downloads/pythonbranch/ctf/src_python'
    mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1   -fPIC -shared -o /home/me/Downloads/pythonbranch/ctf/lib_shared/libctf.so /home/me/Downloads/pythonbranch/ctf/obj_shared/*.o /home/me/Downloads/pythonbranch/ctf/obj_ext/*.o; 
    make[1]: Leaving directory '/home/me/Downloads/pythonbranch/ctf'

    -> seems as well ok

  3. first failure I got with: make pylib

    cd src_python && LDFLAGS="-L../lib_shared" python setup.py build_ext --inplace  && cd ..
    running build_ext
    building 'ctf.core' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../include -I. -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.6m -c ctf/core.cpp -o build/temp.linux-x86_64-3.6/ctf/core.o -std=c++11 -O0 -g
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1788:0,
                 from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/lib/python3/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ctf/core.cpp:493:
    /usr/lib/python3/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
    #warning "Using deprecated NumPy API, disable it by " \
    ^~~~~~~
    ctf/core.cpp:496:10: fatal error: mpi.h: No such file or directory
    #include "mpi.h"
          ^~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Makefile:109: recipe for target 'pylib' failed
    make: *** [pylib] Error 1
  4. but I could resolve this by editing src_python/setup.py and replacing there include_dirs=["../include",".",numpy.get_include()] with include_dirs=["../include",".",numpy.get_include(),"/usr/lib/x86_64-linux-gnu/openmpi/include"]

  5. running again make pylib

    cd src_python && LDFLAGS="-L../lib_shared" python setup.py build_ext --inplace  && cd ..
    running build_ext
    building 'ctf.core' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../include -I. -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/python3.6m -c ctf/core.cpp -o build/temp.linux-x86_64-3.6/ctf/core.o -std=c++11 -O0 -g
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1788:0,
                 from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/lib/python3/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ctf/core.cpp:493:
    /usr/lib/python3/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
    #warning "Using deprecated NumPy API, disable it by " \
    ^~~~~~~
    ctf/core.cpp: In function ‘PyObject* __Pyx_PyInt_LshiftObjC(PyObject*, PyObject*, long int, int)’:
    ctf/core.cpp:94940:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if (unlikely(!(b < sizeof(long)*8 && a == x >> b)) && a) {
                                ~~^~~~~~~~~~~~~~~~
    ctf/core.cpp:675:43: note: in definition of macro ‘unlikely’
    #define unlikely(x) __builtin_expect(!!(x), 0)
                                           ^
    In file included from ../include/../src/interface/group.h:57:0,
                 from ../include/../src/interface/monoid.h:142,
                 from ../include/../src/interface/set.h:597,
                 from ../include/../src/interface/tensor.h:5,
                 from ../include/ctf.hpp:17,
                 from ctf/core.cpp:497:
    ../include/../src/interface/semiring.h: In instantiation of ‘dtype CTF_int::default_mul(dtype, dtype) [with dtype = bool]’:
    ../include/../src/interface/semiring.h:293:19:   required from ‘CTF::Semiring<dtype, is_ord>::Semiring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/ring.h:25:40:   required from ‘CTF::Ring<dtype, is_ord>::Ring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/tensor.h:208:43:   required from here
    ../include/../src/interface/semiring.h:13:13: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
     return a*b;
            ~^~
    ../include/../src/interface/semiring.h: In instantiation of ‘void CTF_int::default_gemm(char, char, int, int, int, dtype, const dtype*, const dtype*, dtype, dtype*) [with dtype = bool]’:
    ../include/../src/interface/semiring.h:294:19:   required from ‘CTF::Semiring<dtype, is_ord>::Semiring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/ring.h:25:40:   required from ‘CTF::Ring<dtype, is_ord>::Ring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/tensor.h:208:43:   required from here
    ../include/../src/interface/semiring.h:98:18: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
         C[j*m+i] *= beta;
         ~~~~~~~~~^~~~~~~
    ../include/../src/interface/semiring.h: In instantiation of ‘void CTF_int::default_scal(int, dtype, dtype*, int) [with dtype = bool]’:
    ../include/../src/interface/semiring.h:296:19:   required from ‘CTF::Semiring<dtype, is_ord>::Semiring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/ring.h:25:40:   required from ‘CTF::Ring<dtype, is_ord>::Ring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/tensor.h:208:43:   required from here
    ../include/../src/interface/semiring.h:50:17: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
       X[incX*i] *= alpha;
       ~~~~~~~~~~^~~~~~~~
    ../include/../src/interface/semiring.h: In instantiation of ‘void CTF_int::default_coomm(int, int, int, dtype, const dtype*, const int*, const int*, int, const dtype*, dtype, dtype*) [with dtype = bool]’:
    ../include/../src/interface/semiring.h:297:19:   required from ‘CTF::Semiring<dtype, is_ord>::Semiring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/ring.h:25:40:   required from ‘CTF::Ring<dtype, is_ord>::Ring() [with dtype = bool; bool is_ord = true]’
    ../include/../src/interface/tensor.h:208:43:   required from here
    ../include/../src/interface/semiring.h:183:18: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
         C[j*m+i] *= beta;
         ~~~~~~~~~^~~~~~~
    x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -L../lib_shared -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/ctf/core.o -L../lib_shared -lctf -lblas -lmpicxx -o /home/me/Downloads/pythonbranch/ctf/src_python/ctf/core.cpython-36m-x86_64-linux-gnu.so -std=c++11
    /usr/bin/ld: cannot find -lmpicxx
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-g++' failed with exit status 1
    Makefile:109: recipe for target 'pylib' failed
    make: *** [pylib] Error 1

    Here I don't know what to do further. Thanks in advance for the help.

solomonik commented 6 years ago

Hi @bigerl, are you working with the master or python branch of CTF? The master branch has essentially no working python support, while the python branch has fairly mature support by now and a different build process. We are planning to merge that to master and have a release with python within two weeks, but are still tweaking things to make sure the build process handles new options (shared lib build and python build) and optional dependencies appropriately, and functionality works fine.

If you are on the python branch already, I'd be happy to help debug your build process there.

bigerl commented 6 years ago

Hi @solomonik, yes, I'm using the python branch. I'm looking forward for the release. Maybe I can replace my own sparse tensor einsum implementation then with this one. It seems quite mature. And thank you for helping.

solomonik commented 6 years ago

@bigerl thanks for the detailed error report. It looks like you need to specify a path to the MPI libs. You can try to do so by adding the MPI library directory to LD_LIBRARY_PATH and PYTHON_PATH (keep in mind a shared mpi library is necessary). Alternatively (or additionally) you can try setting lib_dirs in setup.py. Please let me know if these work or run into issues, I haven't tried getting python working with OpenMPI yet. Suggestions for how the build process could have been improved to fix issues you encountered are also much appreciated since now is a good window to shape the CTF python build system.

bigerl commented 6 years ago

thanks. I had to add the paths for headers and shared libraries to the setup.py's include_dirs and library_dirs. Then make pylibsucceeded. But make python fails now with an error I don't know how it comes:

cd src_python && LDFLAGS="-L../lib_shared" python setup.py build_ext --inplace  && cd ..
running build_ext
cd src_python && pip -vv install . --upgrade
Processing /home/me/Downloads/ctf/src_python
  Running setup.py (path:/tmp/pip-ZoWrPF-build/setup.py) egg_info for package from file:///home/me/Downloads/ctf/src_python
    Running command python setup.py egg_info
    running egg_info
    creating pip-egg-info/CTF.egg-info
    writing pip-egg-info/CTF.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/CTF.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/CTF.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/CTF.egg-info/SOURCES.txt'
    reading manifest file 'pip-egg-info/CTF.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/CTF.egg-info/SOURCES.txt'
  Source in /tmp/pip-ZoWrPF-build has version 1.5.0, which satisfies requirement CTF==1.5.0 from file:///home/me/Downloads/ctf/src_python
Installing collected packages: CTF
  Running setup.py install for CTF ...     Running command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-ZoWrPF-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mU2j0C-record/install-record.txt --single-version-externally-managed --compile
    running install
    running build
    running build_py
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/ctf
    copying ctf/__init__.py -> build/lib.linux-x86_64-2.7/ctf
    running build_ext
    building 'ctf.core' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ictf -I. -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/mpich-x86_64 -I/usr/include/python2.7 -c ctf/core.cpp -o build/temp.linux-x86_64-2.7/ctf/core.o -std=c++11 -O0 -g
    In file included from /usr/include/bits/libc-header-start.h:33:0,
                     from /usr/include/limits.h:26,
                     from /usr/lib/gcc/x86_64-redhat-linux/7/include/limits.h:194,
                     from /usr/lib/gcc/x86_64-redhat-linux/7/include/syslimits.h:7,
                     from /usr/lib/gcc/x86_64-redhat-linux/7/include/limits.h:34,
                     from /usr/include/python2.7/Python.h:19,
                     from ctf/core.cpp:45:
    /usr/include/features.h:373:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
     #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
        ^~~~~~~
    In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1788:0,
                     from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from ctf/core.cpp:587:
    /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^~~~~~~
    ctf/core.cpp:591:10: fatal error: ctf.hpp: No such file or directory
     #include "ctf.hpp"
              ^~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
error
Cleaning up...
  Removing source in /tmp/pip-ZoWrPF-build
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-ZoWrPF-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mU2j0C-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ZoWrPF-build/
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 365, in run
    strip_file_prefix=options.strip_file_prefix,
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 882, in install
    spinner=spinner,
  File "/usr/lib/python2.7/site-packages/pip/utils/__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-ZoWrPF-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mU2j0C-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ZoWrPF-build/
make: *** [Makefile:105: python] Error 1

I think the important lines are:

ctf/core.cpp:591:10: fatal error: ctf.hpp: No such file or directory
     #include "ctf.hpp"
              ^~~~~~~~~
    compilation terminated.

Have you any suggestions? edit: I tried with python2+pip2 and python3+pip3 as well as with pip --user. Same result, always.

solomonik commented 6 years ago

It looks like you need to run sudo make install or make install with choice of INSTALL_DIR in config.mk that is in your PATH. Sorry this is not well documented, we just changed the build system structure this weekend on the branch. After make python with a global CTF install works you should be to easily use CTF python though.

bigerl commented 6 years ago

ok, finally got it working. I set a INSTALL_DIR = /ctflib in config.mk. Then I had to add use sudo su to run make install because sudo make install did not find mpicxx despite its directory was in sudo echo $PATH. Couldn't find out why. make install in su failed first due to non-existing folders, but adding:

install: $(BDIR)/lib/libctf.a $(BDIR)/lib_shared/libctf.so
    mkdir -p $(INSTALL_DIR)/lib/
    mkdir -p $(INSTALL_DIR)/include/
    ...

resolved that. To run non-su make python afterwards I had to add "/ctflib/include" to include_dirs and "/ctflib/lib" to lib_dirs in setup.py additionally. As well as adding --user to pip install:

python: pylib
    cd src_python && pip install . --upgrade --user 

I'll check now if it actually works. :)

bigerl commented 6 years ago

I can't see how to use the package. Could you maybe provide a minimal working example of for example a einsum of randomly filled tensors?

solomonik commented 6 years ago

Hi @bigerl glad you where able to get it to build. INSTALL_DIR=/ctflib is a bit strange, typical is INSTALL_DIR=/usr/local/, which should have been there if you executed the latest version of ./configure successfully. On linux systems this is the typical way to install software from source.

For an example, this jupyter notebook has exactly what you are looking for with einsum

https://github.com/solomonik/ctf/blob/python/doc/CTF%20introductory%20demo.ipynb

It should look like this

http://solomonik.cs.illinois.edu/demos/CTF_introductory_demo.html

And hmm, I guess if you had to user --user in pip install, the you are not running python out of a virtualenv (which I would recommend, mostly have tested CTF with python 3.5). I will look into whether adding --user by default makes sense. Likely we'll also move toward trying to at least partially generate the setup.py from configure.

bigerl commented 6 years ago

Thanks. That's exacly what I was looking for. But I ran into another problem: When I run now import ctf it doesn't find the linked library:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/me/.pyenv/versions/ctf354venv/lib/python3.5/site-packages/ctf/__init__.py", line 1, in <module>
    from ctf.core import *
ImportError: libctf.so: cannot open shared object file: No such file or directory

I have the same problem running the whole build process with python versions 2.7.14, 3.5.4 and 3.6.3. I now used virtualenv so I didn't use --user this time and I set INSTALL_DIR to the default /usr/local. Do you have a tip where I have to add an path or where I should copy the libctf.so?

solomonik commented 6 years ago

If you run make install, libctf.so should end up in the INSTALL_DIR, so we just need to make sure python finds that. That requires some combination of PATH, PYTHONPATH, LD_LIBRARY_PATH being set appropriately to point to the directory /usr/local/lib (check to make sure that's where libctf.so is). I believe LD_LIBRARY_PATH is likely what needs to be set, but mentioning them all in case I am wrong.

bigerl commented 6 years ago

next step: It was actually looking into /usr/local/lib but not for libctf.so but for ctf.so. But after I created a copy of the library with the appropriate name I got the next error when running import ctf:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/ctf.so: undefined symbol: cscal_

or with python -vv

# trying /home/me/Downloads/ctf/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/Downloads/ctf/ctf.abi3.so
# trying /home/me/Downloads/ctf/ctf.so
# trying /home/me/Downloads/ctf/ctf.py
# trying /home/me/Downloads/ctf/ctf.pyc
# trying /home/me/Downloads/ctf/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/Downloads/ctf/ctf.abi3.so
# trying /home/me/Downloads/ctf/ctf.so
# trying /home/me/Downloads/ctf/ctf.py
# trying /home/me/Downloads/ctf/ctf.pyc
# trying /usr/local/lib/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /usr/local/lib/ctf.abi3.so
# trying /usr/local/lib/ctf.so
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 938, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: /usr/local/lib/ctf.so: undefined symbol: cscal_

comment: I was working from the folder /home/me/Downloads/ctf/.

edit: and here also the complete python -vv trace when /usr/local/lib/ctf.so doesn't exist.

>>> import ctf
# trying /home/me/Downloads/ctf/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/Downloads/ctf/ctf.abi3.so
# trying /home/me/Downloads/ctf/ctf.so
# trying /home/me/Downloads/ctf/ctf.py
# trying /home/me/Downloads/ctf/ctf.pyc
# trying /home/me/Downloads/ctf/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/Downloads/ctf/ctf.abi3.so
# trying /home/me/Downloads/ctf/ctf.so
# trying /home/me/Downloads/ctf/ctf.py
# trying /home/me/Downloads/ctf/ctf.pyc
# trying /usr/local/lib/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /usr/local/lib/ctf.abi3.so
# trying /usr/local/lib/ctf.so
# trying /usr/local/lib/ctf.py
# trying /usr/local/lib/ctf.pyc
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/ctf.abi3.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/ctf.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/ctf.py
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/ctf.pyc
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/plat-linux/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/plat-linux/ctf.abi3.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/plat-linux/ctf.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/plat-linux/ctf.py
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/plat-linux/ctf.pyc
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/lib-dynload/ctf.cpython-35m-x86_64-linux-gnu.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/lib-dynload/ctf.abi3.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/lib-dynload/ctf.so
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/lib-dynload/ctf.py
# trying /home/me/.pyenv/versions/3.5.4/lib/python3.5/lib-dynload/ctf.pyc
# /home/me/.pyenv/versions/ctf354venv/lib/python3.5/site-packages/ctf/__pycache__/__init__.cpython-35.pyc matches /home/me/.pyenv/versions/ctf354venv/lib/python3.5/site-packages/ctf/__init__.py
# code object from '/home/me/.pyenv/versions/ctf354venv/lib/python3.5/site-packages/ctf/__pycache__/__init__.cpython-35.pyc'
# trying /home/me/.pyenv/versions/ctf354venv/lib/python3.5/site-packages/ctf/core.cpython-35m-x86_64-linux-gnu.so
# destroy ctf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/me/.pyenv/versions/ctf354venv/lib/python3.5/site-packages/ctf/__init__.py", line 1, in <module>
    from ctf.core import *
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 938, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: libctf.so: cannot open shared object file: No such file or directory
solomonik commented 6 years ago

@bigerl the first error suggests that you also need to add shared BLAS libraries (libblas.so) to your link path, as ctflib.so

solomonik commented 6 years ago

The build system in the latest release should make this process significantly smoother, so I am closing this issue. Please let me know if you still encounter any issues in building or execution.