-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fatal error while installing #48
Comments
Hello, you might want to check your gcc version. |
Could this fasttext issue be relevant? facebookresearch/fastText#386 (comment) |
Yes the problem seems to be close to that but in my case it seems that it is a bit different since the error comes from the sent2vec.cpp file. |
I don t have a mac to test this, but maybe try adding this code in def has_flag(compiler, flags):
"""Return a boolean indicating whether a flag name is supported on
the specified compiler.
"""
import tempfile
with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f:
f.write('int main (int argc, char **argv) { return 0; }')
try:
compiler.compile([f.name], extra_postargs=flags)
except setuptools.distutils.errors.CompileError:
return False
return True
def cpp_flag(compiler):
"""Return the -std=c++[0x/11/14] compiler flag.
The c++14 is preferred over c++0x/11 (when it is available).
"""
standards = ['-std=c++14', '-std=c++11', '-std=c++0x']
for standard in standards:
if has_flag(compiler, [standard]):
return standard
raise RuntimeError(
'Unsupported compiler -- at least C++0x support '
'is needed!'
)
class BuildExt(build_ext):
"""A custom build extension for adding compiler-specific options."""
c_opts = {
'msvc': ['/EHsc'],
'unix': [],
}
def build_extensions(self):
if sys.platform == 'darwin':
all_flags = ['-stdlib=libc++', '-mmacosx-version-min=10.7']
if has_flag(self.compiler, [all_flags[0]]):
self.c_opts['unix'] += [all_flags[0]]
elif has_flag(self.compiler, all_flags):
self.c_opts['unix'] += all_flags
else:
raise RuntimeError(
'libc++ is needed! Failed to compile with {} and {}.'.
format(" ".join(all_flags), all_flags[0])
)
ct = self.compiler.compiler_type
opts = self.c_opts.get(ct, [])
if ct == 'unix':
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
opts.append(cpp_flag(self.compiler))
if has_flag(self.compiler, ['-fvisibility=hidden']):
opts.append('-fvisibility=hidden')
elif ct == 'msvc':
opts.append(
'/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()
)
for ext in self.extensions:
ext.extra_compile_args = opts
build_ext.build_extensions(self) And replace the call to setup by: setup(
name='sent2vec',
ext_modules=cythonize(ext),
cmdclass={'build_ext': BuildExt}
) The extra code is coming from the |
Yes ! it worked !! |
This worked for me to a point. I'm now getting
|
When I try to compile the library as Setup & Requirements suggests by running make command, errors pop up as below: |
Do you still have the same error? Or are you able to install it now? |
I was receiving the following fatal error on Mac: It got resolved by adding https://stackoverflow.com/questions/53809584/issues-about-installing-pcl-in-my-computer |
Hello !
while installing, I ran
python setup.py build_ext
I got this answer
installation of fastest did not make any trouble ...
indeed the complete answer is
any idea ?
thank you for your answers ;)
The text was updated successfully, but these errors were encountered: