getkeops / keops

KErnel OPerationS, on CPUs and GPUs, with autodiff and without memory overflows
https://www.kernel-operations.io
MIT License
1.05k stars 64 forks source link

Compilation error: "This file requires compiler and library support for the ISO C++ 2011 standard." #102

Closed akhisud3195 closed 4 years ago

akhisud3195 commented 4 years ago

Following the example at: https://www.kernel-operations.io/keops/_auto_tutorials/kmeans/plot_kmeans_torch.html, I get the following error when I run

cl, c = KMeans(x, K)
Compiling libKeOpstorch2dc63d312d in /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch2dc63d312d:
       formula: ArgMin_Reduction(Sum(Square((Var(0,2,0) - Var(1,2,1)))),0)
       aliases: Var(0,2,0); Var(1,2,1); 
       dtype  : float32
... 
--------------------- CMAKE DEBUG -----------------
Command '['cmake', '/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops', "-DCMAKE_BUILD_TYPE='Release'", "-DFORMULA_OBJ='ArgMin_Reduction(Sum(Square((Var(0,2,0) - Var(1,2,1)))),0)'", "-DVAR_ALIASES=''", "-Dshared_obj_name='libKeOpstorch2dc63d312d'", "-D__TYPE__='float'", "-DPYTHON_LANG='torch'", "-DPYTHON_EXECUTABLE='/home/akhilesh/anaconda3/bin/python'", "-DPYBIND11_PYTHON_VERSION='3.8'", '-DC_CONTIGUOUS=1', '-DPYTORCH_ROOT_DIR=/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch', '-D_GLIBCXX_USE_CXX11_ABI=0', '-D__TYPEACC__=float', "-DcommandLine=cmake /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -DCMAKE_BUILD_TYPE='Release' -DFORMULA_OBJ='ArgMin_Reduction(Sum(Square((Var(0,2,0) - Var(1,2,1)))),0)' -DVAR_ALIASES='' -Dshared_obj_name='libKeOpstorch2dc63d312d' -D__TYPE__='float' -DPYTHON_LANG='torch' -DPYTHON_EXECUTABLE='/home/akhilesh/anaconda3/bin/python' -DPYBIND11_PYTHON_VERSION='3.8' -DC_CONTIGUOUS=1 -DPYTORCH_ROOT_DIR=/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch -D_GLIBCXX_USE_CXX11_ABI=0 -D__TYPEACC__=float"]' returned non-zero exit status 1.
-- Configuring incomplete, errors occurred!

--------------------- ----------- -----------------

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpstorch2dc63d312d', '--', 'VERBOSE=1']' returned non-zero exit status 1.

--------------------- ----------- -----------------
Done.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-16-c6387bb2b1a6> in <module>
----> 1 cl, c = KMeans_(x, K)

<ipython-input-9-908cc44b42b5> in KMeans_(x, K, Niter, verbose)
     14         c_j = LazyTensor(c[None, :, :])  # (1, Nclusters, D)
     15         D_ij = ((x_i - c_j) ** 2).sum(-1)  # (Npoints, Nclusters) symbolic matrix of squared distances
---> 16         cl = D_ij.argmin(dim=1).long().view(-1)  # Points -> Nearest cluster
     17 
     18         Ncl = torch.bincount(cl).type(torchtype[dtype])  # Class weights

~/anaconda3/lib/python3.8/site-packages/pykeops/common/lazy_tensor.py in argmin(self, axis, dim, **kwargs)
   1510             return self.unary("ArgMin", dimres=1)
   1511         else:
-> 1512             return self.reduction("ArgMin", axis=axis, **kwargs)
   1513 
   1514     def argmin_reduction(self, axis=None, dim=None, **kwargs):

~/anaconda3/lib/python3.8/site-packages/pykeops/common/lazy_tensor.py in reduction(self, reduction_op, other, opt_arg, axis, dim, call, **kwargs)
    558 
    559         if call and len(res.symbolic_variables) == 0 and res.dtype is not None:
--> 560             return res()
    561         else:
    562             return res

~/anaconda3/lib/python3.8/site-packages/pykeops/common/lazy_tensor.py in __call__(self, *args, **kwargs)
    714             args = (self.other.variables[0],)
    715 
--> 716         return self.callfun(*args, *self.variables, **self.kwargs)
    717 
    718     def __str__(self):

~/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in __call__(self, backend, device_id, ranges, *args)
    393             args, ranges, tag_dummy, N = preprocess_half2(args, self.aliases, self.axis, ranges, nx, ny)
    394 
--> 395         out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype, 
    396                                    device_id, ranges, self.accuracy_flags, *args)
    397 

~/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in forward(ctx, formula, aliases, backend, dtype, device_id, ranges, accuracy_flags, *args)
     20         optional_flags = include_dirs + accuracy_flags
     21 
---> 22         myconv = LoadKeOps(formula, aliases, dtype, 'torch', optional_flags).import_module()
     23 
     24         # Context variables: save everything to compute the gradient:

~/anaconda3/lib/python3.8/site-packages/pykeops/common/keops_io.py in import_module(self)
     68 
     69     def import_module(self):
---> 70         return importlib.import_module(self.dll_name)

~/anaconda3/lib/python3.8/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'libKeOpstorch2dc63d312d'
jeanfeydy commented 4 years ago

Hi @akhisud3195 ,

This issue is probably related to a configuration problem: could you please run our test script and report the results? This will help us to find a solution quickly.

Best regards, Jean

akhisud3195 commented 4 years ago

Hey, here's what I get with the test script:

Compiling libKeOpstorch71f3007f7c in /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c:
       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3); 
       dtype  : float32
... 
--------------------- CMAKE DEBUG -----------------
Command '['cmake', '/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops', "-DCMAKE_BUILD_TYPE='Release'", "-DFORMULA_OBJ='Sum_Reduction(SqNorm2(x - y),1)'", "-DVAR_ALIASES='auto x = Vi(0,3); auto y = Vj(1,3); '", "-Dshared_obj_name='libKeOpstorch71f3007f7c'", "-D__TYPE__='float'", "-DPYTHON_LANG='torch'", "-DPYTHON_EXECUTABLE='/home/akhilesh/anaconda3/bin/python'", "-DPYBIND11_PYTHON_VERSION='3.8'", '-DC_CONTIGUOUS=1', '-DPYTORCH_ROOT_DIR=/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch', '-D_GLIBCXX_USE_CXX11_ABI=0', '-D__TYPEACC__=float', '-DSUM_SCHEME=1', "-DcommandLine=cmake /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -DCMAKE_BUILD_TYPE='Release' -DFORMULA_OBJ='Sum_Reduction(SqNorm2(x - y),1)' -DVAR_ALIASES='auto x = Vi(0,3); auto y = Vj(1,3); ' -Dshared_obj_name='libKeOpstorch71f3007f7c' -D__TYPE__='float' -DPYTHON_LANG='torch' -DPYTHON_EXECUTABLE='/home/akhilesh/anaconda3/bin/python' -DPYBIND11_PYTHON_VERSION='3.8' -DC_CONTIGUOUS=1 -DPYTORCH_ROOT_DIR=/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch -D_GLIBCXX_USE_CXX11_ABI=0 -D__TYPEACC__=float -DSUM_SCHEME=1"]' returned non-zero exit status 1.
-- Configuring incomplete, errors occurred!

--------------------- ----------- -----------------

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpstorch71f3007f7c', '--', 'VERBOSE=1']' returned non-zero exit status 1.

--------------------- ----------- -----------------
Done.
Compiling libKeOpstorch71f3007f7c in /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c:
       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3); 
       dtype  : float32
... 
--------------------- CMAKE DEBUG -----------------
Command '['cmake', '/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops', "-DCMAKE_BUILD_TYPE='Release'", "-DFORMULA_OBJ='Sum_Reduction(SqNorm2(x - y),1)'", "-DVAR_ALIASES='auto x = Vi(0,3); auto y = Vj(1,3); '", "-Dshared_obj_name='libKeOpstorch71f3007f7c'", "-D__TYPE__='float'", "-DPYTHON_LANG='torch'", "-DPYTHON_EXECUTABLE='/home/akhilesh/anaconda3/bin/python'", "-DPYBIND11_PYTHON_VERSION='3.8'", '-DC_CONTIGUOUS=1', '-DPYTORCH_ROOT_DIR=/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch', '-D_GLIBCXX_USE_CXX11_ABI=0', '-D__TYPEACC__=float', '-DSUM_SCHEME=1', "-DcommandLine=cmake /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -DCMAKE_BUILD_TYPE='Release' -DFORMULA_OBJ='Sum_Reduction(SqNorm2(x - y),1)' -DVAR_ALIASES='auto x = Vi(0,3); auto y = Vj(1,3); ' -Dshared_obj_name='libKeOpstorch71f3007f7c' -D__TYPE__='float' -DPYTHON_LANG='torch' -DPYTHON_EXECUTABLE='/home/akhilesh/anaconda3/bin/python' -DPYBIND11_PYTHON_VERSION='3.8' -DC_CONTIGUOUS=1 -DPYTORCH_ROOT_DIR=/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch -D_GLIBCXX_USE_CXX11_ABI=0 -D__TYPEACC__=float -DSUM_SCHEME=1"]' returned non-zero exit status 1.
-- Configuring incomplete, errors occurred!

--------------------- ----------- -----------------

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpstorch71f3007f7c', '--', 'VERBOSE=1']' returned non-zero exit status 1.

--------------------- ----------- -----------------
Done.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~/anaconda3/lib/python3.8/site-packages/pykeops/test/install.py in test_torch_bindings()
     54     my_conv = pktorch.Genred(formula, var)
---> 55     if torch.allclose(my_conv(x, y).view(-1), torch.tensor(expected_res).type(torch.float32)):
     56       print("\npyKeOps with torch bindings is working!\n")

~/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in __call__(self, backend, device_id, ranges, *args)
    394 
--> 395         out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype, 
    396                                    device_id, ranges, self.accuracy_flags, *args)

~/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in forward(ctx, formula, aliases, backend, dtype, device_id, ranges, accuracy_flags, *args)
     21 
---> 22         myconv = LoadKeOps(formula, aliases, dtype, 'torch', optional_flags).import_module()
     23 

~/anaconda3/lib/python3.8/site-packages/pykeops/common/keops_io.py in import_module(self)
     69     def import_module(self):
---> 70         return importlib.import_module(self.dll_name)

~/anaconda3/lib/python3.8/importlib/__init__.py in import_module(name, package)
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'libKeOpstorch71f3007f7c'

During handling of the above exception, another exception occurred:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-115-9c28a002d77a> in <module>
      1 import pykeops
      2 pykeops.clean_pykeops()          # just in case old build files are still present
----> 3 pykeops.test_torch_bindings()    # perform the compilation

~/anaconda3/lib/python3.8/site-packages/pykeops/test/install.py in test_torch_bindings()
     64     pykeops.build_type = "Debug"
     65     my_conv = pktorch.Genred(formula, var)
---> 66     print(my_conv(x, y))
     67 

~/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in __call__(self, backend, device_id, ranges, *args)
    393             args, ranges, tag_dummy, N = preprocess_half2(args, self.aliases, self.axis, ranges, nx, ny)
    394 
--> 395         out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype, 
    396                                    device_id, ranges, self.accuracy_flags, *args)
    397 

~/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py in forward(ctx, formula, aliases, backend, dtype, device_id, ranges, accuracy_flags, *args)
     20         optional_flags = include_dirs + accuracy_flags
     21 
---> 22         myconv = LoadKeOps(formula, aliases, dtype, 'torch', optional_flags).import_module()
     23 
     24         # Context variables: save everything to compute the gradient:

~/anaconda3/lib/python3.8/site-packages/pykeops/common/keops_io.py in import_module(self)
     68 
     69     def import_module(self):
---> 70         return importlib.import_module(self.dll_name)

~/anaconda3/lib/python3.8/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda3/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'libKeOpstorch71f3007f7c'
jeanfeydy commented 4 years ago

Hi @akhisud3195 ,

Thanks! I see that you are running PyKeOps through a Jupyter notebook: some of the CMake error messages have probably been redirected to the error output of the server program. Do you have access to your Jupyer server (e.g. the terminal where you typed jupyter notebook), and if yes, do you see any error message there? Otherwise, could you try to run the test program through a simple test.py file? On my own shared cluster at Imperial College, I get very similar errors whenever I exceed my disk usage quota: the solution is usually to remove some files from my home folder.

Best regards, Jean

akhisud3195 commented 4 years ago

No luck with running it on terminal through a test.py file either:

       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float32
... In file included from /usr/include/c++/5/type_traits:35:0,
                 from /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/lib/sequences/include/tao/seq/concatenate.hpp:7,
                 from /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/core/formulas/maths/TensorDot.h:10,
                 from /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/keops_includes.h:43,
                 from /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/libKeOpstorch71f3007f7c.h:8,
                 from <command-line>:0:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
CMake Error at keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.Release.cmake:220 (message):
  Error generating
  /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o

