blitzpp / blitz

Blitz++ Multi-Dimensional Array Library for C++
https://github.com/blitzpp/blitz/wiki
Other
402 stars 83 forks source link

Python3 #145

Closed papadop closed 4 years ago

papadop commented 4 years ago

Allow for python3 builds. Tested on fedora 30 with a python3 build. Can someone check a build with python2 ? Otherwise, I can try to force a python2 build, but that would require to change some cmake files, so it would not test exactly the current stuff...

Note: The current change favours python3 other python2 when both are available. I think this is the right choice, as python2 is on a end of life path for quite some time...

slayoo commented 4 years ago

Thanks!

slayoo commented 4 years ago

Python 2 was actually checked by CI scripts - it's still the default on Travis Linux boxes Will look in a moment what's wrong with OSX builds Thanks again!

slayoo commented 4 years ago

OK, the problem is that FindPython was introduced only in CMake 3.12 (https://cmake.org/cmake/help/latest/release/3.12.html)

So, either we require newer CMake (thumbs up) or we do something along this: https://github.com/ddnet/ddnet/pull/1353/files

slayoo commented 4 years ago

Suggest:

mehrdad19 commented 4 years ago

The same problem exists. Fail to install. Here is the log file. I tried to install using Spack.

==> Executing phase: 'autoreconf' ==> Executing phase: 'configure' ==> [2019-08-12-16:13:58.936459] '/home/mehrdad/spack/var/spack/stage/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz/spack-src/configure' '--prefix=/home/mehrdad/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz' checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no configure:

Configuring blitz 0.10 for x86_64-unknown-linux-gnu

checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether /home/mehrdad/spack/lib/spack/env/gcc/g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of /home/mehrdad/spack/lib/spack/env/gcc/g++... gcc3 checking whether using /home/mehrdad/spack/lib/spack/env/gcc/g++ preset flags... yes configure: Setting compiler flags for GNU /home/mehrdad/spack/lib/spack/env/gcc/g++ (wahoo!) checking whether to enable Fortran compilation for benchmark codes... yes checking whether we are using the GNU Fortran 77 compiler... yes checking whether /home/mehrdad/spack/lib/spack/env/gcc/gfortran accepts -g... yes checking whether we are using the GNU Fortran compiler... yes checking whether /home/mehrdad/spack/lib/spack/env/gcc/gfortran accepts -g... yes checking whether using Fortran preset flags... yes checking how to get verbose linking output from /home/mehrdad/spack/lib/spack/env/gcc/gfortran... -v checking for Fortran 77 libraries of /home/mehrdad/spack/lib/spack/env/gcc/gfortran... -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath checking how to get verbose linking output from /home/mehrdad/spack/lib/spack/env/gcc/gfortran... -v checking for Fortran libraries of /home/mehrdad/spack/lib/spack/env/gcc/gfortran... -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath checking for Fortran flag needed to accept free-form source... -ffree-form checking for Fortran flag to compile .f90 files... none checking compiler specific header... gnu/bzconfig.h checking for makeinfo... ${SHELL} /tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/config/missing makeinfo checking for texi2html... no checking whether to enable C++/Fortran 64-bit compilation flags... no checking how to print strings... printf checking for gcc... /home/mehrdad/spack/lib/spack/env/gcc/gcc checking whether we are using the GNU C compiler... yes checking whether /home/mehrdad/spack/lib/spack/env/gcc/gcc accepts -g... yes checking for /home/mehrdad/spack/lib/spack/env/gcc/gcc option to accept ISO C89... none needed checking whether /home/mehrdad/spack/lib/spack/env/gcc/gcc understands -c and -o together... yes checking dependency style of /home/mehrdad/spack/lib/spack/env/gcc/gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by /home/mehrdad/spack/lib/spack/env/gcc/gcc... /home/mehrdad/spack/lib/spack/env/ld checking if the linker (/home/mehrdad/spack/lib/spack/env/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /home/mehrdad/spack/lib/spack/env/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from /home/mehrdad/spack/lib/spack/env/gcc/gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... /home/mehrdad/spack/lib/spack/env/gcc/gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if /home/mehrdad/spack/lib/spack/env/gcc/gcc supports -fno-rtti -fno-exceptions... no checking for /home/mehrdad/spack/lib/spack/env/gcc/gcc option to produce PIC... -fPIC -DPIC checking if /home/mehrdad/spack/lib/spack/env/gcc/gcc PIC flag -fPIC -DPIC works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gcc static flag -static works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gcc supports -c -o file.o... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gcc supports -c -o file.o... (cached) yes checking whether the /home/mehrdad/spack/lib/spack/env/gcc/gcc linker (/home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking how to run the C++ preprocessor... /home/mehrdad/spack/lib/spack/env/gcc/g++ -E checking for ld used by /home/mehrdad/spack/lib/spack/env/gcc/g++... /home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64 checking if the linker (/home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64) is GNU ld... yes checking whether the /home/mehrdad/spack/lib/spack/env/gcc/g++ linker (/home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes checking for /home/mehrdad/spack/lib/spack/env/gcc/g++ option to produce PIC... -fPIC -DPIC checking if /home/mehrdad/spack/lib/spack/env/gcc/g++ PIC flag -fPIC -DPIC works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/g++ static flag -static works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/g++ supports -c -o file.o... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/g++ supports -c -o file.o... (cached) yes checking whether the /home/mehrdad/spack/lib/spack/env/gcc/g++ linker (/home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking for /home/mehrdad/spack/lib/spack/env/gcc/gfortran option to produce PIC... -fPIC checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran PIC flag -fPIC works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran static flag -static works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran supports -c -o file.o... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran supports -c -o file.o... (cached) yes checking whether the /home/mehrdad/spack/lib/spack/env/gcc/gfortran linker (/home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking for /home/mehrdad/spack/lib/spack/env/gcc/gfortran option to produce PIC... -fPIC checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran PIC flag -fPIC works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran static flag -static works... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran supports -c -o file.o... yes checking if /home/mehrdad/spack/lib/spack/env/gcc/gfortran supports -c -o file.o... (cached) yes checking whether the /home/mehrdad/spack/lib/spack/env/gcc/gfortran linker (/home/mehrdad/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for sin... yes configure:

Checking to see if there is a usable BLAS library kicking around... (If so, Blitz++ will use BLAS library to run benchmarks against if you build the benchmarks. Blitz++ itself does NOT use BLAS).

checking for daxpy_ in -lblas... yes checking for daxpy in -lblas... no checking for DAXPY in -lblas... no checking for daxpy__ in -lblas... no checking whether to enable /home/mehrdad/spack/lib/spack/env/gcc/g++ optimization flags... no checking whether to enable /home/mehrdad/spack/lib/spack/env/gcc/g++ debug flags... no checking whether to enable Blitz thread-safety features... no checking if we are using Intel Threading Building Blocks... no checking for SIMD instruction width... no checking whether to pad array lengths to SIMD instruction width... no checking whether to enable Blitz 64-bit dimensions... no checking whether to enable serialization support... no checking for main in -lpapi... no configure:

C++ compiler (/home/mehrdad/spack/lib/spack/env/gcc/g++ ) characteristics

configure:

Checking major C++ language features

checking whether the compiler implements namespaces... yes checking whether the compiler supports exceptions... yes checking whether the compiler supports Run-Time Type Identification... yes checking whether the compiler supports member constants... yes checking whether the compiler accepts the old for scoping rules... no configure:

Now for some of the new keywords

checking whether the compiler supports the explicit keyword... yes checking whether the compiler supports the mutable keyword... yes checking whether the compiler recognizes typename... yes checking whether the compiler supports the Numerical C Extensions Group restrict keyword... no checking whether the compiler recognizes the 'restrict' keyword... yes checking whether the compiler recognizes bool as a built-in type... yes configure:

Does your compiler understand the newfangled casting syntax?

checking whether the compiler supports const_cast<>... yes checking whether the compiler supports static_cast<>... yes checking whether the compiler supports reinterpret_cast<>... yes checking whether the compiler supports dynamic_cast<>... yes configure:

Okay, now the important stuff -- templates

checking whether the compiler supports basic templates... yes checking whether the compiler supports partial specialization... yes checking whether the compiler supports partial ordering... yes checking whether the compiler supports default template parameters... yes checking whether the compiler supports member templates... yes checking whether the compiler supports member templates outside the class declaration... yes checking whether the compiler recognizes the full specialization syntax... yes checking whether the compiler supports function templates with non-type parameters... yes checking whether the compiler supports template-qualified base class specifiers... yes checking whether the compiler supports template-qualified return types... yes checking whether the compiler supports explicit template function qualification... yes checking whether the compiler supports templates as template arguments... yes checking whether the compiler supports use of the template keyword as a qualifier... yes checking whether the compiler supports function matching with argument types which are template scope-qualified... yes checking whether the compiler will support the vector type promotion mechanism... yes checking whether the compiler supports numeric traits promotions... yes checking whether the compiler handle computations inside an enum... yes checking whether the compiler handles (int) casts in enum computations... yes configure:

Which library features does your compiler provide?

checking whether the compiler has complex... yes checking whether the compiler has standard complex functions... yes checking cstring usability... yes checking cstring presence... yes checking for cstring... yes checking whether the compiler has numeric_limits... yes checking whether the compiler has header... yes checking whether the compiler has valarray... yes checking whether the compiler has complex math functions... yes checking whether the compiler has more complex math functions... no checking whether the compiler supports IEEE math library... yes checking whether the compiler supports System V math library... no checking whether the compiler has C math functions in namespace std... yes checking whether the compiler has C math abs(integer type) in namespace std... yes checking whether complex math functions are in namespace std... yes checking whether the compiler has isnan function in namespace std... yes checking whether the compiler supports ISO C++ standard library... yes checking whether the compiler supports Standard Template Library... yes checking whether the compiler has getrusage() function... yes configure:

CXX = /home/mehrdad/spack/lib/spack/env/gcc/g++ CXXFLAGS = CXX_OPTIMIZE_FLAGS = -O3 -funroll-loops -fstrict-aliasing -fomit-frame-pointer -ffast-math -DUSE_LIBBLAS CXX_DEBUG_FLAGS = -g -DBZ_DEBUG CXXFFLAGS = -DBZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES

F77 = /home/mehrdad/spack/lib/spack/env/gcc/gfortran FFLAGS = -fno-second-underscore F77_OPTIMIZE_FLAGS = -O3 -funroll-loops FLIBS = -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath

FC = /home/mehrdad/spack/lib/spack/env/gcc/gfortran FCFLAGS = -fno-second-underscore -ffree-form FC_OPTIMIZE_FLAGS = -O3 -funroll-loops FCLIBS = -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lgfortran -lm -lquadmath

BLASLIB = -lblas

checking for valgrind... no checking our pkgconfig libname... blitz checking our pkgconfig version... 0.10 checking our pkgconfig_libdir... ${libdir}/pkgconfig expanded our pkgconfig_libdir... /home/mehrdad/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.4.0/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz/lib/pkgconfig checking our pkgconfig_libfile... blitz.pc checking our pkgconfig description... blitz Library checking our pkgconfig requires... checking our pkgconfig ext libs... -lblitz checking our pkgconfig cppflags... noninstalled pkgconfig -L /tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/src/.libs noninstalled pkgconfig -I /tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src//home/mehrdad/spack/var/spack/stage/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz/spack-src checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating bin/Makefile config.status: creating blitz/Makefile config.status: creating blitz/array/Makefile config.status: creating blitz/generate/Makefile config.status: creating blitz/meta/Makefile config.status: creating random/Makefile config.status: creating lib/Makefile config.status: creating testsuite/Makefile config.status: creating examples/Makefile config.status: creating doc/Makefile config.status: creating doc/examples/Makefile config.status: creating doc/stencils/Makefile config.status: creating doc/doxygen/Makefile config.status: creating doc/doxygen/Doxyfile config.status: creating benchmarks/Makefile config.status: creating benchmarks/plot_benchmarks.m config.status: creating blitz/config.h config.status: executing depfiles commands config.status: executing blitz/gnu/bzconfig.h commands config.status: creating blitz/gnu/bzconfig.h - prefix BZ for blitz/config.h defines config.status: executing libtool commands config.status: executing blitz.pc commands config.status: creating blitz.pc.in config.status: creating blitz.pc config.status: creating blitz-uninstalled.pc configure:

The configure script has generated makefiles for your platform. You have several options now:

make lib Check the compiler and create libblitz.a make check-testsuite Build and check the testsuite make check-examples Build and check the examples make check-benchmarks Build and check the benchmarks (takes a long time) make install Install Blitz++ make info Build Blitz++ texinfo documentation make ps Build Blitz++ ps documentation make pdf Build Blitz++ pdf documentation make html Build Blitz++ html documentation make install-info Install Blitz++ texinfo documentation make install-ps Install Blitz++ ps documentation make install-pdf Install Blitz++ pdf documentation make install-html Install Blitz++ html documentation

==> Executing phase: 'build' ==> [2019-08-12-16:14:07.650460] 'make' '-j8' 'lib' make[1]: Entering directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz' make all-recursive make[2]: Entering directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz' Making all in generate make[3]: Entering directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz/generate' make generate-headers make[4]: Entering directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz/generate' python genstencils.py /home/mehrdad/spack/var/spack/stage/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz/spack-src/blitz/array/stencil-classes.cc File "genstencils.py", line 9 print "Generating file %s"%sys.argv[1] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Generating file %s"%sys.argv[1])? Makefile:622: recipe for target '/home/mehrdad/spack/var/spack/stage/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz/spack-src/blitz/array/stencil-classes.cc' failed make[4]: [/home/mehrdad/spack/var/spack/stage/blitz-1.0.1-ygzugsujglfbuugxrmyhewbuv6ythbbz/spack-src/blitz/array/stencil-classes.cc] Error 1 make[4]: Leaving directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz/generate' Makefile:627: recipe for target 'all-local' failed make[3]: [all-local] Error 2 make[3]: Leaving directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz/generate' Makefile:582: recipe for target 'all-recursive' failed make[2]: [all-recursive] Error 1 make[2]: Leaving directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz' Makefile:476: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/tmp/mehrdad/spack-stage/spack-stage-7dofnswn/spack-src/blitz' Makefile:982: recipe for target 'blitz-library' failed make: *** [blitz-library] Error 1

slayoo commented 4 years ago

Please try with CMake and the current github version of Blitz++ (i.e., not a release yet). @citibeth is it possible with Spack?