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

ImportError with PyInit_libKeOpsnumpy73a835aa5f module #2

Closed hichamjanati closed 5 years ago

hichamjanati commented 5 years ago

Hello, great work !

I couldn't run the sample code below with cuda 10 and and cmake 3.14.4

(base) [hicham@gpuserver ~]$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

I made sure I installed pykeops with all dependencies pykeops[full].

import numpy as np
import pykeops
pykeops.verbose = True
from pykeops.numpy import Genred

x = np.arange(1, 10).reshape(-1, 3).astype('float32')
y = np.arange(3, 9 ).reshape(-1, 3).astype('float32')

my_conv = Genred('-SqNorm2(x-y)', ['x = Vi(3)', 'y = Vj(3)'])
print(my_conv(x, y))

Here is the output:

(base) [hicham@gpuserver ~]$ python keopstest.py 
Compiling libKeOpsnumpy73a835aa5f in /home/hicham/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3); 
       dtype  : float64
... -- Compute properties automatically set to: -DMAXIDGPU=12;-DMAXTHREADSPERBLOCK0=1024;-DSHAREDMEMPERBLOCK0=49152;-DMAXTHREADSPERBLOCK1=1024;-DSHAREDMEMPERBLOCK1=49152;-DMAXTHREADSPERBLOCK2=1024;-DSHAREDMEMPERBLOCK2=49152;-DMAXTHREADSPERBLOCK3=1024;-DSHAREDMEMPERBLOCK3=49152;-DMAXTHREADSPERBLOCK4=1024;-DSHAREDMEMPERBLOCK4=49152;-DMAXTHREADSPERBLOCK5=1024;-DSHAREDMEMPERBLOCK5=49152;-DMAXTHREADSPERBLOCK6=1024;-DSHAREDMEMPERBLOCK6=49152;-DMAXTHREADSPERBLOCK7=1024;-DSHAREDMEMPERBLOCK7=49152;-DMAXTHREADSPERBLOCK8=1024;-DSHAREDMEMPERBLOCK8=49152;-DMAXTHREADSPERBLOCK9=1024;-DSHAREDMEMPERBLOCK9=49152;-DMAXTHREADSPERBLOCK10=1024;-DSHAREDMEMPERBLOCK10=49152;-DMAXTHREADSPERBLOCK11=1024;-DSHAREDMEMPERBLOCK11=49152;-DMAXTHREADSPERBLOCK12=1024;-DSHAREDMEMPERBLOCK12=49152
-- The CUDA Host CXX Compiler: /usr/bin/c++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hicham/.cache/pykeops-1.0.2

In file included from /home/hicham/miniconda3/lib/python3.7/site-packages/pykeops/numpy/generic/generic_red.cpp:2:0:
/home/hicham/miniconda3/lib/python3.7/site-packages/torch/include/pybind11/numpy.h:288:5: erreur: 'is_trivially_copyable' is not a member of 'std'
     std::is_trivially_copyable<T>,
     ^
/home/hicham/miniconda3/lib/python3.7/site-packages/torch/include/pybind11/numpy.h:288:5: erreur: 'is_trivially_copyable' is not a member of 'std'
compilation terminated due to -fmax-errors=2.
gmake[3]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/all] Error 2
gmake[1]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/rule] Error 2
gmake: *** [libKeOpsnumpy73a835aa5f] Error 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpsnumpy73a835aa5f']' returned non-zero exit status 2.
[ 20%] Building NVCC (Device) object CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/keops/core/keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o
[ 40%] Linking CUDA device code CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/cmake_device_link.o
[ 60%] Linking CXX shared library libKeOpsnumpy73a835aa5f.so
[ 60%] Built target keopslibKeOpsnumpy73a835aa5f
Scanning dependencies of target libKeOpsnumpy73a835aa5f
[ 80%] Building CXX object CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o

--------------------- ----------- -----------------
Done. 
Traceback (most recent call last):
  File "/home/hicham/miniconda3/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 45, in load_keops
    return importlib.import_module(dll_name)
  File "/home/hicham/miniconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)
jeanfeydy commented 5 years ago

Hi Hicham,

Thanks for your detailed report! As far as I can tell, the problem comes from your version of g++, which is too old: std::is_trivially_copyable was introduced by C++11, alongside variadic templating - a key feature of the language on which KeOps relies at 100%. According to this table, to run KeOps, you will thus need nvcc>=7.0 and g++>=4.8.1 (or maybe >=6.0 to get full support of the stdlib... any modern C++ compiler should be OK).

According to the information provided by KeOps' verbose mode, it seems that under the hood, CMake decided to use nvcc in conjunction with the compiler referred to by the (symbolic link) /usr/bin/c++:

-- The CUDA Host CXX Compiler: /usr/bin/c++

Could you please report the result of the following command?

/usr/bin/c++ --version