make[3]: *** [CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o] Error 1
make[2]: *** [CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/all] Error 2
make[1]: *** [CMakeFiles/libKeOpstorch71f3007f7c.dir/rule] Error 2
make: *** [libKeOpstorch71f3007f7c] Error 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpstorch71f3007f7c', '--', 'VERBOSE=1']' returned non-zero exit status 2.
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -S/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -B/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make  -f CMakeFiles/Makefile2 libKeOpstorch71f3007f7c
make[1]: Entering directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -S/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -B/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c --check-build-system CMakeFiles/Makefile.cmake 0
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -E cmake_progress_start /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles 4
/usr/bin/make  -f CMakeFiles/Makefile2 CMakeFiles/libKeOpstorch71f3007f7c.dir/all
make[2]: Entering directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
/usr/bin/make  -f CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/build.make CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/depend
make[3]: Entering directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
[ 25%] Building NVCC (Device) object CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o
cd /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core && /home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -E make_directory /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/.
cd /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core && /home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING=Release -D generated_file:STRING=/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o -D generated_cubin_file:STRING=/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.cubin.txt -P /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.Release.cmake
-- Removing /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -E rm -f /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o
-- Generating dependency file: /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.NVCC-depend
/usr/local/cuda/bin/nvcc -M -D__CUDACC__ /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/core/link_autodiff.cu -o /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.NVCC-depend -m64 -DkeopslibKeOpstorch71f3007f7c_EXPORTS -DMAXIDGPU=0 -DMAXTHREADSPERBLOCK0=1024 -DSHAREDMEMPERBLOCK0=49152 -D_FORCE_INLINES -DCUDA_BLOCK_SIZE=192 -DUSE_CUDA=1 -D__TYPE__=float -DC_CONTIGUOUS=1 -D__TYPEACC__=float -DSUM_SCHEME=1 -D_GLIBCXX_USE_CXX11_ABI=0 -DUSE_DOUBLE=0 -DUSE_HALF=0 -DMODULE_NAME=libKeOpstorch71f3007f7c -DKERNEL_GEOM_TYPE=0 -DKERNEL_SIG_TYPE=0 -DKERNEL_SPHERE_TYPE=0 -DMODULE_NAME_FSHAPE_SCP=fshape_scp_gaussiangaussiangaussian_unoriented_float -Xcompiler ,\"-DUSE_OPENMP\",\"-fopenmp\",\"-Wall\",\"-Wno-unknown-pragmas\",\"-fmax-errors=2\",\"-fPIC\",\"-O3\",\"-DNDEBUG\",\"-O3\" -gencode arch=compute_37,code=sm_37 --use_fast_math --compiler-options=-fPIC -ccbin /usr/bin/c++ --pre-include=libKeOpstorch71f3007f7c.h -DNVCC -I/usr/local/cuda/include -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops -I/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch/include -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include
CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/build.make:82: recipe for target 'CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o' failed
make[3]: Leaving directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
CMakeFiles/Makefile2:317: recipe for target 'CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/all' failed
make[2]: Leaving directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
CMakeFiles/Makefile2:297: recipe for target 'CMakeFiles/libKeOpstorch71f3007f7c.dir/rule' failed
make[1]: Leaving directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
Makefile:215: recipe for target 'libKeOpstorch71f3007f7c' failed

