Skip to content

Error building native library in Fedora 28 #1

@bgatessucks

Description

@bgatessucks

Notice I edited ~/.Mathematica/Paclets/Repository/PJLink-.0.2/PJLink/MathLinkEnvironment.py:666 to reflect the actual installation root for Mathematica.

running build
running build_ext
building 'PJLinkNativeLibrary' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /opt/anaconda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/Wolfram/Mathematica/11.3/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions -I/opt/anaconda/include/python3.6m -c PJLinkNativeLibrary.cpp -o build/temp.linux-x86_64-3.6/PJLinkNativeLibrary.o
g++ -pthread -shared -B /opt/anaconda/compiler_compat -L/opt/anaconda/lib -Wl,-rpath=/opt/anaconda/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/PJLinkNativeLibrary.o -L/opt/Wolfram/Mathematica/11.3/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions -lMLi4 -o /home/fsiano/.Mathematica/Paclets/Repository/PJLink-1.0.2/PJLink/PJLinkNativeLibrary/src/PJLinkNativeLibrary.cpython-36m-x86_64-linux-gnu.so
An exception has occurred, use %tb to see the full traceback.

SystemExit: error: command 'g++' failed with exit status 1


/opt/anaconda/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2918: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

and %tb gives

---------------------------------------------------------------------------
DistutilsExecError                        Traceback (most recent call last)
/opt/anaconda/lib/python3.6/distutils/unixccompiler.py in link(self, target_desc, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang)
    196 
--> 197                 self.spawn(linker + ld_args)
    198             except DistutilsExecError as msg:

/opt/anaconda/lib/python3.6/distutils/ccompiler.py in spawn(self, cmd)
    908     def spawn(self, cmd):
--> 909         spawn(cmd, dry_run=self.dry_run)
    910 

/opt/anaconda/lib/python3.6/distutils/spawn.py in spawn(cmd, search_path, verbose, dry_run)
     35     if os.name == 'posix':
---> 36         _spawn_posix(cmd, search_path, dry_run=dry_run)
     37     elif os.name == 'nt':

/opt/anaconda/lib/python3.6/distutils/spawn.py in _spawn_posix(cmd, search_path, verbose, dry_run)
    158                           "command %r failed with exit status %d"
--> 159                           % (cmd, exit_status))
    160             elif os.WIFSTOPPED(status):

DistutilsExecError: command 'g++' failed with exit status 1

During handling of the above exception, another exception occurred:

LinkError                                 Traceback (most recent call last)
/opt/anaconda/lib/python3.6/distutils/core.py in setup(**attrs)
    147         try:
--> 148             dist.run_commands()
    149         except KeyboardInterrupt:

/opt/anaconda/lib/python3.6/distutils/dist.py in run_commands(self)
    954         for cmd in self.commands:
--> 955             self.run_command(cmd)
    956 

/opt/anaconda/lib/python3.6/distutils/dist.py in run_command(self, command)
    973         cmd_obj.ensure_finalized()
--> 974         cmd_obj.run()
    975         self.have_run[command] = 1

/opt/anaconda/lib/python3.6/distutils/command/build.py in run(self)
    134         for cmd_name in self.get_sub_commands():
--> 135             self.run_command(cmd_name)
    136 

/opt/anaconda/lib/python3.6/distutils/cmd.py in run_command(self, command)
    312         """
--> 313         self.distribution.run_command(command)
    314 

/opt/anaconda/lib/python3.6/distutils/dist.py in run_command(self, command)
    973         cmd_obj.ensure_finalized()
--> 974         cmd_obj.run()
    975         self.have_run[command] = 1

/opt/anaconda/lib/python3.6/distutils/command/build_ext.py in run(self)
    338         # Now actually compile and link everything.
--> 339         self.build_extensions()
    340 

/opt/anaconda/lib/python3.6/distutils/command/build_ext.py in build_extensions(self)
    447         else:
--> 448             self._build_extensions_serial()
    449 

/opt/anaconda/lib/python3.6/distutils/command/build_ext.py in _build_extensions_serial(self)
    472             with self._filter_build_errors(ext):
--> 473                 self.build_extension(ext)
    474 

/opt/anaconda/lib/python3.6/distutils/command/build_ext.py in build_extension(self, ext)
    557             build_temp=self.build_temp,
--> 558             target_lang=language)
    559 

/opt/anaconda/lib/python3.6/distutils/ccompiler.py in link_shared_object(self, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang)
    716                   export_symbols, debug,
--> 717                   extra_preargs, extra_postargs, build_temp, target_lang)
    718 

/opt/anaconda/lib/python3.6/distutils/unixccompiler.py in link(self, target_desc, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang)
    198             except DistutilsExecError as msg:
--> 199                 raise LinkError(msg)
    200         else:

LinkError: command 'g++' failed with exit status 1

During handling of the above exception, another exception occurred:

SystemExit                                Traceback (most recent call last)
<ipython-input-3-a1f503dd0203> in <module>()
----> 1 ker = SubprocessKernel()
      2 def MEval (expr, wait = True, kernel = ker):
      3     """MEval evaluates a Mathematica expression in the Mathematica kernel
      4 
      5     """

~/.Mathematica/Paclets/Repository/PJLink-1.0.2/SubprocessKernel/SubprocessKernel.py in __init__(self, init, debug_level)
     15 
     16     def __init__(self, init = None, debug_level = 0):
---> 17         super().__init__(NativeLink(init=init, debug_level=debug_level))
     18         self.__py_eval_link = None
     19         self.__reader = None

~/.Mathematica/Paclets/Repository/PJLink-1.0.2/PJLink/NativeLink.py in __init__(self, init, debug_level)
     46         self._init = init
     47         self.__errMsgOut = [ "" ]
---> 48         self._loadNativeLibrary(debug_level=debug_level)
     49 
     50         self.__markStack = deque()

~/.Mathematica/Paclets/Repository/PJLink-1.0.2/PJLink/NativeLink.py in _loadNativeLibrary(self, initialize, debug_level, setup, *args)
    127                         argv1 = sys.argv
    128                         sys.argv = [ "-q", "build", "build_ext", "--inplace" ]
--> 129                         import setup as setup
    130                         sys.path.pop(0)
    131                         sys.argv = argv1

~/.Mathematica/Paclets/Repository/PJLink-1.0.2/PJLink/PJLinkNativeLibrary/src/setup.py in <module>()
     54        version = '1.0',
     55        description = 'Implementation of JLinkNativeLibrary for python',
---> 56        ext_modules = [module1]
     57        )
     58 

/opt/anaconda/lib/python3.6/distutils/core.py in setup(**attrs)
    161                 raise
    162             else:
--> 163                 raise SystemExit("error: " + str(msg))
    164 
    165     return dist

SystemExit: error: command 'g++' failed with exit status 1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions