g4py building errors with TLS reference - makefile

I'm trying to compile g4py. I have already used "./configure" and now I'm trying to run "make", but during compilation there appear a few errors, which all look similar to this first one:
Building a module G4event.so ...
/usr/bin/ld: anEventAllocator: TLS reference in /home/marcin/geant4/geant4.10.0-install/lib64/libG4persistency.so mismatches non-TLS reference in pyG4Event.o
/home/marcin/geant4/geant4.10.0-install/lib64/libG4persistency.so: error adding symbols: bad value
collect2: error: ld returned 1 exit status
Than after "make install" I get same erros and after that I can't import g4py, because of error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/marcin/geant4/geant4.10.0-install/g4py/lib/Geant4/__init__.py", line 17, in <module>
from G4intercoms import *
ImportError: /home/marcin/geant4/geant4.10.0-install/g4py/lib/Geant4/G4intercoms.so: undefined symbol: G4cout
Does anyone know what it is going about??

Make sure to link against a non-multithreading build of Geant 4.10, since g4py does not have multithreading support, yet. You can build a non-multithreading version by specifying -DGEANT4_BUILD_MULTITHREADED=OFF when configuring your GEANT4 installation using cmake.

Related

labelImg using with m1 pro issue with pip install pip3 install pyqt5 lxml

I am currently trying to run labelImg on my mac m1pro. When trying to install qt5 with "pip3 install pyqt5 lxml" i get this error message:
`
Collecting PyQt5
Using cached PyQt5-5.15.7.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Querying qmake about your Qt installation...
Traceback (most recent call last):
File "/Users/romanxaver/miniforge3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 144, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/romanxaver/miniforge3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
main()
File "/Users/romanxaver/miniforge3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/romanxaver/miniforge3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 148, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/private/var/folders/wm/t87_jx651gvfm3t05dzg24440000gn/T/pip-build-env-lmy12lan/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 46, in build_wheel
project = AbstractProject.bootstrap('wheel',
File "/private/var/folders/wm/t87_jx651gvfm3t05dzg24440000gn/T/pip-build-env-lmy12lan/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/private/var/folders/wm/t87_jx651gvfm3t05dzg24440000gn/T/pip-build-env-lmy12lan/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 601, in setup
self.update(tool)
File "project.py", line 166, in update
sipbuild.exceptions.UserException
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
`
Does anyone know the solution to this? When i try to install it with brew i get the following error at the point of "make qt5py3":
pyrcc5 -o libs/resources.py resources.qrc /Users/xxx/miniforge3/bin/python3: No module named PyQt5.pyrcc_main make: *** [qt5py3] Error 1
I wanted to install labelImg on my m1pro

Problem executing colcon build with Ros2 Foxy windows

I am getting the following tracebacks when I try to colcon build my workspace (I am using Ros2 Foxy in windows):
--- stderr: dynamixel_sdk_custom_interfaces
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\yimmi\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Users\yimmi\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "ctypes\__init__.py", line 373, in __init__
OSError: [WinError 193] %1 no es una aplicaci¾n Win32 vßlida
CMake Error at C:/opt/ros/foxy/x64/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:213 (message):
execute_process(C:/opt/ros/foxy/x64/python.exe -c 'import
numpy;print(numpy.get_include())') returned error code 1
Call Stack (most recent call first):
C:/opt/ros/foxy/x64/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/opt/ros/foxy/x64/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:31 (rosidl_generate_interfaces)
Does anyone know how to solve it?
I notice this:
WinError 193
It looks your python runtime version is not match Numpy (CPU arch different?). Maybe you had installed Anacoda and it overrides the default python path.
You could try to check your python path.

Trying get Open MPI to play nicely with Fortran on OS X

I'm trying to run a case for the software ExoPlaSim on my MacBook. While the software is built primarily for Linux, it can run on Mac according to the developer instructions. I'm running a simple default "case" script and I'm getting quite a long chain of errors. I suspect (correct me if I'm wrong) that a major reason for these errors is that Open MPI and Fortran aren't playing nicely. I lack the dev knowledge to troubleshoot this, hence my hope for some help. :)
I think these following errors (end of Terminal output) are perhaps the most salient, and may indicate Fortran/Open MPI problems:
ld: library not found for -lm
collect2: error: ld returned 1 exit status
make: *** [makefile:48: plasim.x] Error 1
ld: library not found for -lm
collect2: error: ld returned 1 exit status
ld: library not found for -lm
collect2: error: ld returned 1 exit status
cp: plasim.x: No such file or directory
cp: ../bin/most_plasim_t21_l10_p2.x: No such file or directory
cp: /Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/plasim/run/most_plasim_t21_l10_p2.x: No such file or directory
Mean Molecular Weight set to 28.9703 g/mol
rm: /Users/[name]/ExoPlaSim_Testing/mymodel_testrun/plasim_restart: No such file or directory
Command '['mpiexec -np 2 most_plasim_t21_l10_p2.x']' returned non-zero exit status 134.
Traceback (most recent call last):
File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 796, in _run
subprocess.run([self._exec+self.executable],shell=True,check=True,
File "/usr/local/Cellar/python#3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['mpiexec -np 2 most_plasim_t21_l10_p2.x']' returned non-zero exit status 134.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/[name]/ExoPlaSim_Testing/testing_exoplasim.py", line 4, in <module>
mymodel.run(years=10,crashifbroken=True)
File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 389, in run
self._run(**kwargs)
File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 876, in _run
self._crash() #Bring in the cleaners
File "/Users/[name]/Library/Python/3.9/lib/python/site-packages/exoplasim/__init__.py", line 1383, in _crash
raise RuntimeError("ExoPlaSim has crashed or begun producing garbage. All working files have been moved to %s_crashed/"%(os.getcwd()+"/"+self.modelname))
RuntimeError: ExoPlaSim has crashed or begun producing garbage. All working files have been moved to /Users/[name]/ExoPlaSim_Testing/mymodel_crashed/
I am using Big Sur 11.5 with compilers GNU Fortran/GCC 11.3.0. I used brew to install Open MPI, and the version I'm running (according to ompi_info command in terminal) is 4.1.4, which I believe should work with Fortran. Open-mpi.org does list some instructions for getting a new version of Open MPI to work on OS-X (see #7: open-mpi.org) though I don't quite understand the directions since it's outside my limited dev knowledge base. I don't know if this is the solution to my problem either.
The script I'm using is the base case script for ExoPlaSim (below) It's python.
import exoplasim as exo
mymodel = exo.Model(workdir="mymodel_testrun",modelname="mymodel",resolution="T21",layers=10,ncpus=8)
mymodel.configure()
mymodel.exportcfg()
mymodel.run(years=100,crashifbroken=True)
mymodel.finalize("mymodel_output")
Please note there should be nothing wrong with this script. It works for other users and is the script the software dev recommends using in testing. I'm looking for configuration/install solutions of the relevant libraries on my Mac. This isn't a problem with the software ExoPlaSim.

Symbol not found in flat namespace '_MQBACK' (Python3.9 - MacOS 12.1 Silicon)

Installing pymqi in a MacOS M1 Pro 12.1 Monterey, Python 3.9.9 in a virtualenv and the usual suspect appeared again:
Traceback (most recent call last):
File "/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/__init__.py", line 132, in <module>
from . import pymqe # type: ignore
ImportError: dlopen(/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/pymqe.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_MQBACK'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/__init__.py", line 134, in <module>
import pymqe # type: ignore # Backward compatibility
ModuleNotFoundError: No module named 'pymqe'
All paths are in place /opt/mqm/bin:/opt/mqm/samp/bin and Python sees the env variable os.environ['DYLD_LIBRARY_PATH']=='/opt/mqm/lib64'
After reinstalling pymqi with --verbose flag, this warning showed up:
ld: warning: ignoring file /opt/mqm/lib64/libmqic_r.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Might be the root cause of the exception symbol not found in flat namespace '_MQBACK' in M1 Pro Silicon platforms ?
It says that ibmqic_r.dylib is ignored.
Would a new release of MacOS Toolkit build for macOS-arm64 solve the issue?
Another option - theoretically speaking - could be to run the build for macOS-x86_64 with Rosetta 2 as suggested in this post, I don't know how to do it..
Any help will be mostly appreciated.

Unable to install z3

I'm trying to build Z3 from sources (v. 4.3.1., Nov 2013, z3-89c1785b7322), using make/g++ and Python, with the following results
autoconf -- succeeded
./configure -- succeeded
python scripts/mk_make.py -- error message, given below
Traceback (most recent call last):
File "scripts/mk_make.py", line 20, in <module>
mk_makefile()
File "/home/davidg/z3/scripts/mk_util.py", line 854, in mk_makefile
c.mk_makefile(out)
File "/home/davidg/z3/scripts/mk_util.py", line 666, in mk_makefile
for cppfile in self.src_files():
File "/home/davidg/z3/scripts/mk_util.py", line 659, in src_files
return get_cpp_files(self.ex_dir)
File "/home/davidg/z3/scripts/mk_util.py", line 246, in get_cpp_files
return filter(lambda f: f.endswith('.cpp'), os.listdir(path))
OSError: [Errno 2] No such file or directory: 'examples/c++'
I don't know if that should be a fatal error. Proceeding as if it's not,
cd build
make
seem to succeed, concluding with the message "Z3 was successfully built." The next step
sudo make install
fails with the error
No rule to make target `install`
(There's also no target for 'uninstall'.)
Grateful for any help
Together with the Z3 sources you should have received the examples directory. The configuration fails because it can't find the examples/c++ directory (in which there should be a file called example.cpp). At that point only parts of the Makefile have been written, enough for the main target to succeed, but the install target hasn't been written to the Makefile yet, that's why it fails.

Resources