|
[Sponsors] | |||||
OSError: fcntl.flock Function not implemented |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Mag
Join Date: Oct 2021
Location: Bangalore, India
Posts: 10
Rep Power: 6 ![]() |
I am installing SU2-8.2.0 on our HPC server. I am using the following command for configuring on the server.
./meson.py build --prefix=/home/magans/SU2-8.2.0 -Dcustom-mpi=true I am getting the following error. File "/home/magans/SU2-8.2.0/externals/meson/mesonbuild/mesonlib/posix.py", line 32, in __enter__fcntl.flock(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB) OSError: [Errno 38] Function not implemented Searching for this error shows that the server file system does not support the file locking function "fcntl.flock." Your small help can make a big difference for me. Thank you in advance. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 833
Rep Power: 23 ![]() |
Looks like the hpc indeed does not have lock support.
Do you need to load modules on the hpc? Maybe load some python libraries? If your hpc supports conda environments, you can try creating a conda environment with a recent python version and try compiling from there. I think posix.py is in the package os-sys. |
|
|
|
|
|
|
|
|
#3 |
|
New Member
Mag
Join Date: Oct 2021
Location: Bangalore, India
Posts: 10
Rep Power: 6 ![]() |
I tried this installation after creating the conda environment.
What i think, error can be resolved by using some other function in posix.py that is compatible with the hpc file system. I'm still on this. Let's see. |
|
|
|
|
|
|
|
|
#4 |
|
New Member
Mag
Join Date: Oct 2021
Location: Bangalore, India
Posts: 10
Rep Power: 6 ![]() |
I solved this error by bypassing fcntl.flock function as our system's file system does not support this function. We changed SU2-8.2.0/externals/meson/mesonbuild/mesonlib/posix.py script to the following. You can do so if you are using meson in a container or an isolated environment where no concurrency is possible.
-------------------------------------------------- import fcntl import typing as T from .universal import MesonException from .platform import BuildDirLock as BuildDirLockBase __all__ = ['BuildDirLock'] class BuildDirLock(BuildDirLockBase): def __enter__(self) -> None: self.lockfile = open(self.lockfilename, 'w', encoding='utf-8') try: fcntl.flock(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB) except (BlockingIOError, PermissionError): self.lockfile.close() raise MesonException('Some other Meson process is already using this build directory. Exiting.') except OSError as e: if e.errno == 38: # Function not implemented print('Warning: File locking is not supported on this filesystem. Continuing without lock.') else: self.lockfile.close() raise def __exit__(self, *args: T.Any) -> None: try: fcntl.flock(self.lockfile, fcntl.LOCK_UN) except OSError: pass # Ignore unlock errors if lock was never acquired self.lockfile.close() -------------------------------------------- |
|
|
|
|
|
![]() |
| Tags |
| fcntl.flock function, file system |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [snappyHexMesh] How to define to right point for locationInMesh | Mirage12 | OpenFOAM Meshing & Mesh Conversion | 7 | March 13, 2016 15:07 |
| [swak4Foam] installation problem with version 0.2.3 | Claudio87 | OpenFOAM Community Contributions | 9 | May 8, 2013 11:20 |
| [blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |
| OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |
| Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 07:27 |