--------------------- ----------- -----------------
Done.
Compiling libKeOpstorch71f3007f7c in /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c:
       formula: Sum_Reduction(SqNorm2(x - y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float32
... In file included from /usr/include/c++/5/type_traits:35:0,
                 from /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/lib/sequences/include/tao/seq/concatenate.hpp:7,
                 from /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/core/formulas/maths/TensorDot.h:10,
                 from /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/keops_includes.h:43,
                 from /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/libKeOpstorch71f3007f7c.h:8,
                 from <command-line>:0:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
CMake Error at keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.Release.cmake:220 (message):
  Error generating
  /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o

make[3]: *** [CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o] Error 1
make[2]: *** [CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/all] Error 2
make[1]: *** [CMakeFiles/libKeOpstorch71f3007f7c.dir/rule] Error 2
make: *** [libKeOpstorch71f3007f7c] Error 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpstorch71f3007f7c', '--', 'VERBOSE=1']' returned non-zero exit status 2.
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -S/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -B/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make  -f CMakeFiles/Makefile2 libKeOpstorch71f3007f7c
make[1]: Entering directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -S/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -B/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c --check-build-system CMakeFiles/Makefile.cmake 0
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -E cmake_progress_start /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles 4
/usr/bin/make  -f CMakeFiles/Makefile2 CMakeFiles/libKeOpstorch71f3007f7c.dir/all
make[2]: Entering directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
/usr/bin/make  -f CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/build.make CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/depend
make[3]: Entering directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
[ 25%] Building NVCC (Device) object CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o
cd /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core && /home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -E make_directory /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/.
cd /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core && /home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING=Release -D generated_file:STRING=/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o -D generated_cubin_file:STRING=/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.cubin.txt -P /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.Release.cmake
-- Removing /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o
/home/akhilesh/anaconda3/lib/python3.8/site-packages/cmake/data/bin/cmake -E rm -f /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/./keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o
-- Generating dependency file: /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.NVCC-depend
/usr/local/cuda/bin/nvcc -M -D__CUDACC__ /home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops/core/link_autodiff.cu -o /home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c/CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o.NVCC-depend -m64 -DkeopslibKeOpstorch71f3007f7c_EXPORTS -DMAXIDGPU=0 -DMAXTHREADSPERBLOCK0=1024 -DSHAREDMEMPERBLOCK0=49152 -D_FORCE_INLINES -DCUDA_BLOCK_SIZE=192 -DUSE_CUDA=1 -D__TYPE__=float -DC_CONTIGUOUS=1 -D__TYPEACC__=float -DSUM_SCHEME=1 -D_GLIBCXX_USE_CXX11_ABI=0 -DUSE_DOUBLE=0 -DUSE_HALF=0 -DMODULE_NAME=libKeOpstorch71f3007f7c -DKERNEL_GEOM_TYPE=0 -DKERNEL_SIG_TYPE=0 -DKERNEL_SPHERE_TYPE=0 -DMODULE_NAME_FSHAPE_SCP=fshape_scp_gaussiangaussiangaussian_unoriented_float -Xcompiler ,\"-DUSE_OPENMP\",\"-fopenmp\",\"-Wall\",\"-Wno-unknown-pragmas\",\"-fmax-errors=2\",\"-fPIC\",\"-O3\",\"-DNDEBUG\",\"-O3\" -gencode arch=compute_37,code=sm_37 --use_fast_math --compiler-options=-fPIC -ccbin /usr/bin/c++ --pre-include=libKeOpstorch71f3007f7c.h -DNVCC -I/usr/local/cuda/include -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/keops -I/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch/include -I/home/akhilesh/anaconda3/lib/python3.8/site-packages/torch/include/torch/csrc/api/include
CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/build.make:82: recipe for target 'CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/keops/core/keopslibKeOpstorch71f3007f7c_generated_link_autodiff.cu.o' failed
make[3]: Leaving directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
CMakeFiles/Makefile2:317: recipe for target 'CMakeFiles/keopslibKeOpstorch71f3007f7c.dir/all' failed
make[2]: Leaving directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
CMakeFiles/Makefile2:297: recipe for target 'CMakeFiles/libKeOpstorch71f3007f7c.dir/rule' failed
make[1]: Leaving directory '/home/akhilesh/.cache/pykeops-1.4.1-cpython-38/build-libKeOpstorch71f3007f7c'
Makefile:215: recipe for target 'libKeOpstorch71f3007f7c' failed

--------------------- ----------- -----------------
Done.
Traceback (most recent call last):
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/test/install.py", line 55, in test_torch_bindings
    if torch.allclose(my_conv(x, y).view(-1), torch.tensor(expected_res).type(torch.float32)):
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py", line 395, in __call__
    out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype,
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py", line 22, in forward
    myconv = LoadKeOps(formula, aliases, dtype, 'torch', optional_flags).import_module()
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/common/keops_io.py", line 70, in import_module
    return importlib.import_module(self.dll_name)
  File "/home/akhilesh/anaconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpstorch71f3007f7c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "keops_test.py", line 3, in <module>
    pykeops.test_torch_bindings()
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/test/install.py", line 66, in test_torch_bindings
    print(my_conv(x, y))
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py", line 395, in __call__
    out = GenredAutograd.apply(self.formula, self.aliases, backend, self.dtype,
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/torch/generic/generic_red.py", line 22, in forward
    myconv = LoadKeOps(formula, aliases, dtype, 'torch', optional_flags).import_module()
  File "/home/akhilesh/anaconda3/lib/python3.8/site-packages/pykeops/common/keops_io.py", line 70, in import_module
    return importlib.import_module(self.dll_name)
  File "/home/akhilesh/anaconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpstorch71f3007f7c'

Doesn't seem to be a disk space problem (I have 15G disk free).

jeanfeydy commented 4 years ago

Hi @akhisud3195 ,

Thanks! Fortunately, the error message is much more explicit this time: the problem comes from the lack of support for the C++11 revision provided by your default gcc compiler. This is highly reminiscent of #37, which was solved by switching to g++7/gcc7. This is the main reason why g++>=7 is listed as one of our dependencies... but it's very easy to miss, I agree with you! Given your error trace I suspect that you are currently using gcc5/g++5: following the instructions from this StackOverflow post is likely to solve your problem :-)

Did it work?

Best regards, Jean

akhisud3195 commented 4 years ago

Thanks @jeanfeydy ! This fixed it.

jeanfeydy commented 4 years ago

Perfect! I hope that you'll find the library useful: feel free to open a new issue if you have any other question.

Best regards, Jean