If you get a reference to an old version of g++, using update-alternatives to re-direct c++ to a recent compiler should do the trick. (N.B.: please note that it shouldn't be too recent either, as nvcc is pretty picky... On Google Colab, nvcc==10.0 + c++==7.4.0 works just fine with KeOps.) Otherwise, we'll have to investigate further...

gdebie commented 5 years ago

Hi Jean,

Many thanks for your response! Here is a follow-up, as I am using the same machine.

I installed gcc, 7.3.0 version, in my conda environment (called gwen), using the command conda install gxx_linux-64. Consequently, python chooses this gcc when starting :

(gwen) [gwendoline@gpuserver bin]$ python3
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

I also checked that the right version of nvcc is installed:

(gwen) [gwendoline@gpuserver bin]$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

Nevertheless, the same error seems to appear:

(gwen) [gwendoline@gpuserver geomloss]$ python3 script.py
Compiling libKeOpsnumpy73a835aa5f in /home/gwendoline/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float64
... -- Compute properties automatically set to: -DMAXIDGPU=0;-DMAXTHREADSPERBLOCK0=1024;-DSHAREDMEMPERBLOCK0=49152
-- The CUDA Host CXX Compiler: /usr/bin/c++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gwendoline/.cache/pykeops-1.0.2

In file included from /home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/numpy/generic/generic_red.cpp:2:0:
/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/torch/lib/include/pybind11/numpy.h:288:5: erreur: ‘is_trivially_copyable’ is not a member of ‘std’
     std::is_trivially_copyable<T>,
     ^
/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/torch/lib/include/pybind11/numpy.h:288:5: erreur: ‘is_trivially_copyable’ is not a member of ‘std’
compilation terminated due to -fmax-errors=2.
gmake[3]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o] Erreur 1
gmake[2]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/all] Erreur 2
gmake[1]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/rule] Erreur 2
gmake: *** [libKeOpsnumpy73a835aa5f] Erreur 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpsnumpy73a835aa5f']' returned non-zero exit status 2.
[ 60%] Built target keopslibKeOpsnumpy73a835aa5f
[ 80%] Building CXX object CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o

--------------------- ----------- -----------------
Done.
Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 45, in load_keops
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 29, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 8, in <module>
    my_conv=Genred('-SqNorm2(x-y)',['x=Vi(3)','y=Vj(3)'])
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/numpy/generic/generic_red.py", line 114, in __init__
    self.myconv = load_keops(self.formula,  self.aliases,  self.dtype, 'numpy')
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 48, in load_keops
    return _safe_compile_and_load(formula, aliases, dll_name, dtype, lang, optional_flags)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/utils.py", line 70, in wrapper_filelock
    return func(*args, **kwargs)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 34, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)

Where do you think I should investigate further ?

Many thanks!

Gwendoline

bcharlier commented 5 years ago

Cmake is still using the gcc of your system:

-- The CUDA Host CXX Compiler: /usr/bin/c++

which is the bad one. Can you send the output of

(gwen) [gwendoline@gpuserver geomloss]$ which gcc

And then try to run your script with the CC and CXX env variable set to link to the right compiler

(gwen) [gwendoline@gpuserver geomloss]$ CC=/path/to/anaconda/gcc CXX=/path/to/anaconda/g++ python3 script.py

gdebie commented 5 years ago

Hi, Thanks a lot for getting back to me so quickly!

The command (gwen) [gwendoline@gpuserver geomloss]$ which gcc yields: /usr/local/bin/gcc which we also updated to a newer one (7.4.0):

(gwen) [gwendoline@gpuserver geomloss]$ /usr/local/bin/gcc --version
gcc (GCC) 7.4.0
Copyright © 2017 Free Software Foundation, Inc.
Ce logiciel est un logiciel libre; voir les sources pour les conditions de copie.  Il n'y a
AUCUNE GARANTIE, pas même pour la COMMERCIALISATION ni L'ADÉQUATION À UNE TÂCHE PARTICULIÈRE.

Folder /home/gwendoline/.conda/envs/gwen/bin contains the files x86_64-conda_cos6-linux-gnu-gcc (and others) setting the environment variables (I tried updating them manually before). The command (gwen) [gwendoline@gpuserver geomloss]$ CC=/home/gwendoline/.conda/envs/gwen/bin CXX=/home/gwendoline/.conda/envs/gwen/bin python3 script.py also yields the error. Similarly with paths to /usr/local/bin, (gwen) [gwendoline@gpuserver geomloss]$ CC=/usr/local/bin CXX=/usr/local/bin python3 script.py yields the same error:


Compiling libKeOpsnumpy73a835aa5f in /home/gwendoline/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float64
... -- Compute properties automatically set to: -DMAXIDGPU=0;-DMAXTHREADSPERBLOC                                                                             K0=1024;-DSHAREDMEMPERBLOCK0=49152
-- The CUDA Host CXX Compiler: /usr/bin/c++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3                                                                             .7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gwendoline/.cache/pykeops-1.0.2

In file included from /home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packa                                                                             ges/pykeops/numpy/generic/generic_red.cpp:2:0:
/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/torch/lib/include/                                                                             pybind11/numpy.h:288:5: erreur: ‘is_trivially_copyable’ is not a member of ‘std’
     std::is_trivially_copyable<T>,
     ^
/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/torch/lib/include/                                                                             pybind11/numpy.h:288:5: erreur: ‘is_trivially_copyable’ is not a member of ‘std’
compilation terminated due to -fmax-errors=2.
gmake[3]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.                                                                             cpp.o] Erreur 1
gmake[2]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/all] Erreur 2
gmake[1]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/rule] Erreur 2
gmake: *** [libKeOpsnumpy73a835aa5f] Erreur 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpsnumpy73a835aa5f']' retur                                                                             ned non-zero exit status 2.
[ 60%] Built target keopslibKeOpsnumpy73a835aa5f
[ 80%] Building CXX object CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/                                                                             generic_red.cpp.o

--------------------- ----------- -----------------
Done.
Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 45, in load_keops
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py",                                                                              line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKe                                                                             Opsnumpy73a835aa5f)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 29, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py",                                                                              line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKe                                                                             Opsnumpy73a835aa5f)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 8, in <module>
    my_conv=Genred('-SqNorm2(x-y)',['x=Vi(3)','y=Vj(3)'])
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/nu                                                                             mpy/generic/generic_red.py", line 114, in __init__
    self.myconv = load_keops(self.formula,  self.aliases,  self.dtype, 'numpy')
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 48, in load_keops
    return _safe_compile_and_load(formula, aliases, dll_name, dtype, lang, optio                                                                             nal_flags)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/utils.py", line 70, in wrapper_filelock
    return func(*args, **kwargs)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 34, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py",                                                                              line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKe                                                                             Opsnumpy73a835aa5f)
bcharlier commented 5 years ago

are you using last version of torch (v1.1)?

ps: if the gcc of your system is 7.4 this is not gcc pb and by the way the right command is : CC=/home/gwendoline/.conda/envs/gwen/bin/gcc CXX=/home/gwendoline/.conda/envs/gwen/bin/g++ python3 script.py

gdebie commented 5 years ago

Hi, I just upgraded to torch v1.1:

(gwen) [gwendoline@gpuserver geomloss]$ python3
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.1.0'
>>> exit()

However, (gwen) [gwendoline@gpuserver geomloss]$ CC=/home/gwendoline/.conda/envs/gwen/bin/x86_64-conda_cos6-linux-gnu-gcc CXX=/home/gwendoline/.conda/envs/gwen/bin/x86_64-conda_cos6-linux-gnu-g++ python3 script.py and (gwen) [gwendoline@gpuserver geomloss]$ CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ python3 script.py still yield the same error:

Compiling libKeOpsnumpy73a835aa5f in /home/gwendoline/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float64
... -- Compute properties automatically set to: -DMAXIDGPU=0;-DMAXTHREADSPERBLOCK0=1024;-DSHAREDMEMPERBLOCK0=49152
-- The CUDA Host CXX Compiler: /usr/bin/c++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gwendoline/.cache/pykeops-1.0.2

In file included from /home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/numpy/generic/generic_red.cpp:2:0:
/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/pybind11/include/pybind11/numpy.h:294:5: erreur: ‘is_trivially_copyable’ is not a member of ‘std’
     std::is_trivially_copyable<T>,
     ^
/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/pybind11/include/pybind11/numpy.h:294:5: erreur: ‘is_trivially_copyable’ is not a member of ‘std’
compilation terminated due to -fmax-errors=2.
gmake[3]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o] Erreur 1
gmake[2]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/all] Erreur 2
gmake[1]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/rule] Erreur 2
gmake: *** [libKeOpsnumpy73a835aa5f] Erreur 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpsnumpy73a835aa5f']' returned non-zero exit status 2.
[ 60%] Built target keopslibKeOpsnumpy73a835aa5f
[ 80%] Building CXX object CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o

--------------------- ----------- -----------------
Done.
Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 45, in load_keops
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 29, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 10, in <module>
    my_conv=Genred('-SqNorm2(x-y)',['x=Vi(3)','y=Vj(3)'])
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/numpy/generic/generic_red.py", line 114, in __init__
    self.myconv = load_keops(self.formula,  self.aliases,  self.dtype, 'numpy')
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 48, in load_keops
    return _safe_compile_and_load(formula, aliases, dll_name, dtype, lang, optional_flags)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/utils.py", line 70, in wrapper_filelock
    return func(*args, **kwargs)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 34, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f)

It is unclear to me why CXX compiler stilll uses the old version: The CUDA Host CXX Compiler: /usr/bin/c++, which is an old version: (gwen) [gwendoline@gpuserver bin]$ /usr/bin/c++ --version c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) Copyright © 2015 Free Software Foundation, Inc. Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER. after specifying CC and CXX paths correctly (pointing either to /usr/local/bin or /home/gwendoline/.conda/envs/gwen/bin to get a new version).

bcharlier commented 5 years ago

ok, the gcc of your systeme is still 4.8.

So, please :

1) Flush the cache dir $ rm -rf /home/gwendoline/.cache/pykeops-1.0.2/*

2) send me the output of

(gwen) [gwendoline@gpuserver geomloss]$ CC=/home/gwendoline/.conda/envs/gwen/bin/x86_64-conda_cos6-linux-gnu-gcc CXX=/home/gwendoline/.conda/envs/gwen/bin/x86_64-conda_cos6-linux-gnu-g++ CMAKE_CUDA_HOST_COMPILER=/home/gwendoline/.conda/envs/gwen/bin/ python3 script.py

b.

gdebie commented 5 years ago

It yields the following error:

Compiling libKeOpsnumpy73a835aa5f in /home/gwendoline/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float64
... -- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /home/gwendoline/.conda/envs/gwen/bin/x86_64-                                                                             conda_cos6-linux-gnu-g++
-- Check for working CXX compiler: /home/gwendoline/.conda/envs/gwen/bin/x86_64-                                                                             conda_cos6-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Compute properties automatically set to: -DMAXIDGPU=12;-DMAXTHREADSPERBLOCK0=                                                                             1024;-DSHAREDMEMPERBLOCK0=49152;-DMAXTHREADSPERBLOCK1=1024;-DSHAREDMEMPERBLOCK1=                                                                             49152;-DMAXTHREADSPERBLOCK2=1024;-DSHAREDMEMPERBLOCK2=49152;-DMAXTHREADSPERBLOCK                                                                             3=1024;-DSHAREDMEMPERBLOCK3=49152;-DMAXTHREADSPERBLOCK4=1024;-DSHAREDMEMPERBLOCK                                                                             4=49152;-DMAXTHREADSPERBLOCK5=1024;-DSHAREDMEMPERBLOCK5=49152;-DMAXTHREADSPERBLO                                                                             CK6=1024;-DSHAREDMEMPERBLOCK6=49152;-DMAXTHREADSPERBLOCK7=1024;-DSHAREDMEMPERBLO                                                                             CK7=49152;-DMAXTHREADSPERBLOCK8=1024;-DSHAREDMEMPERBLOCK8=49152;-DMAXTHREADSPERB                                                                             LOCK9=1024;-DSHAREDMEMPERBLOCK9=49152;-DMAXTHREADSPERBLOCK10=1024;-DSHAREDMEMPER                                                                             BLOCK10=49152;-DMAXTHREADSPERBLOCK11=1024;-DSHAREDMEMPERBLOCK11=49152;-DMAXTHREA                                                                             DSPERBLOCK12=1024;-DSHAREDMEMPERBLOCK12=49152
-- The CUDA compiler identification is NVIDIA 10.0.130
-- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- The CUDA Host CXX Compiler: /home/gwendoline/.conda/envs/gwen/bin/x86_64-cond                                                                             a_cos6-linux-gnu-g++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3                                                                             .7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- Found PythonInterp: /home/gwendoline/.conda/envs/gwen/bin/python3.7 (found ve                                                                             rsion "3.7.3")
-- Found PythonLibs: /home/gwendoline/.conda/envs/gwen/lib/libpython3.7m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- pybind11 v2.2.4
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gwendoline/.cache/pykeops-1.0.2

/usr/local/include/c++/7.4.0/type_traits(177): error: "conjunction_v" is not a f                                                                             unction or static data member

/usr/local/include/c++/7.4.0/type_traits(177): error: "constexpr" is not valid h                                                                             ere

/usr/local/include/c++/7.4.0/type_traits(180): error: "disjunction_v" is not a f                                                                             unction or static data member

/usr/local/include/c++/7.4.0/type_traits(180): error: "constexpr" is not valid h                                                                             ere

/usr/local/include/c++/7.4.0/type_traits(183): error: "negation_v" is not a func                                                                             tion or static data member

/usr/local/include/c++/7.4.0/type_traits(183): error: "constexpr" is not valid h                                                                             ere

/usr/local/include/c++/7.4.0/type_traits(2661): error: "is_swappable_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2661): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2666): error: "is_nothrow_swappable_v"                                                                              is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2666): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2745): error: "is_swappable_with_v" is                                                                              not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2745): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2750): error: "is_nothrow_swappable_wit                                                                             h_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2750): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2882): error: "is_invocable_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2882): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2886): error: "is_nothrow_invocable_v"                                                                              is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2886): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2891): error: "is_invocable_r_v" is not                                                                              a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2891): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2896): error: "is_nothrow_invocable_r_v                                                                             " is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2896): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2903): error: "is_void_v" is not a func                                                                             tion or static data member

/usr/local/include/c++/7.4.0/type_traits(2903): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2905): error: "is_null_pointer_v" is no                                                                             t a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2905): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2907): error: "is_integral_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2907): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2909): error: "is_floating_point_v" is                                                                              not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2909): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2911): error: "is_array_v" is not a fun                                                                             ction or static data member

/usr/local/include/c++/7.4.0/type_traits(2911): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2913): error: "is_pointer_v" is not a f                                                                             unction or static data member

/usr/local/include/c++/7.4.0/type_traits(2913): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2915): error: "is_lvalue_reference_v" i                                                                             s not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2915): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2918): error: "is_rvalue_reference_v" i                                                                             s not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2918): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2921): error: "is_member_object_pointer                                                                             _v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2921): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2924): error: "is_member_function_point                                                                             er_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2924): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2927): error: "is_enum_v" is not a func                                                                             tion or static data member

/usr/local/include/c++/7.4.0/type_traits(2927): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2929): error: "is_union_v" is not a fun                                                                             ction or static data member

/usr/local/include/c++/7.4.0/type_traits(2929): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2931): error: "is_class_v" is not a fun                                                                             ction or static data member

/usr/local/include/c++/7.4.0/type_traits(2931): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2933): error: "is_function_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2933): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2935): error: "is_reference_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2935): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2937): error: "is_arithmetic_v" is not                                                                              a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2937): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2939): error: "is_fundamental_v" is not                                                                              a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2939): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2941): error: "is_object_v" is not a fu                                                                             nction or static data member

/usr/local/include/c++/7.4.0/type_traits(2941): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2943): error: "is_scalar_v" is not a fu                                                                             nction or static data member

/usr/local/include/c++/7.4.0/type_traits(2943): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2945): error: "is_compound_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2945): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2947): error: "is_member_pointer_v" is                                                                              not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2947): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2949): error: "is_const_v" is not a fun                                                                             ction or static data member

/usr/local/include/c++/7.4.0/type_traits(2949): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2951): error: "is_volatile_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2951): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2953): error: "is_trivial_v" is not a f                                                                             unction or static data member

/usr/local/include/c++/7.4.0/type_traits(2953): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2955): error: "is_trivially_copyable_v"                                                                              is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2955): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2958): error: "is_standard_layout_v" is                                                                              not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2958): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2960): error: "is_pod_v" is not a funct                                                                             ion or static data member

/usr/local/include/c++/7.4.0/type_traits(2960): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2962): error: "is_literal_type_v" is no                                                                             t a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2962): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2964): error: "is_empty_v" is not a fun                                                                             ction or static data member

/usr/local/include/c++/7.4.0/type_traits(2964): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2966): error: "is_polymorphic_v" is not                                                                              a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2966): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2968): error: "is_abstract_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2968): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2970): error: "is_final_v" is not a fun                                                                             ction or static data member

/usr/local/include/c++/7.4.0/type_traits(2970): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2972): error: "is_signed_v" is not a fu                                                                             nction or static data member

/usr/local/include/c++/7.4.0/type_traits(2972): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2974): error: "is_unsigned_v" is not a                                                                              function or static data member

/usr/local/include/c++/7.4.0/type_traits(2974): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2976): error: "is_constructible_v" is n                                                                             ot a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2976): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2979): error: "is_default_constructible                                                                             _v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2979): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2982): error: "is_copy_constructible_v"                                                                              is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2982): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2985): error: "is_move_constructible_v"                                                                              is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2985): error: "constexpr" is not valid                                                                              here

/usr/local/include/c++/7.4.0/type_traits(2988): error: "is_assignable_v" is not                                                                              a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2988): error: "constexpr" is not valid                                                                              here

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_000010cb_00000000-7_link_                                                                             autodiff.compute_37.cpp1.ii".
Compilation terminated.
CMake Error at keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o.Release                                                                             .cmake:279 (message):
  Error generating file
  /home/gwendoline/.cache/pykeops-1.0.2/CMakeFiles/keopslibKeOpsnumpy73a835aa5f.                                                                             dir/keops/core/./keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o

gmake[3]: *** [CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/keops/core/keopslibKe                                                                             Opsnumpy73a835aa5f_generated_link_autodiff.cu.o] Erreur 1
gmake[2]: *** [CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/all] Erreur 2
gmake[1]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/rule] Erreur 2
gmake: *** [libKeOpsnumpy73a835aa5f] Erreur 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpsnumpy73a835aa5f']' retur                                                                             ned non-zero exit status 2.
[ 20%] Building NVCC (Device) object CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir                                                                             /keops/core/keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o

--------------------- ----------- -----------------
Done.
Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 45, in load_keops
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py",                                                                              line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 29, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py",                                                                              line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 10, in <module>
    my_conv=Genred('-SqNorm2(x-y)',['x=Vi(3)','y=Vj(3)'])
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/nu                                                                             mpy/generic/generic_red.py", line 114, in __init__
    self.myconv = load_keops(self.formula,  self.aliases,  self.dtype, 'numpy')
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 48, in load_keops
    return _safe_compile_and_load(formula, aliases, dll_name, dtype, lang, optio                                                                             nal_flags)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/utils.py", line 70, in wrapper_filelock
    return func(*args, **kwargs)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/co                                                                             mmon/keops_io.py", line 34, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py",                                                                              line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

Is it possible that there are 'incompatibilities' of some sort between my environment gcc (version 7.3.0) and the /usr/local/bin version (7.4.0) ?

bcharlier commented 5 years ago

1) flush your cache folder 2) try with to set CC, CXX and CMAKE_CUDA_HOST_COMPILER pointing to your /usr/local/bin/gxx

gdebie commented 5 years ago

I did: rm -rf /home/gwendoline/.cache/pykeops-1.0.2/* and CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ CMAKE_CUDA_HOST_COMPILER=/usr/local/bin/ python3 script.py, which yields:

Compiling libKeOpsnumpy73a835aa5f in /home/gwendoline/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float64
... -- The CXX compiler identification is GNU 7.4.0
-- Check for working CXX compiler: /usr/local/bin/g++
-- Check for working CXX compiler: /usr/local/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Compute properties automatically set to: -DMAXIDGPU=12;-DMAXTHREADSPERBLOCK0=1024;-DSHAREDMEMPERBLOCK0=49152;-DMAXTHREADSPERBLOCK1=1024;-DSHAREDMEMPERBLOCK1=49152;-DMAXTHREADSPERBLOCK2=1024;-DSHAREDMEMPERBLOCK2=49152;-DMAXTHREADSPERBLOCK3=1024;-DSHAREDMEMPERBLOCK3=49152;-DMAXTHREADSPERBLOCK4=1024;-DSHAREDMEMPERBLOCK4=49152;-DMAXTHREADSPERBLOCK5=1024;-DSHAREDMEMPERBLOCK5=49152;-DMAXTHREADSPERBLOCK6=1024;-DSHAREDMEMPERBLOCK6=49152;-DMAXTHREADSPERBLOCK7=1024;-DSHAREDMEMPERBLOCK7=49152;-DMAXTHREADSPERBLOCK8=1024;-DSHAREDMEMPERBLOCK8=49152;-DMAXTHREADSPERBLOCK9=1024;-DSHAREDMEMPERBLOCK9=49152;-DMAXTHREADSPERBLOCK10=1024;-DSHAREDMEMPERBLOCK10=49152;-DMAXTHREADSPERBLOCK11=1024;-DSHAREDMEMPERBLOCK11=49152;-DMAXTHREADSPERBLOCK12=1024;-DSHAREDMEMPERBLOCK12=49152
-- The CUDA compiler identification is NVIDIA 10.0.130
-- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- The CUDA Host CXX Compiler: /usr/local/bin/g++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- Found PythonInterp: /home/gwendoline/.conda/envs/gwen/bin/python3.7 (found version "3.7.3")
-- Found PythonLibs: /home/gwendoline/.conda/envs/gwen/lib/libpython3.7m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- pybind11 v2.2.4
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gwendoline/.cache/pykeops-1.0.2

/usr/local/include/c++/7.4.0/type_traits(177): error: "conjunction_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(177): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(180): error: "disjunction_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(180): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(183): error: "negation_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(183): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2661): error: "is_swappable_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2661): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2666): error: "is_nothrow_swappable_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2666): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2745): error: "is_swappable_with_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2745): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2750): error: "is_nothrow_swappable_with_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2750): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2882): error: "is_invocable_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2882): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2886): error: "is_nothrow_invocable_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2886): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2891): error: "is_invocable_r_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2891): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2896): error: "is_nothrow_invocable_r_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2896): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2903): error: "is_void_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2903): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2905): error: "is_null_pointer_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2905): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2907): error: "is_integral_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2907): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2909): error: "is_floating_point_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2909): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2911): error: "is_array_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2911): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2913): error: "is_pointer_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2913): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2915): error: "is_lvalue_reference_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2915): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2918): error: "is_rvalue_reference_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2918): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2921): error: "is_member_object_pointer_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2921): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2924): error: "is_member_function_pointer_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2924): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2927): error: "is_enum_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2927): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2929): error: "is_union_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2929): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2931): error: "is_class_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2931): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2933): error: "is_function_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2933): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2935): error: "is_reference_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2935): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2937): error: "is_arithmetic_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2937): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2939): error: "is_fundamental_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2939): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2941): error: "is_object_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2941): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2943): error: "is_scalar_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2943): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2945): error: "is_compound_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2945): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2947): error: "is_member_pointer_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2947): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2949): error: "is_const_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2949): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2951): error: "is_volatile_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2951): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2953): error: "is_trivial_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2953): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2955): error: "is_trivially_copyable_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2955): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2958): error: "is_standard_layout_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2958): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2960): error: "is_pod_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2960): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2962): error: "is_literal_type_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2962): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2964): error: "is_empty_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2964): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2966): error: "is_polymorphic_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2966): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2968): error: "is_abstract_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2968): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2970): error: "is_final_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2970): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2972): error: "is_signed_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2972): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2974): error: "is_unsigned_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2974): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2976): error: "is_constructible_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2976): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2979): error: "is_default_constructible_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2979): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2982): error: "is_copy_constructible_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2982): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2985): error: "is_move_constructible_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2985): error: "constexpr" is not valid here

/usr/local/include/c++/7.4.0/type_traits(2988): error: "is_assignable_v" is not a function or static data member

/usr/local/include/c++/7.4.0/type_traits(2988): error: "constexpr" is not valid here

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_000056d1_00000000-7_link_autodiff.compute_37.cpp1.ii".
Compilation terminated.
CMake Error at keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o.Release.cmake:279 (message):
  Error generating file
  /home/gwendoline/.cache/pykeops-1.0.2/CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/keops/core/./keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o

gmake[3]: *** [CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/keops/core/keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o] Erreur 1
gmake[2]: *** [CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/all] Erreur 2
gmake[1]: *** [CMakeFiles/libKeOpsnumpy73a835aa5f.dir/rule] Erreur 2
gmake: *** [libKeOpsnumpy73a835aa5f] Erreur 2

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpsnumpy73a835aa5f']' returned non-zero exit status 2.
[ 20%] Building NVCC (Device) object CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/keops/core/keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o

--------------------- ----------- -----------------
Done.
Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 45, in load_keops
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 29, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 10, in <module>
    my_conv=Genred('-SqNorm2(x-y)',['x=Vi(3)','y=Vj(3)'])
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/numpy/generic/generic_red.py", line 114, in __init__
    self.myconv = load_keops(self.formula,  self.aliases,  self.dtype, 'numpy')
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 48, in load_keops
    return _safe_compile_and_load(formula, aliases, dll_name, dtype, lang, optional_flags)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/utils.py", line 70, in wrapper_filelock
    return func(*args, **kwargs)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/site-packages/pykeops/common/keops_io.py", line 34, in _safe_compile_and_load
    return importlib.import_module(dll_name)
  File "/home/gwendoline/.conda/envs/gwen/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'
bcharlier commented 5 years ago

Dear Gwendoline,

As far as I can see, your gcc are correctly set up but as @fradav pointed out to us, it can be a problem coming from the very last c++ standard. Then, can you perform the following steps:

1) flush the cache.

2) edit the file path/to/pykeops/keops/headers.cmake and change the flag std=c++11 to std=c++17 on line 6 and 8. To get the precise location of path/to/pykeops/ in a python3 shell run:

import pykeops
print(pykeops.__file__)

It will return the installation dir that you need.

3) rerun CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ CMAKE_CUDA_HOST_COMPILER=/usr/local/bin/ python3 script.py

hope it will work....

b.

fradav commented 5 years ago

No need to edit the cmake. Just CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ CMAKE_CUDA_HOST_COMPILER=/usr/local/bin/ CXXFLAGS=-std=c++17 python3 script.py

gdebie commented 5 years ago

Hi, Thanks a lot for both responses! I did @fradav's solution first, which yielded the same error. Then I did @bcharlier's: an error still occurs, but further down in the type_traits file (line 3098 instead of 177):

Compiling libKeOpsnumpy73a835aa5f in /home/gwendoline/.cache/pykeops-1.0.2/:
       formula: Sum_Reduction(-SqNorm2(x-y),1)
       aliases: x = Vi(0,3); y = Vj(1,3);
       dtype  : float64
... -- The CXX compiler identification is GNU 7.4.0
-- Check for working CXX compiler: /usr/local/bin/g++
-- Check for working CXX compiler: /usr/local/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Compute properties automatically set to: -DMAXIDGPU=12;-DMAXTHREADSPERBLOCK0=                                                                                                                     1024;-DSHAREDMEMPERBLOCK0=49152;-DMAXTHREADSPERBLOCK1=1024;-DSHAREDMEMPERBLOCK1=                                                                                                                     49152;-DMAXTHREADSPERBLOCK2=1024;-DSHAREDMEMPERBLOCK2=49152;-DMAXTHREADSPERBLOCK                                                                                                                     3=1024;-DSHAREDMEMPERBLOCK3=49152;-DMAXTHREADSPERBLOCK4=1024;-DSHAREDMEMPERBLOCK                                                                                                                     4=49152;-DMAXTHREADSPERBLOCK5=1024;-DSHAREDMEMPERBLOCK5=49152;-DMAXTHREADSPERBLO                                                                                                                     CK6=1024;-DSHAREDMEMPERBLOCK6=49152;-DMAXTHREADSPERBLOCK7=1024;-DSHAREDMEMPERBLO                                                                                                                     CK7=49152;-DMAXTHREADSPERBLOCK8=1024;-DSHAREDMEMPERBLOCK8=49152;-DMAXTHREADSPERB                                                                                                                     LOCK9=1024;-DSHAREDMEMPERBLOCK9=49152;-DMAXTHREADSPERBLOCK10=1024;-DSHAREDMEMPER                                                                                                                     BLOCK10=49152;-DMAXTHREADSPERBLOCK11=1024;-DSHAREDMEMPERBLOCK11=49152;-DMAXTHREA                                                                                                                     DSPERBLOCK12=1024;-DSHAREDMEMPERBLOCK12=49152
-- The CUDA compiler identification is NVIDIA 10.0.130
-- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- The CUDA Host CXX Compiler: /usr/local/bin/g++
-- Autodetected CUDA architecture(s):  6.0 6.0 6.0 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3                                                                                                                     .7 3.7 3.7
-- Using shared_obj_name: libKeOpsnumpy73a835aa5f
-- Found PythonInterp: /home/gwendoline/.conda/envs/gwen/bin/python3.7 (found ve                                                                                                                     rsion "3.7.3")
-- Found PythonLibs: /home/gwendoline/.conda/envs/gwen/lib/libpython3.7m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- pybind11 v2.2.4
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gwendoline/.cache/pykeops-1.0.2

/usr/local/include/c++/7.4.0/type_traits(3098): error: type name is not allowed
fradav commented 5 years ago

My best guess is that the cuda compiler doesn't like the gcc 7.4.0 includes. We need to reproduce your error at this point.

tlacombe commented 5 years ago

Hi everyone, If this can be of any help: I am using the same machine as gdebie and hichamjanati (on a different user session), and for me the code proposed by Hicham worked perfectly (so does the following geomloss library, at least on few examples).

I did a fresh install this morning, so it might be that there have been some update in pykeops install or so since the beginning of this thread ; but if needed this the current setup on my user session:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
$ gcc --version
gcc (GCC) 7.4.0
Copyright © 2017 Free Software Foundation, Inc.
$ cmake --version
cmake3 version 3.13.5

Note that I installed cmake3 using yum install cmake3 followed by some indications provided there.

conda list
...
pytorch                   1.1.0           py3.7_cuda10.0.130_cudnn7.5.1_0    pytorch
...

with this, everything seems fine so far.

hassanhaija commented 5 years ago

Hi all,

I'm facing the same problem as well. I installed gcc 7.4 and nvcc 10.0 and still getting the same problem. Any ideas ?

nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2018 NVIDIA Corporation Built on Sat_Aug_25_21:08:01_CDT_2018 Cuda compilation tools, release 10.0, V10.0.130 gcc --version gcc (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc.

` Compiling libKeOpsnumpy73a835aa5f in /home/hassanhaija/.cache/pykeops-1.0.2/: formula: Sum_Reduction(-SqNorm2(x-y),1) aliases: x = Vi(0,3); y = Vj(1,3); dtype : float64 ... -- The CXX compiler identification is GNU 7.4.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for C++ include pthread.h -- Looking for C++ include pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Compute properties automatically set to: -DMAXIDGPU=1;-DMAXTHREADSPERBLOCK0=1024;-DSHAREDMEMPERBLOCK0=49152;-DMAXTHREADSPERBLOCK1=1024;-DSHAREDMEMPERBLOCK1=49152 -- The CUDA compiler identification is NVIDIA 10.0.130 -- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc -- Check for working CUDA compiler: /usr/local/cuda-10.0/bin/nvcc -- works -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- The CUDA Host CXX Compiler: /usr/bin/c++ -- Autodetected CUDA architecture(s): 6.1 6.1 -- Using shared_obj_name: libKeOpsnumpy73a835aa5f -- Found PythonInterp: /home/hassanhaija/anaconda3/bin/python3.7 (found version "3.7.1") -- Found PythonLibs: /home/hassanhaija/anaconda3/lib/libpython3.7m.so -- Performing Test HAS_CPP14_FLAG -- Performing Test HAS_CPP14_FLAG - Success -- pybind11 v2.2.4 -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- LTO enabled -- Configuring done -- Generating done -- Build files have been written to: /home/hassanhaija/.cache/pykeops-1.0.2

[ 20%] Building NVCC (Device) object CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/keops/core/keopslibKeOpsnumpy73a835aa5f_generated_link_autodiff.cu.o Scanning dependencies of target keopslibKeOpsnumpy73a835aa5f [ 40%] Linking CUDA device code CMakeFiles/keopslibKeOpsnumpy73a835aa5f.dir/cmake_device_link.o [ 60%] Linking CXX shared library libKeOpsnumpy73a835aa5f.so [ 60%] Built target keopslibKeOpsnumpy73a835aa5f Scanning dependencies of target libKeOpsnumpy73a835aa5f [ 80%] Building CXX object CMakeFiles/libKeOpsnumpy73a835aa5f.dir/numpy/generic/generic_red.cpp.o [100%] Linking CXX shared module libKeOpsnumpy73a835aa5f.cpython-37m-x86_64-linux-gnu.so [100%] Built target libKeOpsnumpy73a835aa5f

Done. Traceback (most recent call last): File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/site-packages/pykeops/common/keops_io.py", line 45, in load_keops return importlib.import_module(dll_name) File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 953, in _find_and_load_unlocked ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/site-packages/pykeops/common/keops_io.py", line 29, in _safe_compile_and_load return importlib.import_module(dll_name) File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 953, in _find_and_load_unlocked ModuleNotFoundError: No module named 'libKeOpsnumpy73a835aa5f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "keopstest.py", line 9, in my_conv = Genred('-SqNorm2(x-y)', ['x = Vi(3)', 'y = Vj(3)']) File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/site-packages/pykeops/numpy/generic/generic_red.py", line 114, in init self.myconv = load_keops(self.formula, self.aliases, self.dtype, 'numpy') File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/site-packages/pykeops/common/keops_io.py", line 48, in load_keops return _safe_compile_and_load(formula, aliases, dll_name, dtype, lang, optional_flags) File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/site-packages/pykeops/common/utils.py", line 70, in wrapper_filelock return func(*args, **kwargs) File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/site-packages/pykeops/common/keops_io.py", line 34, in _safe_compile_and_load return importlib.import_module(dll_name) File "/home/hassanhaija/anaconda3/envs/py36/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 658, in _load_unlocked File "", line 571, in module_from_spec File "", line 922, in create_module File "", line 219, in _call_with_frames_removed ImportError: dynamic module does not define module export function (PyInit_libKeOpsnumpy73a835aa5f) `

bcharlier commented 5 years ago

The solution is given by @tlacombe here.